Struct TransactionSeal
pub struct TransactionSeal { /* private fields */ }Expand description
What ends a transaction:
transaction_open gives it to whoever opened
the transaction (host.transaction’s guard), and
transaction_close takes it. A
write handler lent only the Transaction cannot end the transaction around it, the game’s
own (a hopper’s move) or another mod’s.
It carries the transaction’s write token and a second token, as unguessable, that only closing checks.
ⓘ
use mod_api::{HostTransaction, ServerHost};
fn handler(host: &mut dyn ServerHost) {
let _: Result<(), ()> = host.transaction(|host, tx| {
host.transaction_close(tx, true);
Ok(())
});
}Implementations§
§impl TransactionSeal
impl TransactionSeal
pub fn transaction(&self) -> &Transaction
pub fn transaction(&self) -> &Transaction
The transaction this seal ends, to write in it.
Trait Implementations§
§impl Debug for TransactionSeal
impl Debug for TransactionSeal
impl Eq for TransactionSeal
§impl PartialEq for TransactionSeal
impl PartialEq for TransactionSeal
impl StructuralPartialEq for TransactionSeal
Auto Trait Implementations§
impl Freeze for TransactionSeal
impl RefUnwindSafe for TransactionSeal
impl Send for TransactionSeal
impl Sync for TransactionSeal
impl Unpin for TransactionSeal
impl UnsafeUnpin for TransactionSeal
impl UnwindSafe for TransactionSeal
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