struct Shared<T> {
value: RwLock<T>,
state: AtomicState,
ref_count_rx: AtomicUsize,
ref_count_tx: AtomicUsize,
notify_rx: BigNotify,
notify_tx: Notify,
}
Fields§
§value: RwLock<T>
The most recent value.
state: AtomicState
The current version.
The lowest bit represents a “closed” state. The rest of the bits represent the current version.
ref_count_rx: AtomicUsize
Tracks the number of Receiver
instances.
ref_count_tx: AtomicUsize
Tracks the number of Sender
instances.
notify_rx: BigNotify
Notifies waiting receivers that the value changed.
notify_tx: Notify
Notifies any task listening for Receiver
dropped events.
Trait Implementations§
Auto Trait Implementations§
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