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) -> 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
.
sourcepub 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
.
sourcepub 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
.
sourcepub 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
.
sourcepub 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.
sourcepub fn map_result<U, E, F>(self, map: F) -> Result<Range<U>, E>
pub fn map_result<U, E, F>(self, map: F) -> Result<Range<U>, E>
Maps each contained value with the function provided. The callback’s
return type is a Result, unlike with map
.
Trait Implementations§
source§impl<'de, T> Deserialize<'de> for Range<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Range<T>where
T: Deserialize<'de>,
source§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>,
source§impl<T> From<RangeInclusive<T>> for Range<T>where
T: Clone,
impl<T> From<RangeInclusive<T>> for Range<T>where
T: Clone,
source§fn from(range: RangeInclusive<T>) -> Range<T>
fn from(range: RangeInclusive<T>) -> Range<T>
source§impl<T> From<RangeToInclusive<T>> for Range<T>
impl<T> From<RangeToInclusive<T>> for Range<T>
source§fn from(range: RangeToInclusive<T>) -> Range<T>
fn from(range: RangeToInclusive<T>) -> Range<T>
source§impl<T> PartialEq for Range<T>where
T: PartialEq,
impl<T> PartialEq for Range<T>where
T: PartialEq,
source§impl<T> RangeBounds<T> for Range<T>
impl<T> RangeBounds<T> for Range<T>
source§impl<T> Serialize for Range<T>where
T: Serialize,
impl<T> Serialize for Range<T>where
T: Serialize,
source§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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.