Struct tokio_vsock::VsockListener
source · 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 !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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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