pub struct SharedFd { /* private fields */ }Expand description
A raw file descriptor, opened for us by the environment.
The code does assume to own it, but it won’t close the file descriptor.
Implementations§
Sourcepub unsafe fn from_env() -> Option<Self>
Available on crate features std and libc only.
pub unsafe fn from_env() -> Option<Self>
std and libc only.Import a shared file descriptor based on environment variable SHM_SHARED_FDS.
§Safety
Caller asserts that the environment variable has been set to a file descriptor that is not owned by any other resource.
Sourcepub unsafe fn from_listen(var: &ListenFd) -> Option<Self>
Available on crate feature libc only.
pub unsafe fn from_listen(var: &ListenFd) -> Option<Self>
libc only.Import a shared file descriptor based on the contents that would be in the environment variable SHM_SHARED_FDS.
Sourcepub fn into_file(self) -> Result<MemFile, Error>
Available on crate features memfile and std only.
pub fn into_file(self) -> Result<MemFile, Error>
memfile and std only.Open the file descriptor.
This can fail if for some reason the file descriptor does not refer to an anonymous memory file.
pub fn as_raw_fd(&self) -> RawFd
Sourcepub fn into_raw_fd(self) -> RawFd
pub fn into_raw_fd(self) -> RawFd
Grab the raw fie descriptor.
Trait Implementations§
Auto Trait Implementations§
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