pub struct Fds { /* private fields */ }Available on Unix only.
Expand description
Container for open file descriptors and their associated bind addresses.
Implementations§
Source§impl Fds
impl Fds
pub fn new() -> Self
pub fn add(&mut self, bind: String, fd: RawFd)
pub fn get(&self, bind: &str) -> Option<&RawFd>
pub fn is_empty(&self) -> bool
pub fn serialize(&self) -> (Vec<String>, Vec<RawFd>)
pub fn deserialize(&mut self, binds: Vec<String>, fds: Vec<RawFd>)
pub fn send_to_sock<P>(&self, path: &P) -> Result<usize, Error>
pub fn get_from_sock<P>(&mut self, path: &P) -> Result<(), Error>
Sourcepub fn close_unclaimed(&mut self, keep: &HashSet<String>) -> Vec<String>
pub fn close_unclaimed(&mut self, keep: &HashSet<String>) -> Vec<String>
Close and remove inherited listening fds whose bind addresses are absent from keep.
An unclaimed SO_REUSEPORT socket remains active without an acceptor and can black-hole
connections. Removing it also prevents it from being transferred to the next process.
Returns the addresses removed from the table.
Auto Trait Implementations§
impl Freeze for Fds
impl RefUnwindSafe for Fds
impl Send for Fds
impl Sync for Fds
impl Unpin for Fds
impl UnsafeUnpin for Fds
impl UnwindSafe for Fds
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