Enum scylla_cql::types::deserialize::value::MaybeEmpty
source · pub enum MaybeEmpty<T: Emptiable> {
Empty,
Value(T),
}
Expand description
A value that may be empty or not.
MaybeEmpty
was introduced to help support the quirk described in Emptiable
for Rust types which can’t represent the empty, additional value.
Variants§
Trait Implementations§
source§impl<T: Clone + Emptiable> Clone for MaybeEmpty<T>
impl<T: Clone + Emptiable> Clone for MaybeEmpty<T>
source§fn clone(&self) -> MaybeEmpty<T>
fn clone(&self) -> MaybeEmpty<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'frame, 'metadata, T> DeserializeValue<'frame, 'metadata> for MaybeEmpty<T>where
T: DeserializeValue<'frame, 'metadata> + Emptiable,
impl<'frame, 'metadata, T> DeserializeValue<'frame, 'metadata> for MaybeEmpty<T>where
T: DeserializeValue<'frame, 'metadata> + Emptiable,
source§fn type_check(typ: &ColumnType<'_>) -> Result<(), TypeCheckError>
fn type_check(typ: &ColumnType<'_>) -> Result<(), TypeCheckError>
Checks that the column type matches what this type expects.
source§fn deserialize(
typ: &'metadata ColumnType<'metadata>,
v: Option<FrameSlice<'frame>>,
) -> Result<Self, DeserializationError>
fn deserialize( typ: &'metadata ColumnType<'metadata>, v: Option<FrameSlice<'frame>>, ) -> Result<Self, DeserializationError>
Deserialize a column value from given serialized representation. Read more
source§impl<T: Ord + Emptiable> Ord for MaybeEmpty<T>
impl<T: Ord + Emptiable> Ord for MaybeEmpty<T>
source§fn cmp(&self, other: &MaybeEmpty<T>) -> Ordering
fn cmp(&self, other: &MaybeEmpty<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<T: PartialEq + Emptiable> PartialEq for MaybeEmpty<T>
impl<T: PartialEq + Emptiable> PartialEq for MaybeEmpty<T>
source§fn eq(&self, other: &MaybeEmpty<T>) -> bool
fn eq(&self, other: &MaybeEmpty<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<T: PartialOrd + Emptiable> PartialOrd for MaybeEmpty<T>
impl<T: PartialOrd + Emptiable> PartialOrd for MaybeEmpty<T>
source§fn partial_cmp(&self, other: &MaybeEmpty<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &MaybeEmpty<T>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<T: Copy + Emptiable> Copy for MaybeEmpty<T>
impl<T: Eq + Emptiable> Eq for MaybeEmpty<T>
impl<T: Emptiable> StructuralPartialEq for MaybeEmpty<T>
Auto Trait Implementations§
impl<T> Freeze for MaybeEmpty<T>where
T: Freeze,
impl<T> RefUnwindSafe for MaybeEmpty<T>where
T: RefUnwindSafe,
impl<T> Send for MaybeEmpty<T>where
T: Send,
impl<T> Sync for MaybeEmpty<T>where
T: Sync,
impl<T> Unpin for MaybeEmpty<T>where
T: Unpin,
impl<T> UnwindSafe for MaybeEmpty<T>where
T: UnwindSafe,
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<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)