pub struct SystemDSocket { /* private fields */ }
Expand description
Represents a socket that systemd has passed to us
Implementations§
Source§impl SystemDSocket
impl SystemDSocket
Sourcepub fn name(&self) -> Option<&str>
pub fn name(&self) -> Option<&str>
Get the name of the socket, if it has one.
Systemd can provide names in environemnt variables, but it is not required
to. If the socket does not have a name, this will return None
.
Sourcepub fn listener(self) -> Result<TcpListener, SocketError>
pub fn listener(self) -> Result<TcpListener, SocketError>
Convert this socket into a TcpListener
Trait Implementations§
Source§impl AsFd for SystemDSocket
impl AsFd for SystemDSocket
Source§fn as_fd(&self) -> BorrowedFd<'_>
fn as_fd(&self) -> BorrowedFd<'_>
Borrows the file descriptor. Read more
Source§impl AsRawFd for SystemDSocket
impl AsRawFd for SystemDSocket
Auto Trait Implementations§
impl Freeze for SystemDSocket
impl RefUnwindSafe for SystemDSocket
impl Send for SystemDSocket
impl Sync for SystemDSocket
impl Unpin for SystemDSocket
impl UnwindSafe for SystemDSocket
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