pub struct FileDescription { /* private fields */ }Implementations§
Source§impl FileDescription
impl FileDescription
pub fn new(id: u64, path: impl Into<String>, flags: u32) -> Self
pub fn new_with_lock( id: u64, path: impl Into<String>, flags: u32, lock_target: Option<FileLockTarget>, ) -> Self
pub fn with_ref_count( id: u64, path: impl Into<String>, flags: u32, ref_count: usize, ) -> Self
pub fn with_ref_count_and_lock( id: u64, path: impl Into<String>, flags: u32, ref_count: usize, lock_target: Option<FileLockTarget>, ) -> Self
pub fn id(&self) -> u64
pub fn path(&self) -> String
Sourcepub fn proc_display_path(&self) -> String
pub fn proc_display_path(&self) -> String
Linux renders an unlinked open file description through procfs with a
(deleted) suffix while the description itself remains usable.
pub fn is_path_backed_by(&self, expected: &str) -> bool
pub fn rename_path_prefix(&self, old_path: &str, new_path: &str)
pub fn detach_path(&self, expected: &str, file: SharedAnonymousFile) -> bool
Sourcepub fn rebind_deleted_path(&self, expected: &str, live_path: &str) -> bool
pub fn rebind_deleted_path(&self, expected: &str, live_path: &str) -> bool
Keep an unlinked open description attached to the same inode through a surviving hard-link name. The former name remains visible through procfs, while descriptor operations use the live alias.
pub fn detach_directory(&self, _expected: &str, stat: VirtualStat) -> bool
pub fn detached_directory_stat(&self) -> Option<VirtualStat>
pub fn anonymous_stat(&self) -> Option<VirtualStat>
pub fn anonymous_pread(&self, offset: u64, length: usize) -> Option<Vec<u8>>
pub fn anonymous_pwrite( &self, offset: u64, data: &[u8], ) -> Option<FdResult<u64>>
pub fn anonymous_truncate(&self, length: u64) -> Option<FdResult<()>>
pub fn detached_chmod(&self, mode: u32) -> bool
pub fn detached_chown( &self, uid: u32, gid: u32, changed_mode: Option<u32>, ) -> bool
pub fn lock_target(&self) -> Option<FileLockTarget>
pub fn cursor(&self) -> u64
pub fn set_cursor(&self, cursor: u64)
pub fn flags(&self) -> u32
pub fn update_flags(&self, mask: u32, flags: u32) -> u32
pub fn ref_count(&self) -> usize
pub fn increment_ref_count(&self) -> usize
pub fn decrement_ref_count(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for FileDescription
impl RefUnwindSafe for FileDescription
impl Send for FileDescription
impl Sync for FileDescription
impl Unpin for FileDescription
impl UnsafeUnpin for FileDescription
impl UnwindSafe for FileDescription
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more