Trait penumbra_app::AppActionHandler

source ·
pub trait AppActionHandler {
    type CheckStatelessContext: Clone + Send + Sync + 'static;

    // Required methods
    fn check_stateless<'life0, 'async_trait>(
        &'life0 self,
        context: Self::CheckStatelessContext
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn check_and_execute<'life0, 'async_trait, S>(
        &'life0 self,
        state: S
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where S: 'async_trait + StateWrite,
             Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn check_historical<'life0, 'async_trait, S>(
        &'life0 self,
        _state: Arc<S>
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where S: 'async_trait + StateRead + 'static,
             Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Stub: to be replaced with impls of cnidarium_component::ActionHandler

This trait should move to that crate, but the orphan rules make it tricky to move it before we finish splitting all the crates: if we move the trait now, existing impls in this crate on foreign types will all break. But without moving it, we can’t start splitting up the crate at all. Solution: duplicate the trait here and there, and provide a generic impl of this trait for anything implementing the copy of the trait in the other crate. Later, we can delete this trait entirely.

Currently, there are only three impls, all of which are entangled with app-level data:

  • ProposalSubmit (which is entangled with the whole-application state)
  • Action (which needs to slot in the PenumbraHost for IBC action handling)
  • Transaction (which depends on the above)

Required Associated Types§

Required Methods§

source

fn check_stateless<'life0, 'async_trait>( &'life0 self, context: Self::CheckStatelessContext ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn check_and_execute<'life0, 'async_trait, S>( &'life0 self, state: S ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where S: 'async_trait + StateWrite, Self: 'async_trait, 'life0: 'async_trait,

Provided Methods§

source

fn check_historical<'life0, 'async_trait, S>( &'life0 self, _state: Arc<S> ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where S: 'async_trait + StateRead + 'static, Self: Sync + 'async_trait, 'life0: 'async_trait,

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl AppActionHandler for Action

§

type CheckStatelessContext = TransactionContext

source§

fn check_stateless<'life0, 'async_trait>( &'life0 self, context: TransactionContext ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn check_historical<'life0, 'async_trait, S>( &'life0 self, state: Arc<S> ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where S: 'async_trait + StateRead + 'static, Self: 'async_trait, 'life0: 'async_trait,

source§

fn check_and_execute<'life0, 'async_trait, S>( &'life0 self, state: S ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where S: 'async_trait + StateWrite, Self: 'async_trait, 'life0: 'async_trait,

source§

impl AppActionHandler for ProposalSubmit

§

type CheckStatelessContext = ()

source§

fn check_stateless<'life0, 'async_trait>( &'life0 self, _context: () ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn check_and_execute<'life0, 'async_trait, S>( &'life0 self, state: S ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where S: 'async_trait + StateWrite, Self: 'async_trait, 'life0: 'async_trait,

source§

impl AppActionHandler for Transaction

§

type CheckStatelessContext = ()

source§

fn check_stateless<'life0, 'async_trait>( &'life0 self, _context: () ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn check_historical<'life0, 'async_trait, S>( &'life0 self, state: Arc<S> ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where S: 'async_trait + StateRead + 'static, Self: 'async_trait, 'life0: 'async_trait,

source§

fn check_and_execute<'life0, 'async_trait, S>( &'life0 self, state: S ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where S: 'async_trait + StateWrite, Self: 'async_trait, 'life0: 'async_trait,

Implementors§