pub struct DynamicStorage { /* private fields */ }
Expand description
The newtype for storage with interior mutability based on
RefCell
s, only allowing for it exist on one thread.
§Note
Please refer to the make_storage
macro to create storages using a shorthand.
Implementations§
Source§impl DynamicStorage
impl DynamicStorage
Sourcepub fn allocate_for<T: 'static>(&mut self)
pub fn allocate_for<T: 'static>(&mut self)
Adds a storage unit for the given type. This will not add another unit in the case that it already exists.
Sourcepub fn has_unit<T: 'static>(&self) -> bool
pub fn has_unit<T: 'static>(&self) -> bool
Please refer to the documentation for this function at BlackBox::has_unit
.
Sourcepub fn insert<T: 'static>(&self, data: T) -> Result<(), (T, ErrorDesc)>
pub fn insert<T: 'static>(&self, data: T) -> Result<(), (T, ErrorDesc)>
Please refer to the documentation for this function at BlackBox::insert
.
Sourcepub fn insert_many<T: 'static>(
&self,
data: Vec<T>,
) -> Result<(), (Vec<T>, ErrorDesc)>
pub fn insert_many<T: 'static>( &self, data: Vec<T>, ) -> Result<(), (Vec<T>, ErrorDesc)>
Please refer to the documentation for this function at BlackBox::insert_many
.
Sourcepub fn run_for_mut<T: 'static, D: 'static + Any, F: FnMut(&mut Vec<T>) -> D>(
&self,
f: F,
) -> Result<D, ErrorDesc>
pub fn run_for_mut<T: 'static, D: 'static + Any, F: FnMut(&mut Vec<T>) -> D>( &self, f: F, ) -> Result<D, ErrorDesc>
Please refer to the documentation for this function at BlackBox::run_for_mut
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DynamicStorage
impl !RefUnwindSafe for DynamicStorage
impl !Send for DynamicStorage
impl !Sync for DynamicStorage
impl Unpin for DynamicStorage
impl !UnwindSafe for DynamicStorage
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