[−][src]Struct restor::DynamicStorage
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.
Methods
impl DynamicStorage
[src]
impl DynamicStorage
[src]
pub fn allocate_for<T: 'static>(&mut self)
[src]
Adds a storage unit for the given type. This will not add another unit in the case that it already exists.
pub fn has_unit<T: 'static>(&self) -> bool
[src]
Please refer to the documentation for this function at BlackBox::has_unit
.
pub fn insert<T: 'static>(&self, data: T) -> Result<(), (T, ErrorDesc)>
[src]
Please refer to the documentation for this function at BlackBox::insert
.
pub fn insert_many<T: 'static>(
&self,
data: Vec<T>
) -> Result<(), (Vec<T>, ErrorDesc)>
[src]
&self,
data: Vec<T>
) -> Result<(), (Vec<T>, ErrorDesc)>
Please refer to the documentation for this function at BlackBox::insert_many
.
pub fn run_for_mut<'a, T: 'static, D: 'static + Any, F: FnMut(&mut Vec<T>) -> D>(
&self,
f: F
) -> Result<D, ErrorDesc>
[src]
&self,
f: F
) -> Result<D, ErrorDesc>
Please refer to the documentation for this function at BlackBox::run_for_mut
.
pub fn get<'a, T: FetchMultiple<'a, dyn Unit<'u, Borrowed = Ref<'u, dyn Any>, MutBorrowed = RefMut<'u, dyn Any>>>>(
&'a self
) -> Result<T::Output, ErrorDesc> where
<T as FetchMultiple<'a, dyn Unit<'u, Borrowed = Ref<'u, dyn Any>, MutBorrowed = RefMut<'u, dyn Any>>>>::Actual: 'static,
[src]
&'a self
) -> Result<T::Output, ErrorDesc> where
<T as FetchMultiple<'a, dyn Unit<'u, Borrowed = Ref<'u, dyn Any>, MutBorrowed = RefMut<'u, dyn Any>>>>::Actual: 'static,
Please refer to the documentation for this function at BlackBox::get
.
impl DynamicStorage
[src]
pub fn run_for<'a, T: 'static, D: 'static + Any, F: FnMut(&[T]) -> D>(
&self,
f: F
) -> Result<D, ErrorDesc>
[src]
&self,
f: F
) -> Result<D, ErrorDesc>
Auto Trait Implementations
impl !Send for DynamicStorage
impl !Sync for DynamicStorage
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,