#[repr(u8)]pub enum InternalCommand {
Ping = 0,
PingNat = 1,
FindNode = 2,
DownHint = 3,
}Expand description
TODO in js this is de/encoded with c.uint which is for a variable sized unsigned integer.
Variants§
Trait Implementations§
Source§impl Clone for InternalCommand
impl Clone for InternalCommand
Source§fn clone(&self) -> InternalCommand
fn clone(&self) -> InternalCommand
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 InternalCommand
impl CompactEncoding for InternalCommand
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.impl Copy for InternalCommand
Source§impl Debug for InternalCommand
impl Debug for InternalCommand
Source§impl Display for InternalCommand
impl Display for InternalCommand
Source§impl From<InternalCommand> for Command
impl From<InternalCommand> for Command
Source§fn from(value: InternalCommand) -> Self
fn from(value: InternalCommand) -> Self
Converts to this type from the input type.
Source§impl PartialEq for InternalCommand
impl PartialEq for InternalCommand
Source§fn eq(&self, other: &InternalCommand) -> bool
fn eq(&self, other: &InternalCommand) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for InternalCommand
Auto Trait Implementations§
impl Freeze for InternalCommand
impl RefUnwindSafe for InternalCommand
impl Send for InternalCommand
impl Sync for InternalCommand
impl Unpin for InternalCommand
impl UnsafeUnpin for InternalCommand
impl UnwindSafe for InternalCommand
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