[][src]Struct restor::DynamicStorage

#[repr(transparent)]
pub struct DynamicStorage { /* fields omitted */ }

The newtype for storage with interior mutability based on RefCells, 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]

pub fn new() -> Self[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]

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]

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]

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]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]