Enum Receiver

Source
pub enum Receiver {
    UdpFramed {
        ip: String,
        port: String,
        buffer_size: usize,
    },
    UdpConnected {
        ip: String,
        port: String,
        buffer_size: usize,
    },
    TcpStream {
        ip: String,
        port: String,
        buffer_size: usize,
    },
    DtlsStream {
        ip: String,
        port: String,
        buffer_size: usize,
        security: (Option<String>, Option<String>),
    },
    TlsStream {
        ip: String,
        port: String,
        buffer_size: usize,
        security: (Option<String>, Option<String>),
    },
}
Expand description

Facilities to receive data from sockets

Variants§

§

UdpFramed

Read from socket by UdpSocket, using a buffer with length crate::Receiver::UdpFramed::buffer_size

Fields

§port: String
§buffer_size: usize
§

UdpConnected

Read from socket by UdpSocket, using a buffer with length crate::Receiver::UdpFramed::buffer_size and connecting socket to peer

Fields

§port: String
§buffer_size: usize
§

TcpStream

Read from socket by TcpStream, using a buffer with length crate::Receiver::TcpStream::buffer_size

Fields

§port: String
§buffer_size: usize
§

DtlsStream

Read from socket by Session, using a buffer with length crate::Receiver::DtlsStream::buffer_size

crate::Receiver::DtlsStream::security is interpreted as (path to server certificate as PCKS8 file, path to the private key as PCKS8 file)

Fields

§port: String
§buffer_size: usize
§security: (Option<String>, Option<String>)
§

TlsStream

Read from socket by tokio_native_tls::TlsStream, using a buffer with length crate::Receiver::TlsStream::buffer_size

crate::Receiver::TlsStream::security is interpreted as (path to server certificate as PCKS8 file, path to the private key as PCKS8 file)

Fields

§port: String
§buffer_size: usize
§security: (Option<String>, Option<String>)

Implementations§

Source§

impl Receiver

Source

pub fn new_udp_framed(ip: String, port: String, buffer_size: usize) -> Self

Constructs a new Receiver::UdpFramed.

Source§

impl Receiver

Source

pub fn new_udp_connected(ip: String, port: String, buffer_size: usize) -> Self

Constructs a new Receiver::UdpConnected.

Source§

impl Receiver

Source

pub fn new_tcp_stream(ip: String, port: String, buffer_size: usize) -> Self

Constructs a new Receiver::TcpStream.

Source§

impl Receiver

Source

pub fn new_dtls_stream( ip: String, port: String, buffer_size: usize, security: (Option<String>, Option<String>), ) -> Self

Constructs a new Receiver::DtlsStream.

Source§

impl Receiver

Source

pub fn new_tls_stream( ip: String, port: String, buffer_size: usize, security: (Option<String>, Option<String>), ) -> Self

Constructs a new Receiver::TlsStream.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.