pub struct NotifyFd { /* private fields */ }std and libc only.Expand description
A socket, communicating with systemd.
See man sd_notify for general information on the kind of notifications that can be sent to
the service manager. Note that there’s generally no feedback as described by the man page. The
errors indicate whether the OS interactions failed, not whether any of the messages have been
interpreted or resulted in success.
Implementations§
Source§impl NotifyFd
impl NotifyFd
Sourcepub fn new() -> Option<Result<Self, Error>>
pub fn new() -> Option<Result<Self, Error>>
Open the notification socket, if configured in the environment.
Sourcepub fn from_env(name: OsString) -> Result<Self, Error>
pub fn from_env(name: OsString) -> Result<Self, Error>
Open the socket named by the environment string.
This should be generally used with the contents of $NOTIFY_SOCKET. The string is
interpreted based on the supported protocol and the first character, as described in the
systemd documentation. Note that there’s a maximum sensible length for the path named by
this environment variable, as per libc::sockaddr_un.