Enum nash_protocol::protocol::ProtocolHook [−][src]
pub enum ProtocolHook {
SignAllState(SignAllStates),
Protocol(NashProtocolRequest),
}Expand description
Captures and protocol request or pipeline that can be executed in a run_before
or run_after hook for the NashProtocol and NashProtocolPipeline traits.
Variants
SignAllState(SignAllStates)Tuple Fields of SignAllState
Protocol(NashProtocolRequest)Tuple Fields of Protocol
Trait Implementations
Implement NashProtocolPipeline for ProtocolHook so that hooks can be run as typical pipelines
type PipelineState = ProtocolHookState
type PipelineState = ProtocolHookState
State managed by pipeline and used to hold intermediate results and allow the implementer to decide whether the pipeline is over Read more
type ActionType = NashProtocolRequest
type ActionType = NashProtocolRequest
Wrapper type for all actions this pipeline can take
If you want to limit the amount of concurrency of a pipeline return a Semaphore here
fn init_state<'life0, 'async_trait>(
&'life0 self,
state: Arc<RwLock<State>>
) -> Pin<Box<dyn Future<Output = Self::PipelineState> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn init_state<'life0, 'async_trait>(
&'life0 self,
state: Arc<RwLock<State>>
) -> Pin<Box<dyn Future<Output = Self::PipelineState> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Create initial state for the pipeline
Give next action to take or return None if pipeline is finished. &State needs
to be mutable as client may modify itself when producing the next step (e.g., removing
and r value generate a signature) Read more
fn process_step<'life0, 'life1, 'async_trait>(
&'life0 self,
result: <NashProtocolRequest as NashProtocol>::Response,
pipeline_state: &'life1 mut Self::PipelineState
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn process_step<'life0, 'life1, 'async_trait>(
&'life0 self,
result: <NashProtocolRequest as NashProtocol>::Response,
pipeline_state: &'life1 mut Self::PipelineState
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Process the results of a pipeline step
fn output(
&self,
pipeline_state: Self::PipelineState
) -> Result<ResponseOrError<NashProtocolResponse>>
fn output(
&self,
pipeline_state: Self::PipelineState
) -> Result<ResponseOrError<NashProtocolResponse>>
Get results from pipeline or None if the pipeline is not finished
Auto Trait Implementations
impl !RefUnwindSafe for ProtocolHook
impl Send for ProtocolHook
impl Sync for ProtocolHook
impl Unpin for ProtocolHook
impl !UnwindSafe for ProtocolHook
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more