Struct bip_peer::messages::PieceMessage
[−]
[src]
pub struct PieceMessage { /* fields omitted */ }
Message for sending a block to a peer.
This message is shallow, meaning it contains the initial message data, but the actual block should be sent to the peer after sending this message.
Methods
impl PieceMessage
[src]
fn new(piece_index: u32, block_offset: u32, block: Bytes) -> PieceMessage
[src]
fn parse_bytes(
_input: (),
bytes: Bytes,
len: u32
) -> IResult<(), Result<PieceMessage>>
[src]
_input: (),
bytes: Bytes,
len: u32
) -> IResult<(), Result<PieceMessage>>
fn write_bytes<W>(&self, writer: W) -> Result<()> where
W: Write,
[src]
W: Write,
fn piece_index(&self) -> u32
[src]
fn block_offset(&self) -> u32
[src]
fn block_length(&self) -> usize
[src]
fn block(&self) -> Bytes
[src]
Trait Implementations
impl Clone for PieceMessage
[src]
fn clone(&self) -> PieceMessage
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for PieceMessage
[src]
impl Hash for PieceMessage
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl PartialEq for PieceMessage
[src]
fn eq(&self, __arg_0: &PieceMessage) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &PieceMessage) -> bool
[src]
This method tests for !=
.