pub struct ContractRefCell<T>(/* private fields */);Expand description
A wrapped core::cell::RefCell that implements Sync so it can
be used in statics — the by-reference companion to ContractCell
for state that must be borrowed in place (e.g. the SDK’s fixed
buffers, which would cost a stack copy if moved through Cell).
Declare via contract_local!; the SDK
accesses it through a crate-private checkout trait that works
identically against the guest static and the test env’s
thread-local.
Implementations§
Source§impl<T> ContractRefCell<T>
impl<T> ContractRefCell<T>
Trait Implementations§
impl<T> Sync for ContractRefCell<T>
Auto Trait Implementations§
impl<T> !Freeze for ContractRefCell<T>
impl<T> !RefUnwindSafe for ContractRefCell<T>
impl<T> Send for ContractRefCell<T>
impl<T> Unpin for ContractRefCell<T>
impl<T> UnsafeUnpin for ContractRefCell<T>where
RefCell<T>: UnsafeUnpin,
impl<T> UnwindSafe for ContractRefCell<T>where
RefCell<T>: UnwindSafe,
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