pub struct VsockSocket {
fd: RawFd,
}
Expand description
A virtual socket.
Do not use this class unless you need to change socket options or query the state of the socket prior to calling listen or connect. Instead use either VsockStream or VsockListener.
Fields§
§fd: RawFd
Implementations§
source§impl VsockSocket
impl VsockSocket
pub fn new() -> Result<Self>
pub fn bind<A: ToSocketAddr>(&mut self, addr: A) -> Result<()>
pub fn connect<A: ToSocketAddr>(self, addr: A) -> Result<VsockStream>
pub fn listen(self) -> Result<VsockListener>
sourcepub fn local_port(&self) -> Result<u32>
pub fn local_port(&self) -> Result<u32>
Returns the port that this socket is bound to. This can only succeed after bind is called.
pub fn try_clone(&self) -> Result<Self>
pub fn set_nonblocking(&mut self, nonblocking: bool) -> Result<()>
Trait Implementations§
source§impl AsRawFd for VsockSocket
impl AsRawFd for VsockSocket
source§impl Debug for VsockSocket
impl Debug for VsockSocket
source§impl Drop for VsockSocket
impl Drop for VsockSocket
source§impl IntoRawFd for VsockSocket
impl IntoRawFd for VsockSocket
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 VsockSocket
impl Send for VsockSocket
impl Sync for VsockSocket
impl Unpin for VsockSocket
impl UnwindSafe for VsockSocket
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