pub struct ReplyMsgData {
pub tid: u16,
pub to: Peer,
pub id: Option<[u8; 32]>,
pub token: Option<[u8; 32]>,
pub closer_nodes: Vec<Peer>,
pub error: usize,
pub value: Option<Vec<u8>>,
}Expand description
ReplyMsgData is the Reply data structure that is encoded to/from bytes
Fields§
§tid: u16§to: Peer§id: Option<[u8; 32]>§token: Option<[u8; 32]>TODO remove option? we always send token with reply I thought
closer_nodes: Vec<Peer>§error: usize§value: Option<Vec<u8>>Implementations§
Trait Implementations§
Source§impl Clone for ReplyMsgData
impl Clone for ReplyMsgData
Source§fn clone(&self) -> ReplyMsgData
fn clone(&self) -> ReplyMsgData
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl CompactEncoding for ReplyMsgData
impl CompactEncoding for ReplyMsgData
Source§fn encoded_size(&self) -> Result<usize, EncodingError>
fn encoded_size(&self) -> Result<usize, EncodingError>
The size in bytes required to encode
self.Source§fn encode<'a>(
&self,
buffer: &'a mut [u8],
) -> Result<&'a mut [u8], EncodingError>
fn encode<'a>( &self, buffer: &'a mut [u8], ) -> Result<&'a mut [u8], EncodingError>
Encode
self into buffer returning the remainder of buffer.Source§fn decode(buffer: &[u8]) -> Result<(Self, &[u8]), EncodingError>where
Self: Sized,
fn decode(buffer: &[u8]) -> Result<(Self, &[u8]), EncodingError>where
Self: Sized,
Decode a value from the given
buffer of the type specified by the Decode type parameter
(which defaults to Self). Returns the decoded value and remaining undecoded bytes.Source§fn to_encoded_bytes(&self) -> Result<Box<[u8]>, EncodingError>
fn to_encoded_bytes(&self) -> Result<Box<[u8]>, EncodingError>
Encode
self into a Vec<u8>. This is just a helper method for creating a buffer and
encoding to it in one step. Read moreSource§fn create_buffer(&self) -> Result<Box<[u8]>, EncodingError>
fn create_buffer(&self) -> Result<Box<[u8]>, EncodingError>
Create an empty buffer of the correct size for encoding
self to. This is just a helper
method for: encoding to it in one step. Read moreSource§fn encode_with_len<'a>(
&self,
buffer: &'a mut [u8],
) -> Result<(&'a mut [u8], usize), EncodingError>
fn encode_with_len<'a>( &self, buffer: &'a mut [u8], ) -> Result<(&'a mut [u8], usize), EncodingError>
Like
CompactEncoding::encode but also return the number of bytes encoded.Source§fn decode_with_len(
buffer: &[u8],
) -> Result<(Decode, &[u8], usize), EncodingError>where
Decode: Sized,
fn decode_with_len(
buffer: &[u8],
) -> Result<(Decode, &[u8], usize), EncodingError>where
Decode: Sized,
Like
CompactEncoding::decode but also return the number of bytes decoded.Source§impl Debug for ReplyMsgData
impl Debug for ReplyMsgData
Source§impl PartialEq for ReplyMsgData
impl PartialEq for ReplyMsgData
Source§fn eq(&self, other: &ReplyMsgData) -> bool
fn eq(&self, other: &ReplyMsgData) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ReplyMsgData
Auto Trait Implementations§
impl Freeze for ReplyMsgData
impl RefUnwindSafe for ReplyMsgData
impl Send for ReplyMsgData
impl Sync for ReplyMsgData
impl Unpin for ReplyMsgData
impl UnsafeUnpin for ReplyMsgData
impl UnwindSafe for ReplyMsgData
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