pub struct AutoPersist<T> { /* private fields */ }
Expand description
Wrapper around an Inspect node T so that after the node is accessed (and written to), the corresponding Data Persistence tag would be sent through a channel so that it can be forwarded to the Data Persistence Service.
Implementations§
Source§impl<T> AutoPersist<T>
impl<T> AutoPersist<T>
pub fn new( inspect_node: T, persistence_tag: &str, persistence_req_sender: PersistenceReqSender, ) -> Self
Sourcepub fn get_mut(&mut self) -> AutoPersistGuard<'_, T>
pub fn get_mut(&mut self) -> AutoPersistGuard<'_, T>
Return a guard that derefs to inspect_node
. When the guard is dropped,
persistence_tag
is sent via the persistence_req_sender
.
Auto Trait Implementations§
impl<T> Freeze for AutoPersist<T>where
T: Freeze,
impl<T> !RefUnwindSafe for AutoPersist<T>
impl<T> Send for AutoPersist<T>where
T: Send,
impl<T> Sync for AutoPersist<T>where
T: Sync,
impl<T> Unpin for AutoPersist<T>where
T: Unpin,
impl<T> !UnwindSafe for AutoPersist<T>
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