[−][src]Enum discv5::packet::Packet
Variants
Packet for establishing handshake.
Fields of RandomPacket
Handshake packet to establish identities.
Fields of WhoAreYou
Message sent with an extended authentication header.
Fields of AuthMessage
tag: Tag
The XOR(SHA256(dest-node-id), src-node-id).
auth_header: AuthHeader
Authentication header.
message: Vec<u8>
The encrypted message including the authentication header.
A standard discv5 message.
Fields of Message
Implementations
impl Packet
[src]
pub fn random(tag: Tag) -> Packet
[src]
Generates a Packet::Random given a tag
.
pub fn auth_tag(&self) -> Option<&AuthTag>
[src]
The authentication tag for all packets except WHOAREYOU.
pub fn is_whoareyou(&self) -> bool
[src]
Returns true if the packet is a WHOAREYOU packet.
pub fn is_random(&self) -> bool
[src]
Returns true if the packet is a RANDOM packet.
pub fn encode(&self) -> Vec<u8>
[src]
Encodes a packet to bytes.
fn decode_whoareyou(data: &[u8]) -> Result<Self, PacketError>
[src]
Decodes a WHOAREYOU packet.
fn decode_standard_message(tag: Tag, data: &[u8]) -> Result<Self, PacketError>
[src]
Decodes a regular message (or RandomPacket
) into a Packet
.
fn decode_auth_header(
tag: Tag,
data: &[u8],
rlp_length: usize
) -> Result<Self, PacketError>
[src]
tag: Tag,
data: &[u8],
rlp_length: usize
) -> Result<Self, PacketError>
Decodes a message that contains an authentication header.
pub fn decode(data: &[u8], magic_data: &Magic) -> Result<Self, PacketError>
[src]
Decode raw bytes into a packet. The magic
value (SHA2256(node-id, b"WHOAREYOU")) is passed as a parameter to check for
the magic byte sequence.
Trait Implementations
impl Clone for Packet
[src]
impl Debug for Packet
[src]
impl PartialEq<Packet> for Packet
[src]
impl StructuralPartialEq for Packet
[src]
Auto Trait Implementations
impl RefUnwindSafe for Packet
impl Send for Packet
impl Sync for Packet
impl Unpin for Packet
impl UnwindSafe for Packet
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,