Struct bonsaidb_core::connection::Range
source · 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§
source§impl<T> Range<T>
impl<T> Range<T>
sourcepub fn after(self, excluded_start: T) -> Self
pub fn after(self, excluded_start: T) -> Self
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
.
sourcepub fn start_at(self, included_start: T) -> Self
pub fn start_at(self, included_start: T) -> Self
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
.
sourcepub fn before(self, excluded_end: T) -> Self
pub fn before(self, excluded_end: T) -> Self
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
.
sourcepub fn end_at(self, included_end: T) -> Self
pub fn end_at(self, included_end: T) -> Self
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
.
sourcepub fn map<U, F: Fn(T) -> U>(self, map: F) -> Range<U>
pub fn map<U, F: Fn(T) -> U>(self, map: F) -> Range<U>
Maps each contained value with the function provided.
source§impl Range<Bytes>
impl Range<Bytes>
sourcepub fn deserialize<T: for<'k> Key<'k>>(
&self
) -> Result<Range<T>, <T as KeyEncoding<T>>::Error>
pub fn deserialize<T: for<'k> Key<'k>>( &self ) -> Result<Range<T>, <T as KeyEncoding<T>>::Error>
Deserializes the range’s contained values from big-endian bytes.