pub struct SharedSlot { /* private fields */ }Expand description
One value stored in a SharedAtom. Each reset!/swap! stores a new
slot; the slot owns the governor charge for its Arc allocation and any
string it owns. Byte-blob payloads are charged by the blob.
Implementations§
Sourcepub fn new(value: SharedValue) -> Self
pub fn new(value: SharedValue) -> Self
Wrap value and charge its storage to the governor. Infallible: a
strict-mode refusal raises the thread’s runtime fault (see
Self::try_new).
Sourcepub fn try_new(value: SharedValue) -> Result<Self, MemoryLimitExceeded>
pub fn try_new(value: SharedValue) -> Result<Self, MemoryLimitExceeded>
Wrap value if the governor admits its storage charge.
Sourcepub fn value(&self) -> &SharedValue
pub fn value(&self) -> &SharedValue
The stored value.
Sourcepub fn charged_bytes(&self) -> usize
pub fn charged_bytes(&self) -> usize
Bytes charged to the governor for this slot.
Methods from Deref<Target = SharedValue>§
Trait Implementations§
Source§fn as_ref(&self) -> &SharedValue
fn as_ref(&self) -> &SharedValue
Converts this type into a shared reference of the (usually inferred) input type.
Source§type Target = SharedValue
type Target = SharedValue
The resulting type after dereferencing.
Source§fn deref(&self) -> &SharedValue
fn deref(&self) -> &SharedValue
Dereferences the value.
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