TryFromBlockResponse

Trait TryFromBlockResponse 

pub trait TryFromBlockResponse<N>
where N: Network,
{ type Error: Error + Send + Sync + Unpin; // Required method fn from_block_response( block_response: <N as Network>::BlockResponse, ) -> Result<Self, Self::Error> where Self: Sized; }
Expand description

Trait for converting network block responses to primitive block types.

Required Associated Types§

type Error: Error + Send + Sync + Unpin

The error type returned if the conversion fails.

Required Methods§

fn from_block_response( block_response: <N as Network>::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§

§

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

§

type Error = Infallible

§

fn from_block_response( block_response: <N as Network>::BlockResponse, ) -> Result<Block<T>, <Block<T> as TryFromBlockResponse<N>>::Error>

Implementors§