TryFromBlockResponse

Trait TryFromBlockResponse 

Source
pub trait TryFromBlockResponse<N: Network> {
    type Error: Error + Send + Sync + Unpin;

    // Required method
    fn from_block_response(
        block_response: N::BlockResponse,
    ) -> Result<Self, Self::Error>
       where Self: Sized;
}
Expand description

Trait for converting network block responses to primitive block types.

Required Associated Types§

Source

type Error: Error + Send + Sync + Unpin

The error type returned if the conversion fails.

Required Methods§

Source

fn from_block_response( block_response: N::BlockResponse, ) -> Result<Self, Self::Error>
where Self: Sized,

Converts a network block response to a primitive block type.

§Returns

Returns Ok(Self) on successful conversion, or Err(Self::Error) if the conversion fails.

Implementations on Foreign Types§

Source§

impl<N: Network, T> TryFromBlockResponse<N> for Block<T>
where N::BlockResponse: Into<Self>,

Source§

type Error = Infallible

Source§

fn from_block_response( block_response: N::BlockResponse, ) -> Result<Self, Self::Error>

Implementors§