pub struct LookupContext {
pub symlink_mode: SymlinkMode,
pub remaining_follows: u8,
pub must_be_directory: bool,
pub resolve_flags: ResolveFlags,
pub resolve_base: ResolveBase,
}Expand description
The context passed during namespace lookups.
Namespace lookups need to mutate a shared context in order to correctly count the number of remaining symlink traversals.
Fields§
§symlink_mode: SymlinkModeThe SymlinkMode for the lookup.
As the lookup proceeds, the follow count is decremented each time the lookup traverses a symlink.
remaining_follows: u8The number of symlinks remaining the follow.
Each time path resolution calls readlink, this value is decremented.
must_be_directory: boolWhether the result of the lookup must be a directory.
For example, if the path ends with a / or if userspace passes
O_DIRECTORY. This flag can be set to true if the lookup encounters a
symlink that ends with a /.
resolve_flags: ResolveFlagsResolve flags passed to openat2. Empty if the lookup originated in any other syscall.
resolve_base: ResolveBaseBase directory for the lookup. Set only when either RESOLVE_BENEATH or RESOLVE_IN_ROOT
is passed to openat2.
Implementations§
Source§impl LookupContext
impl LookupContext
pub fn new(symlink_mode: SymlinkMode) -> LookupContext
pub fn with(&self, symlink_mode: SymlinkMode) -> LookupContext
pub fn update_for_path(&mut self, path: &FsStr)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LookupContext
impl !RefUnwindSafe for LookupContext
impl Send for LookupContext
impl Sync for LookupContext
impl Unpin for LookupContext
impl !UnwindSafe for LookupContext
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
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
T to [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>
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>
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