Struct bonsaidb::core::connection::Range
pub struct Range<T> {
pub start: Bound<T>,
pub end: Bound<T>,
}
Expand description
A range type that can represent all std
range types and be serialized.
This type implements conversion operations from all range types defined in
std
.
Fields§
§start: Bound<T>
The start of the range.
end: Bound<T>
The end of the range.
Implementations§
§impl<T> Range<T>
impl<T> Range<T>
pub fn after(self, excluded_start: T) -> Range<T>
pub fn after(self, excluded_start: T) -> Range<T>
Sets the start bound of this range to Bound::Excluded
with
excluded_start
. The range will represent values that are
Ordering::Greater
than, but not
including, excluded_start
.
pub fn start_at(self, included_start: T) -> Range<T>
pub fn start_at(self, included_start: T) -> Range<T>
Sets the start bound of this range to Bound::Included
with
included_start
. The range will represent values that are
Ordering::Greater
than or
Ordering::Equal
to included_start
.
pub fn before(self, excluded_end: T) -> Range<T>
pub fn before(self, excluded_end: T) -> Range<T>
Sets the end bound of this range to Bound::Excluded
with
excluded_end
. The range will represent values that are
Ordering::Less
than, but not including,
excluded_end
.
pub fn end_at(self, included_end: T) -> Range<T>
pub fn end_at(self, included_end: T) -> Range<T>
Sets the end bound of this range to Bound::Included
with
included_end
. The range will represent values that are
Ordering:::Less
than or
Ordering::Equal
to included_end
.
pub fn map<U, F>(self, map: F) -> Range<U>where
F: Fn(T) -> U,
pub fn map<U, F>(self, map: F) -> Range<U>where F: Fn(T) -> U,
Maps each contained value with the function provided.
pub fn map_result<U, E, F>(self, map: F) -> Result<Range<U>, E>where
F: Fn(T) -> Result<U, E>,
pub fn map_result<U, E, F>(self, map: F) -> Result<Range<U>, E>where F: Fn(T) -> Result<U, E>,
Maps each contained value with the function provided. The callback’s
return type is a Result, unlike with map
.
§impl Range<Bytes>
impl Range<Bytes>
pub fn deserialize<T>(&self) -> Result<Range<T>, <T as KeyEncoding<T>>::Error>where
T: for<'k> Key<'k>,
pub fn deserialize<T>(&self) -> Result<Range<T>, <T as KeyEncoding<T>>::Error>where T: for<'k> Key<'k>,
Deserializes the range’s contained values from big-endian bytes.
Trait Implementations§
§impl<'de, T> Deserialize<'de> for Range<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Range<T>where T: Deserialize<'de>,
§fn deserialize<__D>(
__deserializer: __D
) -> Result<Range<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<Range<T>, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
§impl<T> From<RangeInclusive<T>> for Range<T>where
T: Clone,
impl<T> From<RangeInclusive<T>> for Range<T>where T: Clone,
§fn from(range: RangeInclusive<T>) -> Range<T>
fn from(range: RangeInclusive<T>) -> Range<T>
§impl<T> From<RangeToInclusive<T>> for Range<T>
impl<T> From<RangeToInclusive<T>> for Range<T>
§fn from(range: RangeToInclusive<T>) -> Range<T>
fn from(range: RangeToInclusive<T>) -> Range<T>
§impl<T> RangeBounds<T> for Range<T>
impl<T> RangeBounds<T> for Range<T>
§impl<T> Serialize for Range<T>where
T: Serialize,
impl<T> Serialize for Range<T>where T: Serialize,
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
impl<T> Copy for Range<T>where T: Copy,
impl<T> Eq for Range<T>where T: Eq,
impl<T> StructuralEq for Range<T>
impl<T> StructuralPartialEq for Range<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for Range<T>where T: RefUnwindSafe,
impl<T> Send for Range<T>where T: Send,
impl<T> Sync for Range<T>where T: Sync,
impl<T> Unpin for Range<T>where T: Unpin,
impl<T> UnwindSafe for Range<T>where T: UnwindSafe,
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.