Struct base::sys::linux::vsock::VsockListener

source ·
pub struct VsockListener {
    sock: VsockSocket,
}
Expand description

Represents a virtual socket server.

Fields§

§sock: VsockSocket

Implementations§

source§

impl VsockListener

source

pub fn bind<A: ToSocketAddr>(addr: A) -> Result<VsockListener>

Creates a new VsockListener bound to the specified port on the current virtual socket endpoint.

source

pub fn local_port(&self) -> Result<u32>

Returns the port that this listener is bound to.

source

pub fn accept(&self) -> Result<(VsockStream, SocketAddr)>

Accepts a new incoming connection on this listener. Blocks the calling thread until a new connection is established. When established, returns the corresponding VsockStream and the remote peer’s address.

source

pub fn set_nonblocking(&mut self, nonblocking: bool) -> Result<()>

Trait Implementations§

source§

impl AsRawFd for VsockListener

source§

fn as_raw_fd(&self) -> RawFd

Extracts the raw file descriptor. Read more
source§

impl Debug for VsockListener

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.