pub struct Namespace { /* private fields */ }
Expand description
The namespace of a component instance.
Namespaces may be represented as a collection of directory client endpoints and their
corresponding unique paths, so called “flat representation”. In this case each path
must be a valid cm_types::NamespacePath
, and no path can be a parent of another path.
See https://fuchsia.dev/fuchsia-src/concepts/process/namespaces for the definition
of namespaces of a process. The namespace of a component largely follows except that
some more characters are disallowed (c.f. cm_types::NamespacePath
documentation).
Implementations§
Source§impl Namespace
impl Namespace
pub fn new() -> Self
pub fn add( &mut self, path: &NamespacePath, directory: ClientEnd<DirectoryMarker>, ) -> Result<(), NamespaceError>
pub fn get(&self, path: &NamespacePath) -> Option<&ClientEnd<DirectoryMarker>>
pub fn remove( &mut self, path: &NamespacePath, ) -> Option<ClientEnd<DirectoryMarker>>
pub fn flatten(self) -> Vec<Entry>
Sourcepub fn paths(&self) -> Vec<NamespacePath>
pub fn paths(&self) -> Vec<NamespacePath>
Get a copy of the paths in the namespace.
Trait Implementations§
Source§impl TryFrom<Namespace> for TreeBuilder
impl TryFrom<Namespace> for TreeBuilder
Converts the Namespace to a vfs [TreeBuilder] with tree nodes for each entry.
The TreeBuilder can then be used to build a vfs directory for this Namespace.
Auto Trait Implementations§
impl Freeze for Namespace
impl RefUnwindSafe for Namespace
impl Send for Namespace
impl Sync for Namespace
impl Unpin for Namespace
impl UnwindSafe for Namespace
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)