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: PartialOrd + Emptiable> PartialOrd for MaybeEmpty<T>
impl<T: PartialOrd + Emptiable> PartialOrd for MaybeEmpty<T>
impl<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