Questions tagged [rust-lifetimes]
The rust-lifetimes tag has no usage guidance.
rust-lifetimes
3
questions
5
votes
0
answers
108
views
"The parameter type `T` must be valid for the static lifetime" Only when not in `async` block
This code fails to compile
use tokio_util::task::LocalPoolHandle;
pub struct Test<T> {
thread_pool: LocalPoolHandle,
writer_provider: T,
}
impl<T> Test<T>
{
async fn ...
3
votes
1
answer
101
views
Why does `Option::map` work with immutable data, but not with mutable data
Why does the immutable version in the following example work, but the mutable version does not compile with error error: lifetime may not live long enough?
trait Car {
fn honk(&self);
}
...
0
votes
1
answer
63
views
How to fix lifetime issue in Rust?
In summary, I want to have a function that digests a CSV file and depending on the existing values, it should decide with on_conflict if the current value or the new value should be used.
However, I ...