[][src]Struct discv5::transport::Transport

pub(crate) struct Transport {
    socket: UdpSocket,
    send_queue: Vec<(SocketAddr, Packet)>,
    recv_buffer: [u8; 1280],
    whoareyou_magic: [u8; 32],
    waker: Option<Waker>,
}

The main service that handles the transport. Specifically the UDP sockets and packet encoding/decoding.

Fields

socket: UdpSocket

The UDP socket for interacting over UDP.

send_queue: Vec<(SocketAddr, Packet)>

List of discv5 packets to send.

recv_buffer: [u8; 1280]

The buffer to accept inbound datagrams.

whoareyou_magic: [u8; 32]

WhoAreYou Magic Value. Used to decode raw WHOAREYOU packets.

waker: Option<Waker>

Waker to awake the thread on new messages.

Implementations

impl Transport[src]

pub(crate) fn new(
    socket_addr: SocketAddr,
    whoareyou_magic: [u8; 32]
) -> Result<Self>
[src]

Initializes the UDP socket, can fail when binding the socket.

pub(crate) fn send(&mut self, to: SocketAddr, packet: Packet)[src]

Add packets to the send queue.

Trait Implementations

impl Stream for Transport[src]

type Item = (SocketAddr, Packet)

Values yielded by the stream.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> StreamExt for T where
    T: Stream + ?Sized
[src]

impl<St> StreamExt for St where
    St: Stream + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,