Enum bonsaidb::core::connection::Bound
pub enum Bound<T> {
Unbounded,
Included(T),
Excluded(T),
}
Expand description
A range bound that can be serialized.
Variants§
Unbounded
No bound.
Included(T)
Bounded by the contained value (inclusive).
Excluded(T)
Bounded by the contained value (exclusive).
Implementations§
§impl<T> Bound<T>
impl<T> Bound<T>
pub fn map<U, F>(self, map: F) -> Bound<U>where
F: Fn(T) -> U,
pub fn map<U, F>(self, map: F) -> Bound<U>where F: Fn(T) -> U,
Maps the contained value, if any, and returns the resulting Bound
.
pub fn map_result<U, E, F>(self, map: F) -> Result<Bound<U>, E>where
F: Fn(T) -> Result<U, E>,
pub fn map_result<U, E, F>(self, map: F) -> Result<Bound<U>, E>where F: Fn(T) -> Result<U, E>,
Maps the contained value with the function provided. The callback’s
return type is a Result, unlike with map
.
§impl Bound<Bytes>
impl Bound<Bytes>
pub fn deserialize<T>(&self) -> Result<Bound<T>, <T as KeyEncoding<T>>::Error>where
T: for<'k> Key<'k>,
pub fn deserialize<T>(&self) -> Result<Bound<T>, <T as KeyEncoding<T>>::Error>where T: for<'k> Key<'k>,
Deserializes the bound’s contained value from big-endian bytes.
Trait Implementations§
§impl<'de, T> Deserialize<'de> for Bound<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Bound<T>where T: Deserialize<'de>,
§fn deserialize<__D>(
__deserializer: __D
) -> Result<Bound<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<Bound<T>, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl<T> Serialize for Bound<T>where
T: Serialize,
impl<T> Serialize for Bound<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,
Serialize this value into the given Serde serializer. Read more
impl<T> Copy for Bound<T>where T: Copy,
impl<T> Eq for Bound<T>where T: Eq,
impl<T> StructuralEq for Bound<T>
impl<T> StructuralPartialEq for Bound<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for Bound<T>where T: RefUnwindSafe,
impl<T> Send for Bound<T>where T: Send,
impl<T> Sync for Bound<T>where T: Sync,
impl<T> Unpin for Bound<T>where T: Unpin,
impl<T> UnwindSafe for Bound<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
Mutably borrows from an owned value. Read more
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
Compare self to
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
Checks if this value is equivalent to the given key. Read more
§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
Compare self to
key
and return true
if they are equal.