pub enum Nullable<T>where
T: DataType,{
Null,
Value(T),
}Expand description
Nullable data type for the DBMS.
A nullable means that the type can either hold a value of type T or be null.
It is a wrapper around another DataType T.
Variants§
Implementations§
Trait Implementations§
Source§impl<T> CandidType for Nullable<T>where
T: CandidType + DataType,
impl<T> CandidType for Nullable<T>where
T: CandidType + DataType,
Source§impl<'de, T> Deserialize<'de> for Nullable<T>where
T: DataType,
impl<'de, T> Deserialize<'de> for Nullable<T>where
T: DataType,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Nullable<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Nullable<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T> Encode for Nullable<T>where
T: DataType,
impl<T> Encode for Nullable<T>where
T: DataType,
Source§impl<T> Ord for Nullable<T>
impl<T> Ord for Nullable<T>
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 for Nullable<T>where
T: PartialOrd + DataType,
impl<T> PartialOrd for Nullable<T>where
T: PartialOrd + DataType,
Source§impl<T> Serialize for Nullable<T>
impl<T> Serialize for Nullable<T>
Source§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 Nullable<T>
impl<T> DataType for Nullable<T>where
T: DataType,
impl<T> Eq for Nullable<T>
impl<T> StructuralPartialEq for Nullable<T>where
T: DataType,
Auto Trait Implementations§
impl<T> Freeze for Nullable<T>where
T: Freeze,
impl<T> RefUnwindSafe for Nullable<T>where
T: RefUnwindSafe,
impl<T> Send for Nullable<T>where
T: Send,
impl<T> Sync for Nullable<T>where
T: Sync,
impl<T> Unpin for Nullable<T>where
T: Unpin,
impl<T> UnwindSafe for Nullable<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