Trait AsHandle

Source
pub trait AsHandle {
    type Fd;

    // Required methods
    fn from_fd(fd: Self::Fd) -> Self;
    fn detach(&mut self);
    fn detach_with_msg<T: AsRef<[u8]>>(&mut self, msg: T);
}
Expand description

Handle returned from daemonize to the daemon process the daemon should use this handle to detach itself from the parent process, In cases where your program needs to run set up before starting this can be useful, as the daemon will pipe it’s stdout/stderr to the parent process to communicate if start up was successful

Required Associated Types§

Required Methods§

Source

fn from_fd(fd: Self::Fd) -> Self

Creates a Handle from a raw file descriptor

Source

fn detach(&mut self)

Detach the daemon from the parent process this will write “Daemon started successfully” to stdout before detaching

§panics

if detach is called more than once

Source

fn detach_with_msg<T: AsRef<[u8]>>(&mut self, msg: T)

Detach the daemon from the parent process with a custom message to be printed to stdout before detaching

§panics

if detach_with_msg is called more than once

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§