pub struct MaybeStructured<'a, T>where
T: ?Sized,{ /* private fields */ }Expand description
A wrapper around a generic type that can be used to construct for insertion.
Implementations§
Source§impl<'a, T> MaybeStructured<'a, T>
impl<'a, T> MaybeStructured<'a, T>
Source§impl<'a, T> MaybeStructured<'a, T>where
T: 'a + ?Sized,
impl<'a, T> MaybeStructured<'a, T>where
T: 'a + ?Sized,
Sourcepub const fn data(&self) -> Either<&'a T, &'a [u8]>
pub const fn data(&self) -> Either<&'a T, &'a [u8]>
Returns the value contained in the generic.
Sourcepub const unsafe fn from_slice(slice: &'a [u8]) -> MaybeStructured<'a, T>
pub const unsafe fn from_slice(slice: &'a [u8]) -> MaybeStructured<'a, T>
Trait Implementations§
Source§impl<T> BufWriter for MaybeStructured<'_, T>
impl<T> BufWriter for MaybeStructured<'_, T>
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
The length of the encoded bytes.
Source§fn write(
&self,
buf: &mut VacantBuffer<'_>,
) -> Result<usize, <MaybeStructured<'_, T> as BufWriter>::Error>
fn write( &self, buf: &mut VacantBuffer<'_>, ) -> Result<usize, <MaybeStructured<'_, T> as BufWriter>::Error>
Encode self to bytes and write to the
VacantBuffer. Read moreSource§impl<T> BufWriterOnce for MaybeStructured<'_, T>
impl<T> BufWriterOnce for MaybeStructured<'_, T>
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
The length of the encoded bytes.
Source§fn write_once(
self,
buf: &mut VacantBuffer<'_>,
) -> Result<usize, <MaybeStructured<'_, T> as BufWriterOnce>::Error>
fn write_once( self, buf: &mut VacantBuffer<'_>, ) -> Result<usize, <MaybeStructured<'_, T> as BufWriterOnce>::Error>
Encode self to bytes and write to the
VacantBuffer. Read moreSource§impl<'a, T> Debug for MaybeStructured<'a, T>
impl<'a, T> Debug for MaybeStructured<'a, T>
Source§impl<'a, T> From<&'a T> for MaybeStructured<'a, T>where
T: 'a + ?Sized,
impl<'a, T> From<&'a T> for MaybeStructured<'a, T>where
T: 'a + ?Sized,
Source§fn from(value: &'a T) -> MaybeStructured<'a, T>
fn from(value: &'a T) -> MaybeStructured<'a, T>
Converts to this type from the input type.
Source§impl<'a, T> Ord for MaybeStructured<'a, T>where
T: 'a + Ord + Type + for<'b> Comparable<<T as Type>::Ref<'b>> + ?Sized,
<T as Type>::Ref<'b>: for<'b> Comparable<T> + for<'b> Ord,
impl<'a, T> Ord for MaybeStructured<'a, T>where
T: 'a + Ord + Type + for<'b> Comparable<<T as Type>::Ref<'b>> + ?Sized,
<T as Type>::Ref<'b>: for<'b> Comparable<T> + for<'b> Ord,
Source§fn cmp(&self, other: &MaybeStructured<'a, T>) -> Ordering
fn cmp(&self, other: &MaybeStructured<'a, T>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'a, T> PartialEq<T> for MaybeStructured<'a, T>
impl<'a, T> PartialEq<T> for MaybeStructured<'a, T>
Source§impl<'a, T> PartialEq for MaybeStructured<'a, T>
impl<'a, T> PartialEq for MaybeStructured<'a, T>
Source§impl<'a, T> PartialOrd<T> for MaybeStructured<'a, T>
impl<'a, T> PartialOrd<T> for MaybeStructured<'a, T>
Source§impl<'a, T> PartialOrd for MaybeStructured<'a, T>where
T: 'a + Ord + Type + for<'b> Comparable<<T as Type>::Ref<'b>> + ?Sized,
<T as Type>::Ref<'b>: for<'b> Comparable<T> + for<'b> Ord,
impl<'a, T> PartialOrd for MaybeStructured<'a, T>where
T: 'a + Ord + Type + for<'b> Comparable<<T as Type>::Ref<'b>> + ?Sized,
<T as Type>::Ref<'b>: for<'b> Comparable<T> + for<'b> Ord,
impl<'a, T> Eq for MaybeStructured<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for MaybeStructured<'a, T>where
T: ?Sized,
impl<'a, T> RefUnwindSafe for MaybeStructured<'a, T>where
T: RefUnwindSafe + ?Sized,
impl<'a, T> Send for MaybeStructured<'a, T>
impl<'a, T> Sync for MaybeStructured<'a, T>
impl<'a, T> Unpin for MaybeStructured<'a, T>where
T: ?Sized,
impl<'a, T> UnwindSafe for MaybeStructured<'a, T>where
T: RefUnwindSafe + ?Sized,
Blanket Implementations§
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoAmong for T
impl<T> IntoAmong for T
Source§fn into_among_with<F>(self, into_left: F) -> Among<Self, Self, Self>
fn into_among_with<F>(self, into_left: F) -> Among<Self, Self, Self>
Converts
self into a Left variant of Among<Self, Self>
if into_left(&self) returns Some(true). Read moreSource§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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