pub struct Transaction { /* private fields */ }Expand description
Phase D: Transaction with ownership tracking
Implementations§
Source§impl Transaction
impl Transaction
pub fn new(id: u64) -> Self
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if transaction has timed out
Sourcepub fn add_owned<T: Send + Sync + 'static>(&mut self, owned: OwnedCapCid<T>)
pub fn add_owned<T: Send + Sync + 'static>(&mut self, owned: OwnedCapCid<T>)
Add owned resource to transaction
Sourcepub fn add_borrowed(&mut self, borrowed: Arc<RwLock<CapCid>>)
pub fn add_borrowed(&mut self, borrowed: Arc<RwLock<CapCid>>)
Add borrowed resource to transaction
Sourcepub async fn check_write_perm(
&self,
target_cid: &Cid,
) -> Result<(), ConcurError>
pub async fn check_write_perm( &self, target_cid: &Cid, ) -> Result<(), ConcurError>
Check if transaction has write permission for resource
Auto Trait Implementations§
impl !RefUnwindSafe for Transaction
impl !UnwindSafe for Transaction
impl Freeze for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin for Transaction
impl UnsafeUnpin for Transaction
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