pub struct AsyncDevice(/* private fields */);
Available on crate feature
tokio
only.Expand description
Implementations§
Methods from Deref<Target = Device>§
Sourcepub fn bring_up(&self) -> Result<()>
pub fn bring_up(&self) -> Result<()>
Brings the device up which makes it ready to send and receive packets.
Sourcepub fn bring_down(&self) -> Result<()>
pub fn bring_down(&self) -> Result<()>
Brings the device down which makes it unable to send and receive packets.
Sourcepub fn set_netmask(&self, netmask: Ipv4Addr) -> Result<()>
pub fn set_netmask(&self, netmask: Ipv4Addr) -> Result<()>
Sets the netmask of the device.
Sourcepub fn get_netmask(&self) -> Result<Ipv4Addr>
pub fn get_netmask(&self) -> Result<Ipv4Addr>
Sets the netmask of the device.
Sourcepub fn set_ipv6_addr(&self, addr: Ipv6Addr) -> Result<()>
pub fn set_ipv6_addr(&self, addr: Ipv6Addr) -> Result<()>
Adds the specified addr
to the list of IPv6 addresses of the interface.
Sourcepub fn get_ipv6_addrs(&self) -> Result<Vec<Ipv6Addr>>
pub fn get_ipv6_addrs(&self) -> Result<Vec<Ipv6Addr>>
Returns the list of IPv6 addresses of the interface.
Sourcepub fn del_ipv6_addr(&self, addr: Ipv6Addr) -> Result<()>
pub fn del_ipv6_addr(&self, addr: Ipv6Addr) -> Result<()>
Deletes the specified IPv6 address from the interface.
Sourcepub fn set_brd_addr(&self, addr: Ipv4Addr) -> Result<()>
pub fn set_brd_addr(&self, addr: Ipv4Addr) -> Result<()>
Sets the broadcast IPv4 address of the device.
Sourcepub fn get_brd_addr(&self) -> Result<Ipv4Addr>
pub fn get_brd_addr(&self) -> Result<Ipv4Addr>
Returns the broadcast IPv4 address of the device.
Sourcepub fn set_dst_addr(&self, addr: Ipv4Addr) -> Result<()>
pub fn set_dst_addr(&self, addr: Ipv4Addr) -> Result<()>
Sets the destination IPv4 address of the device.
Sourcepub fn get_dst_addr(&self) -> Result<Ipv4Addr>
pub fn get_dst_addr(&self) -> Result<Ipv4Addr>
Returns the destination IPv4 address of the device.
Trait Implementations§
Source§impl AsyncRead for AsyncDevice
impl AsyncRead for AsyncDevice
Source§impl AsyncWrite for AsyncDevice
impl AsyncWrite for AsyncDevice
Source§fn poll_write(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8],
) -> Poll<Result<usize>>
fn poll_write( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8], ) -> Poll<Result<usize>>
Attempt to write bytes from
buf
into the object. Read moreSource§fn poll_flush(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Result<()>>
fn poll_flush(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Result<()>>
Attempts to flush the object, ensuring that any buffered data reach
their destination. Read more
Source§fn poll_shutdown(
self: Pin<&mut Self>,
_cx: &mut Context<'_>,
) -> Poll<Result<()>>
fn poll_shutdown( self: Pin<&mut Self>, _cx: &mut Context<'_>, ) -> Poll<Result<()>>
Initiates or attempts to shut down this writer, returning success when
the I/O connection has completely shut down. Read more
Source§fn poll_write_vectored(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>],
) -> Poll<Result<usize, Error>>
fn poll_write_vectored( self: Pin<&mut Self>, cx: &mut Context<'_>, bufs: &[IoSlice<'_>], ) -> Poll<Result<usize, Error>>
Like
poll_write
, except that it writes from a slice of buffers. Read moreSource§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
Determines if this writer has an efficient
poll_write_vectored
implementation. Read moreSource§impl Debug for AsyncDevice
impl Debug for AsyncDevice
Source§impl Deref for AsyncDevice
impl Deref for AsyncDevice
Auto Trait Implementations§
impl Freeze for AsyncDevice
impl !RefUnwindSafe for AsyncDevice
impl Send for AsyncDevice
impl Sync for AsyncDevice
impl Unpin for AsyncDevice
impl !UnwindSafe for AsyncDevice
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