pub struct DaoMut<D> where
D: Serialize, { /* private fields */ }Expand description
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.
The real version represents all operations that can be performed before the obejct is actually saved and all those after
Implementations
sourceimpl<D> DaoMut<D> where
D: Serialize,
impl<D> DaoMut<D> where
D: Serialize,
pub fn trans(&self) -> Arc<DioMut>
pub fn set_trans(&mut self, dio: &Arc<DioMut>)
pub fn delete(self) -> Result<(), SerializationError>
pub fn detach(&mut self) -> Result<(), SerializationError>
pub fn attach_ext(
&mut self,
parent: PrimaryKey,
collection_id: u64
) -> Result<(), SerializationError>
pub fn attach_orphaned(
&mut self,
parent: &PrimaryKey
) -> Result<(), SerializationError>
pub fn attach_orphaned_ext(
&mut self,
parent: &PrimaryKey,
collection_id: u64
) -> Result<(), SerializationError>
pub fn add_extra_metadata(
&mut self,
meta: CoreMetadata
) -> Result<(), SerializationError>
pub fn is_locked(&self) -> bool
pub fn dio_mut(&self) -> Arc<DioMut>
pub fn attach(
&mut self,
parent: &dyn DaoObj,
vec: &DaoVec<D>
) -> Result<(), SerializationError> where
D: Serialize,
pub async fn try_lock(&mut self) -> Result<bool, LockError>
pub async fn try_lock_with_timeout(
&mut self,
timeout: Duration
) -> Result<bool, LockError>
pub async fn unlock(&mut self) -> Result<bool, LockError>
pub async fn try_lock_then_delete(&mut self) -> Result<bool, LockError>
pub fn auth_mut<'a>(&'a mut self) -> DaoAuthGuard<'a>
pub fn take(self) -> D
pub fn parent(&self) -> Option<MetaCollection>
pub fn parent_id(&self) -> Option<PrimaryKey>
pub fn as_mut<'a>(&'a mut self) -> DaoMutGuard<'a, D>
pub fn as_ref<'a>(&'a self) -> &'a D
pub fn as_immutable(&self) -> &Dao<D>
pub fn to_immutable(self) -> Dao<D>
pub fn as_mut_owned(self) -> DaoMutGuardOwned<D>
Trait Implementations
sourceimpl<D> DaoObj for DaoMut<D> where
D: Serialize,
impl<D> DaoObj for DaoMut<D> where
D: Serialize,
fn key(&self) -> &PrimaryKey
fn auth(&self) -> &MetaAuthorization
fn dio(&self) -> &Arc<Dio>
fn when_created(&self) -> u64
fn when_updated(&self) -> u64
Auto Trait Implementations
impl<D> !RefUnwindSafe for DaoMut<D>
impl<D> Send for DaoMut<D> where
D: Send,
impl<D> Sync for DaoMut<D> where
D: Sync,
impl<D> Unpin for DaoMut<D> where
D: Unpin,
impl<D> !UnwindSafe for DaoMut<D>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more