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
UdpConnected
Read from socket by UdpSocket
, using a buffer with length crate::Receiver::UdpFramed::buffer_size
and connecting socket to peer
TcpStream
Read from socket by TcpStream
, using a buffer with length crate::Receiver::TcpStream::buffer_size
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)
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)
Implementations§
Source§impl Receiver
impl Receiver
Sourcepub fn new_udp_framed(ip: String, port: String, buffer_size: usize) -> Self
pub fn new_udp_framed(ip: String, port: String, buffer_size: usize) -> Self
Constructs a new Receiver::UdpFramed
.
Source§impl Receiver
impl Receiver
Sourcepub fn new_udp_connected(ip: String, port: String, buffer_size: usize) -> Self
pub fn new_udp_connected(ip: String, port: String, buffer_size: usize) -> Self
Constructs a new Receiver::UdpConnected
.
Source§impl Receiver
impl Receiver
Sourcepub fn new_tcp_stream(ip: String, port: String, buffer_size: usize) -> Self
pub fn new_tcp_stream(ip: String, port: String, buffer_size: usize) -> Self
Constructs a new Receiver::TcpStream
.
Auto Trait Implementations§
impl Freeze for Receiver
impl RefUnwindSafe for Receiver
impl Send for Receiver
impl Sync for Receiver
impl Unpin for Receiver
impl UnwindSafe for Receiver
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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