Skip to main content

EngineMessageStreamExt

Trait EngineMessageStreamExt 

Source
pub trait EngineMessageStreamExt<T: PayloadTypes>: Stream<Item = BeaconEngineMessage<T>> {
    // Provided methods
    fn skip_fcu(self, count: usize) -> EngineSkipFcu<Self>
       where Self: Sized { ... }
    fn maybe_skip_fcu(
        self,
        maybe_count: Option<usize>,
    ) -> Either<EngineSkipFcu<Self>, Self>
       where Self: Sized { ... }
    fn skip_new_payload(self, count: usize) -> EngineSkipNewPayload<Self>
       where Self: Sized { ... }
    fn maybe_skip_new_payload(
        self,
        maybe_count: Option<usize>,
    ) -> Either<EngineSkipNewPayload<Self>, Self>
       where Self: Sized { ... }
    fn store_messages(self, path: PathBuf) -> EngineStoreStream<Self>
       where Self: Sized { ... }
    fn maybe_store_messages(
        self,
        maybe_path: Option<PathBuf>,
    ) -> Either<EngineStoreStream<Self>, Self>
       where Self: Sized { ... }
    fn reorg<Provider, Evm, Validator>(
        self,
        provider: Provider,
        evm_config: Evm,
        payload_validator: Validator,
        frequency: usize,
        depth: Option<usize>,
    ) -> EngineReorg<Self, T, Provider, Evm, Validator>
       where Self: Sized { ... }
    fn maybe_reorg<Provider, Evm, Validator, E, F, Fut>(
        self,
        provider: Provider,
        evm_config: Evm,
        payload_validator_fn: F,
        frequency: Option<usize>,
        depth: Option<usize>,
    ) -> impl Future<Output = Result<Either<EngineReorg<Self, T, Provider, Evm, Validator>, Self>, E>> + Send
       where Self: Sized + Send,
             Provider: Send,
             Evm: Send,
             F: FnOnce() -> Fut + Send,
             Fut: Future<Output = Result<Validator, E>> + Send { ... }
}
Expand description

The collection of stream extensions for engine API message stream.

Provided Methods§

Source

fn skip_fcu(self, count: usize) -> EngineSkipFcu<Self>
where Self: Sized,

Skips the specified number of BeaconEngineMessage::ForkchoiceUpdated messages from the engine message stream.

Source

fn maybe_skip_fcu( self, maybe_count: Option<usize>, ) -> Either<EngineSkipFcu<Self>, Self>
where Self: Sized,

If the count is Some, returns the stream that skips the specified number of BeaconEngineMessage::ForkchoiceUpdated messages. Otherwise, returns Self.

Source

fn skip_new_payload(self, count: usize) -> EngineSkipNewPayload<Self>
where Self: Sized,

Skips the specified number of BeaconEngineMessage::NewPayload messages from the engine message stream.

Source

fn maybe_skip_new_payload( self, maybe_count: Option<usize>, ) -> Either<EngineSkipNewPayload<Self>, Self>
where Self: Sized,

If the count is Some, returns the stream that skips the specified number of BeaconEngineMessage::NewPayload messages. Otherwise, returns Self.

Source

fn store_messages(self, path: PathBuf) -> EngineStoreStream<Self>
where Self: Sized,

Stores engine messages at the specified location.

Source

fn maybe_store_messages( self, maybe_path: Option<PathBuf>, ) -> Either<EngineStoreStream<Self>, Self>
where Self: Sized,

If the path is Some, returns the stream that stores engine messages at the specified location. Otherwise, returns Self.

Source

fn reorg<Provider, Evm, Validator>( self, provider: Provider, evm_config: Evm, payload_validator: Validator, frequency: usize, depth: Option<usize>, ) -> EngineReorg<Self, T, Provider, Evm, Validator>
where Self: Sized,

Creates reorgs with specified frequency.

Source

fn maybe_reorg<Provider, Evm, Validator, E, F, Fut>( self, provider: Provider, evm_config: Evm, payload_validator_fn: F, frequency: Option<usize>, depth: Option<usize>, ) -> impl Future<Output = Result<Either<EngineReorg<Self, T, Provider, Evm, Validator>, Self>, E>> + Send
where Self: Sized + Send, Provider: Send, Evm: Send, F: FnOnce() -> Fut + Send, Fut: Future<Output = Result<Validator, E>> + Send,

If frequency is Some, returns the stream that creates reorgs with specified frequency. Otherwise, returns Self.

The payload_validator_fn closure is only called if frequency is Some, allowing for lazy initialization of the validator.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T, S> EngineMessageStreamExt<T> for S
where T: PayloadTypes, S: Stream<Item = BeaconEngineMessage<T>>,