BoundRef

Enum BoundRef 

Source
pub enum BoundRef<'a, TOwned, TBorrowed = TOwned>
where TBorrowed: PartialEq + ?Sized, TOwned: Borrow<TBorrowed> + PartialEq<TBorrowed>, MaybeOwned<'a, TOwned, TBorrowed>: PartialEq,
{ Unbounded, Included(MaybeOwned<'a, TOwned, TBorrowed>), Excluded(MaybeOwned<'a, TOwned, TBorrowed>), }
Expand description

A range bound reference.

Variants§

§

Unbounded

No bound.

§

Included(MaybeOwned<'a, TOwned, TBorrowed>)

Bounded by the contained value (inclusive).

§

Excluded(MaybeOwned<'a, TOwned, TBorrowed>)

Bounded by the contained value (exclusive).

Implementations§

Source§

impl<'a, TOwned, TBorrowed> BoundRef<'a, TOwned, TBorrowed>
where TBorrowed: PartialEq + ?Sized, TOwned: Borrow<TBorrowed> + PartialEq<TBorrowed>,

Source

pub fn as_ord_bytes(&'a self) -> Result<Bound<Bytes>, TBorrowed::Error>
where TBorrowed: KeyEncoding<TOwned>, TOwned: for<'k> Key<'k> + Borrow<TBorrowed>,

Serializes the contained value to big-endian bytes.

Source§

impl<'a, TOwned, TBorrowed> BoundRef<'a, TOwned, TBorrowed>
where TBorrowed: PartialEq + ?Sized, TOwned: Borrow<TBorrowed> + PartialEq<TBorrowed>,

Source

pub const fn borrowed(range: Bound<&'a TBorrowed>) -> Self

Returns a borrowed bound from the bound provided.

Source

pub fn owned(range: Bound<TOwned>) -> Self

Returns an owned bound ref from the bound provided.

Source

pub fn map_result<U, E, F: Fn(&TBorrowed) -> Result<U, E>>( self, map: F, ) -> Result<Bound<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<'a, TOwned, TBorrowed> Clone for BoundRef<'a, TOwned, TBorrowed>
where TBorrowed: PartialEq + ?Sized + Clone, TOwned: Borrow<TBorrowed> + PartialEq<TBorrowed> + Clone, MaybeOwned<'a, TOwned, TBorrowed>: PartialEq,

Source§

fn clone(&self) -> BoundRef<'a, TOwned, TBorrowed>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, TOwned, TBorrowed> Debug for BoundRef<'a, TOwned, TBorrowed>
where TBorrowed: PartialEq + ?Sized + Debug, TOwned: Borrow<TBorrowed> + PartialEq<TBorrowed> + Debug, MaybeOwned<'a, TOwned, TBorrowed>: PartialEq,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, TOwned, TBorrowed> From<&'a BoundRef<'a, TOwned, TBorrowed>> for Bound<&'a TBorrowed>
where TBorrowed: PartialEq + ?Sized, TOwned: Borrow<TBorrowed> + PartialEq<TBorrowed>,

Source§

fn from(bound: &'a BoundRef<'a, TOwned, TBorrowed>) -> Self

Converts to this type from the input type.
Source§

impl<'a, TOwned, TBorrowed> PartialEq for BoundRef<'a, TOwned, TBorrowed>
where TBorrowed: PartialEq + ?Sized + PartialEq, TOwned: Borrow<TBorrowed> + PartialEq<TBorrowed> + PartialEq, MaybeOwned<'a, TOwned, TBorrowed>: PartialEq,

Source§

fn eq(&self, other: &BoundRef<'a, TOwned, TBorrowed>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, TOwned, TBorrowed> StructuralPartialEq for BoundRef<'a, TOwned, TBorrowed>
where TBorrowed: PartialEq + ?Sized, TOwned: Borrow<TBorrowed> + PartialEq<TBorrowed>, MaybeOwned<'a, TOwned, TBorrowed>: PartialEq,

Auto Trait Implementations§

§

impl<'a, TOwned, TBorrowed> Freeze for BoundRef<'a, TOwned, TBorrowed>
where TOwned: Freeze, TBorrowed: ?Sized,

§

impl<'a, TOwned, TBorrowed> RefUnwindSafe for BoundRef<'a, TOwned, TBorrowed>
where TOwned: RefUnwindSafe, TBorrowed: RefUnwindSafe + ?Sized,

§

impl<'a, TOwned, TBorrowed> Send for BoundRef<'a, TOwned, TBorrowed>
where TOwned: Send, TBorrowed: Sync + ?Sized,

§

impl<'a, TOwned, TBorrowed> Sync for BoundRef<'a, TOwned, TBorrowed>
where TOwned: Sync, TBorrowed: Sync + ?Sized,

§

impl<'a, TOwned, TBorrowed> Unpin for BoundRef<'a, TOwned, TBorrowed>
where TOwned: Unpin, TBorrowed: ?Sized,

§

impl<'a, TOwned, TBorrowed> UnwindSafe for BoundRef<'a, TOwned, TBorrowed>
where TOwned: UnwindSafe, TBorrowed: RefUnwindSafe + ?Sized,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.