penumbra_app

Trait 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,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl AppActionHandler for Action

Source§

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

Source§

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

Source§

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§