Let's say I'm implementing some type of map-like structure that I'd
like to be able to implement the Map trait on.

However, my map doesn't actually store the 'V' directly, but they are
computed/retrieve/cached in some manner.

Is this possible with the existing map trait?  Given that:

 fn find<'a>(&'a self, key: &K) -> Option<&'a V>;

doesn't the V need to be a pointer to something with the same lifetime
as self?

Is there a way of dealing with this, or should I just implement my own
similar find function, not implementing Map, and return an Option<V>
instead?

Thanks,
David
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to