Struct ate::dio::Dao[][src]

pub struct Dao<D> where
    Self: Send + Sync,
    D: Serialize + DeserializeOwned + Clone + Sync + Send
{ /* fields omitted */ }

Represents a data object that will be represented as one or more events on the redo-log and validated in the chain-of-trust.

Reading this object using none-mutable behavior will incur no IO on the redo-log however if you edit the object you must commit it to the Dio before it goes out of scope or the data will be lost (in Debug mode this will even trigger an assert).

Metadata about the data object can also be accessed via this object which allows you to change the read/write access rights, etc.

If you change your mind on commiting the data to the redo-log then you can call the cancel function instead.

Implementations

impl<D> Dao<D> where
    Self: Send + Sync,
    D: Serialize + DeserializeOwned + Clone + Send + Sync
[src]

pub fn make(key: PrimaryKey, format: MessageFormat, data: D) -> Dao<D>[src]

pub fn detach(&mut self)[src]

pub fn attach(&mut self, parent: &dyn DaoObj, vec: DaoVec<D>)[src]

pub fn take(self) -> D[src]

pub async fn try_lock<'a>(
    &mut self,
    dio: &mut Dio<'a>
) -> Result<bool, LockError>
[src]

pub async fn try_lock_then_delete<'a>(
    &mut self,
    dio: &mut Dio<'a>
) -> Result<bool, LockError>
[src]

pub async fn unlock<'a>(&mut self, dio: &mut Dio<'a>) -> Result<bool, LockError>[src]

impl<D> Dao<D> where
    D: Serialize + DeserializeOwned + Clone + Send + Sync
[src]

pub async fn iter<'a, C>(
    &self,
    dio: &mut Dio<'a>,
    vec: DaoVec<C>
) -> Result<Iter<C>, LoadError> where
    C: Serialize + DeserializeOwned + Clone + Send + Sync
[src]

pub fn push<C>(
    &mut self,
    dio: &mut Dio<'_>,
    vec: DaoVec<C>,
    data: C
) -> Result<Dao<C>, SerializationError> where
    C: Serialize + DeserializeOwned + Clone + Send + Sync
[src]

impl<D> Dao<D> where
    D: Serialize + DeserializeOwned + Clone + Send + Sync
[src]

pub fn bus<'a, C>(&self, chain: &'a Chain, vec: DaoVec<C>) -> Bus<'a, C> where
    C: Serialize + DeserializeOwned + Clone + Send + Sync
[src]

Trait Implementations

impl<D> DaoObj for Dao<D> where
    Self: Send + Sync,
    D: Serialize + DeserializeOwned + Clone + Send + Sync
[src]

impl<D: Debug> Debug for Dao<D> where
    Self: Send + Sync,
    D: Serialize + DeserializeOwned + Clone + Sync + Send
[src]

impl<D> Deref for Dao<D> where
    D: Serialize + DeserializeOwned + Clone + Send + Sync
[src]

type Target = D

The resulting type after dereferencing.

impl<D> DerefMut for Dao<D> where
    D: Serialize + DeserializeOwned + Clone + Send + Sync
[src]

Auto Trait Implementations

impl<D> RefUnwindSafe for Dao<D> where
    D: RefUnwindSafe

impl<D> Send for Dao<D>

impl<D> Sync for Dao<D>

impl<D> Unpin for Dao<D> where
    D: Unpin

impl<D> UnwindSafe for Dao<D> where
    D: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,