Closed solarretrace closed 4 years ago
See https://github.com/billyrieger/bimap-rs/issues/16#issuecomment-657137595. This would be nice to have but it leaks implementation details.
You're probably right about Rc in the signature here, but I think these methods would still be usable with a more restricted signature:
pub fn left_range<'a, A>(&'a self, range: A) -> LeftRange<'a, L, R>
where A: std::ops::RangeBounds<L>;
pub fn right_range<'a, A>(&'a self, range: A) -> RightRange<'a, L, R>
where A: std::ops::RangeBounds<R>;
Yes, that looks like it should work. If you're up for making a PR I'd be happy to review it!
Closed by #18.
The std BTreeMap supports iteration over a subset of the map using a range (
BTreeMap::range
,BTreeMap::range_mut
). If I understand correctly, the BiBTreeMap could support the same operation (in both directions) but not the_mut
version.I'm happy to submit a PR if these methods are desirable and I find some time to add them. I have implementations prepared with the following signatures: