pub struct ListenInit<F> {
pub listen: ListenFd,
pub file: Option<F>,
pub target: c_int,
/* private fields */
}Expand description
A ListenFd enriched with a relevant file descriptor for passing to a child process.
This either captures one of the file descriptors passed, or initialized a new owning file
descriptor, generally a file. It also computes the target file descriptor number. That is, if
the file was captured by finding its name in the LISTN_FDNAMES array then it is computed and
in-bounds of the passed array. If the file was not captured, it is added to the listen
information and its new hypothetical descriptor is stored in target.
Fields§
§listen: ListenFdThe originally, potentially modified, passed ListenFd.
file: Option<F>Owns the file if it had to be constructed due to not being found.
target: c_intThe file descriptor the file would have in childs (or the next restart if registered).
See struct description.
Implementations§
Source§impl<F> ListenInit<F>
impl<F> ListenInit<F>
Sourcepub fn named_or_try_create<R>(
this: Option<ListenFd>,
fd_name: &str,
with: impl FnOnce() -> Result<F, R>,
) -> Result<Self, R>
pub fn named_or_try_create<R>( this: Option<ListenFd>, fd_name: &str, with: impl FnOnce() -> Result<F, R>, ) -> Result<Self, R>
Derive a new ListenFd setup, finds or adds a file descriptor.