pub struct FsContext { /* private fields */ }Expand description
The file system context associated with a task.
File system operations, such as opening a file or mounting a directory, are performed using this context.
Implementations§
Source§impl FsContext
impl FsContext
Sourcepub fn new(namespace: Arc<Namespace>) -> Arc<FsContext>
pub fn new(namespace: Arc<Namespace>) -> Arc<FsContext>
Create an FsContext for the given namespace.
The root and cwd of the FsContext are initialized to the root of the namespace.
pub fn fork(&self) -> Arc<FsContext>
Sourcepub fn cwd(&self) -> NamespaceNode
pub fn cwd(&self) -> NamespaceNode
Returns a reference to the current working directory.
Sourcepub fn root(&self) -> NamespaceNode
pub fn root(&self) -> NamespaceNode
Returns the root.
Sourcepub fn chdir<L>(
&self,
locked: &mut Locked<L>,
current_task: &CurrentTask,
name: NamespaceNode,
) -> Result<(), Errno>where
L: LockEqualOrBefore<FileOpsCore>,
pub fn chdir<L>(
&self,
locked: &mut Locked<L>,
current_task: &CurrentTask,
name: NamespaceNode,
) -> Result<(), Errno>where
L: LockEqualOrBefore<FileOpsCore>,
Change the current working directory.
Sourcepub fn chroot<L>(
&self,
locked: &mut Locked<L>,
current_task: &CurrentTask,
name: NamespaceNode,
) -> Result<(), Errno>where
L: LockEqualOrBefore<FileOpsCore>,
pub fn chroot<L>(
&self,
locked: &mut Locked<L>,
current_task: &CurrentTask,
name: NamespaceNode,
) -> Result<(), Errno>where
L: LockEqualOrBefore<FileOpsCore>,
Change the root.
pub fn umask(&self) -> FileMode
pub fn apply_umask(&self, mode: FileMode) -> FileMode
pub fn set_umask(&self, umask: FileMode) -> FileMode
pub fn set_namespace(&self, new_ns: Arc<Namespace>) -> Result<(), Errno>
pub fn namespace(&self) -> Arc<Namespace>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for FsContext
impl !RefUnwindSafe for FsContext
impl Send for FsContext
impl Sync for FsContext
impl Unpin for FsContext
impl !UnwindSafe for FsContext
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, 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
Converts the given service transport handle of type
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>
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 moreSource§impl<T, U> MultiArchFrom<T> for Uwhere
U: From<T>,
impl<T, U> MultiArchFrom<T> for Uwhere
U: From<T>,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
type Error = <U as TryFromExt<T>>::Error
§fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
Tries to perform the conversion.