pub struct UdpDatalink { /* private fields */ }Expand description
A bidirectional UDP data link.
Implementations§
Source§impl UdpDatalink
impl UdpDatalink
Sourcepub fn new(socket: UdpSocket, remote: SocketAddr) -> Self
pub fn new(socket: UdpSocket, remote: SocketAddr) -> Self
Creates a new data link from an existing socket and remote address.
Sourcepub fn bind(local: SocketAddr, remote: SocketAddr) -> Result<Self, CfsError>
pub fn bind(local: SocketAddr, remote: SocketAddr) -> Result<Self, CfsError>
Binds a local socket and creates a data link to the remote address.
Sourcepub fn split(&self) -> (UdpFrameReader<'_>, UdpFrameWriter<'_>)
pub fn split(&self) -> (UdpFrameReader<'_>, UdpFrameWriter<'_>)
Splits into independent read and write halves.
Both halves borrow the underlying socket. send() and
recv() on UdpSocket take &self, so concurrent
use is safe.
Trait Implementations§
Source§impl Datalink for UdpDatalink
impl Datalink for UdpDatalink
Source§type WriteError = CfsError
type WriteError = CfsError
Error type for write operations.
Source§type Reader<'a> = UdpFrameReader<'a>
type Reader<'a> = UdpFrameReader<'a>
Read half type.
Source§type Writer<'a> = UdpFrameWriter<'a>
type Writer<'a> = UdpFrameWriter<'a>
Write half type.
Source§fn split(&mut self) -> (UdpFrameReader<'_>, UdpFrameWriter<'_>)
fn split(&mut self) -> (UdpFrameReader<'_>, UdpFrameWriter<'_>)
Split into independent read and write halves.
Source§impl DatalinkRead for UdpDatalink
impl DatalinkRead for UdpDatalink
Auto Trait Implementations§
impl Freeze for UdpDatalink
impl RefUnwindSafe for UdpDatalink
impl !Send for UdpDatalink
impl !Sync for UdpDatalink
impl Unpin for UdpDatalink
impl UnsafeUnpin for UdpDatalink
impl UnwindSafe for UdpDatalink
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