Struct Transactions
pub(super) struct Transactions {
next_txn_id: NonZeroU16,
pending: HashMap<NonZeroU16, Pending>,
}Expand description
The pending requests by transaction ID.
Abandoned requests keep their ID until their response arrives or until
RESERVED_TIMEOUTS timeouts have passed, so a late response can’t
complete a new request. They stay until their ID is needed again or the
map would grow.
Fields§
§next_txn_id: NonZeroU16§pending: HashMap<NonZeroU16, Pending>Implementations§
§impl Transactions
impl Transactions
pub(super) fn new() -> Self
pub(super) fn next_txn_id(&mut self, now: Instant) -> Option<NonZeroU16>
pub(super) fn next_txn_id(&mut self, now: Instant) -> Option<NonZeroU16>
Returns the next transaction ID that no request uses or reserves at
now.
pub(super) fn insert( &mut self, txn_id: NonZeroU16, pending: Pending, now: Instant, )
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Transactions
impl !UnwindSafe for Transactions
impl Freeze for Transactions
impl Send for Transactions
impl Sync for Transactions
impl Unpin for Transactions
impl UnsafeUnpin for Transactions
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