[][src]Trait restor::Fetch

pub trait Fetch<'a, U: Unit<'a> + ?Sized> {
    type Output: 'a;
    type Actual;
    fn get(boxed: &'a BlackBox<U>) -> Result<Self::Output, ErrorDesc>;
fn waiting_get(boxed: &'a BlackBox<U>) -> Result<Self::Output, ErrorDesc>
    where
        <U as Unit<'a>>::Borrowed: Waitable,
        <U as Unit<'a>>::MutBorrowed: Waitable
; }

The base "get" trait for acquiring data from storage. This is implemented on six types, each of which have a different output. The output is dependent on the type it is being implemented for.

Note that this trait should be considered "sealed" as it is already implemented for all the types it should be implemented for.

Associated Types

type Output: 'a

The type output for Self.

type Actual

A type exposed for type checking on the contents of the returned lock.

Loading content...

Required methods

fn get(boxed: &'a BlackBox<U>) -> Result<Self::Output, ErrorDesc>

Gets data from the BlackBox depending on Self and Output.

fn waiting_get(boxed: &'a BlackBox<U>) -> Result<Self::Output, ErrorDesc> where
    <U as Unit<'a>>::Borrowed: Waitable,
    <U as Unit<'a>>::MutBorrowed: Waitable, 

Gets data from the BlackBox depending on Self and Output. This function waits on availability for the lock.

Loading content...

Implementations on Foreign Types

impl<'a, T: Sized + Any + 'static, U: for<'b> Unit<'b> + ?Sized, '_> Fetch<'a, U> for &'_ T where
    <U as Unit<'a>>::Borrowed: Map<dyn Any, StorageUnit<T>, Func = dyn Fn(&dyn Any) -> &StorageUnit<T>>,
    <<U as Unit<'a>>::Borrowed as Map<dyn Any, StorageUnit<T>>>::Output: Map<StorageUnit<T>, T, Func = dyn Fn(&StorageUnit<T>) -> &T>, 
[src]

type Output = <<<U as Unit<'a>>::Borrowed as Map<dyn Any, StorageUnit<T>>>::Output as Map<StorageUnit<T>, T>>::Output

type Actual = T

impl<'a, T: Sized + Any + 'static, U: for<'b> Unit<'b> + ?Sized, '_> Fetch<'a, U> for &'_ mut T where
    <U as Unit<'a>>::MutBorrowed: MapMut<dyn Any, StorageUnit<T>, Func = dyn Fn(&mut dyn Any) -> &mut StorageUnit<T>>,
    <<U as Unit<'a>>::MutBorrowed as MapMut<dyn Any, StorageUnit<T>>>::Output: MapMut<StorageUnit<T>, T, Func = dyn Fn(&mut StorageUnit<T>) -> &mut T>, 
[src]

type Output = <<<U as Unit<'a>>::MutBorrowed as MapMut<dyn Any, StorageUnit<T>>>::Output as MapMut<StorageUnit<T>, T>>::Output

type Actual = T

impl<'a, T: Sized + Any + 'static, U: for<'b> Unit<'b> + ?Sized, '_> Fetch<'a, U> for &'_ [T] where
    <U as Unit<'a>>::Borrowed: Map<dyn Any, StorageUnit<T>, Func = dyn Fn(&dyn Any) -> &StorageUnit<T>>,
    <<U as Unit<'a>>::Borrowed as Map<dyn Any, StorageUnit<T>>>::Output: Map<StorageUnit<T>, [T], Func = dyn Fn(&StorageUnit<T>) -> &[T]>, 
[src]

type Output = <<<U as Unit<'a>>::Borrowed as Map<dyn Any, StorageUnit<T>>>::Output as Map<StorageUnit<T>, [T]>>::Output

type Actual = T

impl<'a, T: Sized + Any + 'static, U: for<'b> Unit<'b> + ?Sized, '_> Fetch<'a, U> for &'_ mut [T] where
    <U as Unit<'a>>::MutBorrowed: MapMut<dyn Any, StorageUnit<T>, Func = dyn Fn(&mut dyn Any) -> &mut StorageUnit<T>>,
    <<U as Unit<'a>>::MutBorrowed as MapMut<dyn Any, StorageUnit<T>>>::Output: MapMut<StorageUnit<T>, [T], Func = dyn Fn(&mut StorageUnit<T>) -> &mut [T]>, 
[src]

type Output = <<<U as Unit<'a>>::MutBorrowed as MapMut<dyn Any, StorageUnit<T>>>::Output as MapMut<StorageUnit<T>, [T]>>::Output

type Actual = T

impl<'a, T: Sized + Any + 'static, U: for<'b> Unit<'b> + ?Sized> Fetch<'a, U> for Box<T> where
    <U as Unit<'a>>::MutBorrowed: MapMut<dyn Any, StorageUnit<T>, Func = dyn Fn(&mut dyn Any) -> &mut StorageUnit<T>>, 
[src]

type Output = T

type Actual = T

impl<'a, T: Sized + Any + 'static, U: for<'b> Unit<'b> + ?Sized> Fetch<'a, U> for Vec<T> where
    <U as Unit<'a>>::MutBorrowed: MapMut<dyn Any, StorageUnit<T>, Func = dyn Fn(&mut dyn Any) -> &mut StorageUnit<T>>, 
[src]

type Output = Vec<T>

type Actual = T

Loading content...

Implementors

Loading content...