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 Arc<Simple>
Available on Fuchsia only.Converts the Namespace into a vfs directory.
impl TryFrom<Namespace> for Arc<Simple>
Converts the Namespace into a vfs directory.
Source§impl TryFrom<Namespace> for TreeBuilder
Available on Fuchsia only.Converts the Namespace to a vfs [TreeBuilder] with tree nodes for each entry.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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,
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