pub enum Entity<K, T> {
Key(Key<K>),
Data(Box<T>),
None,
}Expand description
Enum for defining a simple entity that will hold a Key or the created/fetched data
Variants§
Key(Key<K>)
Key of the entity
Data(Box<T>)
Created/Fetched data for the entity
None
For when you have no data to fill or null from database
Implementations§
Trait Implementations§
Source§impl<'de, K, T> Deserialize<'de> for Entity<K, T>where
K: Deserialize<'de>,
T: Deserialize<'de>,
impl<'de, K, T> Deserialize<'de> for Entity<K, T>where
K: Deserialize<'de>,
T: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<K: Eq, T: Eq> Eq for Entity<K, T>
impl<K, T> StructuralPartialEq for Entity<K, T>
Auto Trait Implementations§
impl<K, T> Freeze for Entity<K, T>where
K: Freeze,
impl<K, T> RefUnwindSafe for Entity<K, T>where
K: RefUnwindSafe,
T: RefUnwindSafe,
impl<K, T> Send for Entity<K, T>
impl<K, T> Sync for Entity<K, T>
impl<K, T> Unpin for Entity<K, T>where
K: Unpin,
impl<K, T> UnwindSafe for Entity<K, T>where
K: UnwindSafe,
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