Struct ate::prelude::DaoRef [−][src]
Rerepresents a reference to another data object with strong type linting to make the model more solidified
Implementations
impl<D> DaoRef<D> where
D: Serialize + DeserializeOwned + Clone + Send + Sync,
[src]
D: Serialize + DeserializeOwned + Clone + Send + Sync,
pub fn new() -> DaoRef<D>
[src]
pub fn get_id(&self) -> Option<PrimaryKey>
[src]
pub fn set_id(&mut self, val: PrimaryKey)
[src]
pub fn clear(&mut self)
[src]
pub async fn load<'a>(
&self,
dio: &mut Dio<'a>
) -> Result<Option<Dao<D>>, LoadError> where
D: Serialize + DeserializeOwned + Clone + Send + Sync,
[src]
&self,
dio: &mut Dio<'a>
) -> Result<Option<Dao<D>>, LoadError> where
D: Serialize + DeserializeOwned + Clone + Send + Sync,
Loads the data object (if it exists)
pub async fn store<'a>(
&mut self,
dio: &mut Dio<'a>,
value: D
) -> Result<Dao<D>, LoadError>
[src]
&mut self,
dio: &mut Dio<'a>,
value: D
) -> Result<Dao<D>, LoadError>
Stores the data within this reference
pub async fn unwrap_or<'a>(
&mut self,
dio: &mut Dio<'a>,
default: D
) -> Result<Dao<D>, LoadError> where
D: Serialize + DeserializeOwned + Clone + Send + Sync,
[src]
&mut self,
dio: &mut Dio<'a>,
default: D
) -> Result<Dao<D>, LoadError> where
D: Serialize + DeserializeOwned + Clone + Send + Sync,
Loads the data object or uses a default if none exists
pub async fn unwrap_or_else<'a, F: FnOnce() -> D>(
&mut self,
dio: &mut Dio<'a>,
f: F
) -> Result<Dao<D>, LoadError> where
D: Serialize + DeserializeOwned + Clone + Send + Sync,
[src]
&mut self,
dio: &mut Dio<'a>,
f: F
) -> Result<Dao<D>, LoadError> where
D: Serialize + DeserializeOwned + Clone + Send + Sync,
Loads the data object or uses a default if none exists
pub async fn unwrap_or_default<'a>(
&mut self,
dio: &mut Dio<'a>
) -> Result<Dao<D>, LoadError> where
D: Default + Serialize + DeserializeOwned + Clone + Send + Sync,
[src]
&mut self,
dio: &mut Dio<'a>
) -> Result<Dao<D>, LoadError> where
D: Default + Serialize + DeserializeOwned + Clone + Send + Sync,
Loads the data object or creates a new one (if it does not exist)
pub async fn expect<'a>(&mut self, dio: &mut Dio<'a>, msg: &str) -> Dao<D> where
D: Serialize + DeserializeOwned + Clone + Send + Sync,
[src]
D: Serialize + DeserializeOwned + Clone + Send + Sync,
pub async fn unwrap<'a>(&mut self, dio: &mut Dio<'a>) -> Dao<D>
[src]
pub async fn take<'a>(
&mut self,
dio: &mut Dio<'a>
) -> Result<Option<Dao<D>>, LoadError>
[src]
&mut self,
dio: &mut Dio<'a>
) -> Result<Option<Dao<D>>, LoadError>
pub async fn replace<'a>(
&mut self,
dio: &mut Dio<'a>,
value: D
) -> Result<Option<Dao<D>>, LoadError>
[src]
&mut self,
dio: &mut Dio<'a>,
value: D
) -> Result<Option<Dao<D>>, LoadError>
pub fn is_some(&self) -> bool
[src]
pub fn is_none(&self) -> bool
[src]
Trait Implementations
impl<D: Clone> Clone for DaoRef<D> where
D: Serialize + DeserializeOwned + Clone + Send + Sync,
[src]
D: Serialize + DeserializeOwned + Clone + Send + Sync,
impl<D: Debug> Debug for DaoRef<D> where
D: Serialize + DeserializeOwned + Clone + Send + Sync,
[src]
D: Serialize + DeserializeOwned + Clone + Send + Sync,
impl<D> Default for DaoRef<D> where
D: Serialize + DeserializeOwned + Clone + Send + Sync,
[src]
D: Serialize + DeserializeOwned + Clone + Send + Sync,
impl<'de, D> Deserialize<'de> for DaoRef<D> where
D: Serialize + DeserializeOwned + Clone + Send + Sync,
[src]
D: Serialize + DeserializeOwned + Clone + Send + Sync,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<D> From<PrimaryKey> for DaoRef<D> where
D: Serialize + DeserializeOwned + Clone + Send + Sync,
[src]
D: Serialize + DeserializeOwned + Clone + Send + Sync,
fn from(key: PrimaryKey) -> DaoRef<D>
[src]
impl<D> Serialize for DaoRef<D> where
D: Serialize + DeserializeOwned + Clone + Send + Sync,
[src]
D: Serialize + DeserializeOwned + Clone + Send + Sync,
Auto Trait Implementations
impl<D> RefUnwindSafe for DaoRef<D> where
D: RefUnwindSafe,
D: RefUnwindSafe,
impl<D> Send for DaoRef<D>
impl<D> Sync for DaoRef<D>
impl<D> Unpin for DaoRef<D> where
D: Unpin,
D: Unpin,
impl<D> UnwindSafe for DaoRef<D> where
D: UnwindSafe,
D: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,