Closed Geobert closed 4 years ago
S: 'static
includes owned types like String
, so you can pass a vector of String
s as attrs
(but not a vector of references to String
s). If you have a vector of &str
s of unknown provenance, you need to turn it into a vector of String
s.
The S: 'static
bound is needed because of the addition of search adapters, which are trait objects and come with the 'static
bound by default. Trying to relax the bound is complicated because of the need to sling the Future-implementing structs between threads, and I'm not sure that it can be done at all.
I didn't know about String
being 'static
! Thanks!
I indeed have a Vec<&'a str>
because the script AST stays in memory the whole time.
I found the way to relax the 'static
bound, so references can be used again in the attr
vector. It required a bit of fiddling with lifetimes, but so far it seems to work.
Hi,
Among the incoming changes with 0.7, I noticed that
LdapConn::search
now needs'static
lifetime forattrs
, why is that? Doesn't that make the whole function unusable?I have an internal test tool that receive the parameters from a script, so my attrs are not
'static
per se even if they live the whole program lifetime. Or maybe (and probably) I'm missing something?