pub struct BlockResponse<N>where
N: Network,{
pub request: BlockRequest,
pub blocks: Data<DataBlocks<N>>,
pub latest_consensus_version: Option<ConsensusVersion>,
}Fields§
§request: BlockRequestThe original block request.
blocks: Data<DataBlocks<N>>The blocks.
latest_consensus_version: Option<ConsensusVersion>The consensus version at the height of the last block in this response.
This enables detecting if the current node, or the peer, missed an upgrade. Its value is None for messages with version < 2.
Implementations§
Source§impl<N> BlockResponse<N>where
N: Network,
impl<N> BlockResponse<N>where
N: Network,
pub fn new( request: BlockRequest, blocks: DataBlocks<N>, latest_consensus_version: ConsensusVersion, ) -> BlockResponse<N>
Trait Implementations§
Source§impl<N> Clone for BlockResponse<N>
impl<N> Clone for BlockResponse<N>
Source§fn clone(&self) -> BlockResponse<N>
fn clone(&self) -> BlockResponse<N>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<N> Debug for BlockResponse<N>
impl<N> Debug for BlockResponse<N>
Source§impl<N> EventTrait for BlockResponse<N>where
N: Network,
impl<N> EventTrait for BlockResponse<N>where
N: Network,
Source§impl<N> FromBytes for BlockResponse<N>where
N: Network,
impl<N> FromBytes for BlockResponse<N>where
N: Network,
Source§fn read_le<R>(reader: R) -> Result<BlockResponse<N>, Error>where
R: Read,
fn read_le<R>(reader: R) -> Result<BlockResponse<N>, Error>where
R: Read,
Reads
Self from reader as little-endian bytes.Source§fn from_bytes_le(bytes: &[u8]) -> Result<Self, Error>where
Self: Sized,
fn from_bytes_le(bytes: &[u8]) -> Result<Self, Error>where
Self: Sized,
Returns
Self from a byte array in little-endian order.Source§fn from_bytes_le_unchecked(bytes: &[u8]) -> Result<Self, Error>where
Self: Sized,
fn from_bytes_le_unchecked(bytes: &[u8]) -> Result<Self, Error>where
Self: Sized,
Same behavior as
Self::from_bytes_le but avoids costly checks.
This shall only be called when deserializing from a trusted source, such as local storage. Read moreSource§fn read_le_unchecked<R>(reader: R) -> Result<Self, Error>
fn read_le_unchecked<R>(reader: R) -> Result<Self, Error>
Same behavior as
Self::read_le but avoids costly checks.
This shall only be called when deserializing from a trusted source, such as local storage. Read moreSource§impl<N: Network> MessageTrait for BlockResponse<N>
impl<N: Network> MessageTrait for BlockResponse<N>
Source§impl<N> PartialEq for BlockResponse<N>
impl<N> PartialEq for BlockResponse<N>
Source§impl<N> ToBytes for BlockResponse<N>where
N: Network,
impl<N> ToBytes for BlockResponse<N>where
N: Network,
impl<N> Eq for BlockResponse<N>
impl<N> StructuralPartialEq for BlockResponse<N>where
N: Network,
Auto Trait Implementations§
impl<N> !Freeze for BlockResponse<N>
impl<N> RefUnwindSafe for BlockResponse<N>where
<N as Network>::BlockHash: RefUnwindSafe,
<N as Network>::StateRoot: RefUnwindSafe,
<N as Environment>::Field: RefUnwindSafe,
N: RefUnwindSafe,
<N as Environment>::Scalar: RefUnwindSafe,
<N as Network>::TransactionID: RefUnwindSafe,
<N as Environment>::Projective: RefUnwindSafe,
<N as Network>::RatificationID: RefUnwindSafe,
<N as Network>::TransitionID: RefUnwindSafe,
<<N as Environment>::PairingCurve as PairingEngine>::G1Affine: RefUnwindSafe,
<N as Network>::TransmissionChecksum: RefUnwindSafe,
impl<N> Send for BlockResponse<N>
impl<N> Sync for BlockResponse<N>
impl<N> Unpin for BlockResponse<N>where
<N as Network>::BlockHash: Unpin,
<N as Network>::StateRoot: Unpin,
<N as Environment>::Field: Unpin,
N: Unpin,
<N as Environment>::Scalar: Unpin,
<N as Network>::TransactionID: Unpin,
<N as Environment>::Projective: Unpin,
<N as Network>::RatificationID: Unpin,
<N as Network>::TransitionID: Unpin,
<<N as Environment>::PairingCurve as PairingEngine>::G1Affine: Unpin,
impl<N> UnwindSafe for BlockResponse<N>where
<N as Network>::BlockHash: UnwindSafe,
<N as Network>::StateRoot: UnwindSafe,
<N as Environment>::Field: UnwindSafe + RefUnwindSafe,
N: UnwindSafe + RefUnwindSafe,
<N as Environment>::Scalar: UnwindSafe + RefUnwindSafe,
<N as Network>::TransactionID: UnwindSafe + RefUnwindSafe,
<N as Environment>::Projective: UnwindSafe + RefUnwindSafe,
<N as Network>::RatificationID: UnwindSafe,
<N as Network>::TransitionID: UnwindSafe,
<<N as Environment>::PairingCurve as PairingEngine>::G1Affine: UnwindSafe + RefUnwindSafe,
<N as Network>::TransmissionChecksum: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more