Struct vsock::VsockListener
source · pub struct VsockListener { /* private fields */ }
Expand description
A virtio socket server, listening for connections.
Implementations§
source§impl VsockListener
impl VsockListener
sourcepub fn bind(addr: &impl SockaddrLike) -> Result<Self>
pub fn bind(addr: &impl SockaddrLike) -> Result<Self>
Create a new VsockListener which is bound and listening on the socket address.
sourcepub fn bind_with_cid_port(cid: u32, port: u32) -> Result<VsockListener>
pub fn bind_with_cid_port(cid: u32, port: u32) -> Result<VsockListener>
Create a new VsockListener with specified cid and port.
sourcepub fn local_addr(&self) -> Result<VsockAddr>
pub fn local_addr(&self) -> Result<VsockAddr>
The local socket address of the listener.
sourcepub fn try_clone(&self) -> Result<Self>
pub fn try_clone(&self) -> Result<Self>
Create a new independently owned handle to the underlying socket.
sourcepub fn accept(&self) -> Result<(VsockStream, VsockAddr)>
pub fn accept(&self) -> Result<(VsockStream, VsockAddr)>
Accept a new incoming connection from this listener.
sourcepub fn incoming(&self) -> Incoming<'_> ⓘ
pub fn incoming(&self) -> Incoming<'_> ⓘ
An iterator over the connections being received on this listener.
sourcepub fn take_error(&self) -> Result<Option<Error>>
pub fn take_error(&self) -> Result<Option<Error>>
Retrieve the latest error associated with the underlying socket.
sourcepub fn set_nonblocking(&self, nonblocking: bool) -> Result<()>
pub fn set_nonblocking(&self, nonblocking: bool) -> Result<()>
Move this stream in and out of nonblocking mode.
Trait Implementations§
source§impl AsFd for VsockListener
impl AsFd for VsockListener
source§fn as_fd(&self) -> BorrowedFd<'_>
fn as_fd(&self) -> BorrowedFd<'_>
Borrows the file descriptor. Read more
source§impl AsRawFd for VsockListener
impl AsRawFd for VsockListener
source§impl Debug for VsockListener
impl Debug for VsockListener
source§impl FromRawFd for VsockListener
impl FromRawFd for VsockListener
source§unsafe fn from_raw_fd(socket: RawFd) -> Self
unsafe fn from_raw_fd(socket: RawFd) -> Self
Constructs a new instance of
Self
from the given raw file
descriptor. Read moresource§impl IntoRawFd for VsockListener
impl IntoRawFd for VsockListener
source§fn into_raw_fd(self) -> RawFd
fn into_raw_fd(self) -> RawFd
Consumes this object, returning the raw underlying file descriptor. Read more
Auto Trait Implementations§
impl Freeze for VsockListener
impl RefUnwindSafe for VsockListener
impl Send for VsockListener
impl Sync for VsockListener
impl Unpin for VsockListener
impl UnwindSafe for VsockListener
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