Trait IntoView

Source
pub trait IntoView<'en, FE> {
    type Txn: Transaction<FE>;
    type View: IntoStream<'en> + 'en;

    // Required method
    fn into_view<'async_trait>(
        self,
        txn: Self::Txn,
    ) -> Pin<Box<dyn Future<Output = Result<Self::View, TCError>> + Send + 'async_trait>>
       where Self: 'async_trait;
}
Expand description

Access a view which can be encoded with en::IntoStream.

Required Associated Types§

Source

type Txn: Transaction<FE>

The type of Transaction which this state supports

Source

type View: IntoStream<'en> + 'en

The type of encodable view returned by into_view

Required Methods§

Source

fn into_view<'async_trait>( self, txn: Self::Txn, ) -> Pin<Box<dyn Future<Output = Result<Self::View, TCError>> + Send + 'async_trait>>
where Self: 'async_trait,

Return a View which can be encoded with en::IntoStream.

Implementations on Foreign Types§

Source§

impl<'en, Txn> IntoView<'en, CacheBlock> for State<Txn>
where Txn: Transaction<CacheBlock> + Gateway<State<Txn>>,

Source§

type Txn = Txn

Source§

type View = StateView<'en>

Source§

fn into_view<'async_trait>( self, txn: <State<Txn> as IntoView<'en, CacheBlock>>::Txn, ) -> Pin<Box<dyn Future<Output = Result<<State<Txn> as IntoView<'en, CacheBlock>>::View, TCError>> + Send + 'async_trait>>
where State<Txn>: 'async_trait,

Source§

impl<'en, Txn> IntoView<'en, CacheBlock> for Object<Txn>
where Txn: Transaction<CacheBlock> + Gateway<State<Txn>>,

Source§

type Txn = Txn

Source§

type View = ObjectView<'en>

Source§

fn into_view<'async_trait>( self, _txn: Txn, ) -> Pin<Box<dyn Future<Output = Result<ObjectView<'en>, TCError>> + Send + 'async_trait>>
where Object<Txn>: 'async_trait,

Source§

impl<'en, Txn> IntoView<'en, CacheBlock> for Closure<Txn>
where Txn: Transaction<CacheBlock> + Gateway<State<Txn>>,

Source§

type Txn = Txn

Source§

type View = (HashMap<Id, StateView<'en>>, OpDef)

Source§

fn into_view<'async_trait>( self, txn: <Closure<Txn> as IntoView<'en, CacheBlock>>::Txn, ) -> Pin<Box<dyn Future<Output = Result<<Closure<Txn> as IntoView<'en, CacheBlock>>::View, TCError>> + Send + 'async_trait>>
where Closure<Txn>: 'async_trait,

Implementors§