Struct vmm_vhost::sys::unix::SocketListener
source · pub struct SocketListener {
fd: SystemListener,
drop_path: Option<Box<dyn Any>>,
}
Expand description
Unix domain socket listener for accepting incoming connections.
Fields§
§fd: SystemListener
§drop_path: Option<Box<dyn Any>>
Implementations§
source§impl SocketListener
impl SocketListener
sourcepub fn new<P: AsRef<Path>>(path: P, unlink: bool) -> Result<Self>
pub fn new<P: AsRef<Path>>(path: P, unlink: bool) -> Result<Self>
Create a unix domain socket listener.
§Return:
-
- the new SocketListener object on success.
-
- SocketError: failed to create listener socket.
sourcepub fn take_resources_for_parent(&mut self) -> Option<Box<dyn Any>>
pub fn take_resources_for_parent(&mut self) -> Option<Box<dyn Any>>
Take and return the resources that the parent process needs to keep alive as long as the child process lives, in case of incoming fork.
Trait Implementations§
source§impl AsRawDescriptor for SocketListener
impl AsRawDescriptor for SocketListener
source§fn as_raw_descriptor(&self) -> RawDescriptor
fn as_raw_descriptor(&self) -> RawDescriptor
Returns the underlying raw descriptor. Read more
source§impl Listener for SocketListener
impl Listener for SocketListener
source§fn accept(&mut self) -> Result<Option<Connection<FrontendReq>>>
fn accept(&mut self) -> Result<Option<Connection<FrontendReq>>>
Accept an incoming connection.
§Return:
-
- Some(SystemListener): new SystemListener object if new incoming connection is available.
-
- None: no incoming connection available.
-
- SocketError: errors from accept().
Auto Trait Implementations§
impl !RefUnwindSafe for SocketListener
impl !Send for SocketListener
impl !Sync for SocketListener
impl Unpin for SocketListener
impl !UnwindSafe for SocketListener
Blanket Implementations§
§impl<T> AsRawDescriptors for Twhere
T: AsRawDescriptor,
impl<T> AsRawDescriptors for Twhere
T: AsRawDescriptor,
§fn as_raw_descriptors(&self) -> Vec<i32>
fn as_raw_descriptors(&self) -> Vec<i32>
Returns the underlying raw descriptors. Read more
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