pub struct VsockListener { /* private fields */ }
Expand description
An I/O object representing a Virtio socket listening for incoming connections.
Implementations§
Source§impl VsockListener
impl VsockListener
Sourcepub fn bind(addr: VsockAddr) -> Result<Self>
pub fn bind(addr: VsockAddr) -> Result<Self>
Create a new Virtio socket listener associated with this event loop.
Sourcepub async fn accept(&mut self) -> Result<(VsockStream, VsockAddr)>
pub async fn accept(&mut self) -> Result<(VsockStream, VsockAddr)>
Accepts a new incoming connection to this listener.
Sourcepub fn poll_accept(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<(VsockStream, VsockAddr)>>
pub fn poll_accept( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<(VsockStream, VsockAddr)>>
Attempt to accept a connection and create a new connected socket if successful.
Sourcepub fn poll_accept_std(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<(VsockStream, VsockAddr)>>
pub fn poll_accept_std( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<(VsockStream, VsockAddr)>>
Attempt to accept a connection and create a new connected socket if successful.
Sourcepub fn local_addr(&self) -> Result<VsockAddr>
pub fn local_addr(&self) -> Result<VsockAddr>
The local address that this listener is bound to.
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(fd: RawFd) -> Self
unsafe fn from_raw_fd(fd: 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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request