pub struct Lookup<R: AsFd>(/* private fields */);Expand description
Lookup buffer
Implementations§
Source§impl<R: AsFd> Lookup<R>
impl<R: AsFd> Lookup<R>
Sourcepub fn treeid(&mut self) -> Result<u64>
pub fn treeid(&mut self) -> Result<u64>
Lookup the treeid for the subvolume referenced by the underlying path or file descriptor.
Sourcepub fn path_str(&mut self, objectid: u64, treeid: u64) -> Result<&UnixPath>
pub fn path_str(&mut self, objectid: u64, treeid: u64) -> Result<&UnixPath>
Lookup path from an inode to a subvolume root
This function retrurns a lookup path as a string slice to objectid which is the inode of a
file or directory which must be containded in the subvolume referenced by treeid. The returned
path is relative to the subvolume referenced by treeid. objectid and treeid must both be
within the btrfs filesystem referenced by fs.
§Errors
The path to be returned contained invalid UTF-8.
§Notes
Requires CAP_SYS_ADMIN capabilities
Trait Implementations§
Source§impl<'r> From<BorrowedFd<'r>> for Lookup<BorrowedFd<'r>>
impl<'r> From<BorrowedFd<'r>> for Lookup<BorrowedFd<'r>>
Source§fn from(value: BorrowedFd<'r>) -> Self
fn from(value: BorrowedFd<'r>) -> Self
Initialise a lookup buffer from a raw file descriptor. The file descriptor will
not be closed when Lookup instance is dropped
Auto Trait Implementations§
impl<R> Freeze for Lookup<R>where
R: Freeze,
impl<R> RefUnwindSafe for Lookup<R>where
R: RefUnwindSafe,
impl<R> Send for Lookup<R>where
R: Send,
impl<R> Sync for Lookup<R>where
R: Sync,
impl<R> Unpin for Lookup<R>where
R: Unpin,
impl<R> UnsafeUnpin for Lookup<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for Lookup<R>where
R: UnwindSafe,
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> 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