pub struct NamespaceBuilder { /* private fields */ }
Expand description
A builder object for assembling a program’s incoming namespace.
Implementations§
Source§impl NamespaceBuilder
impl NamespaceBuilder
pub fn new( namespace_scope: ExecutionScope, not_found: UnboundedSender<String>, ) -> Self
Sourcepub fn add_object(
&mut self,
cap: Capability,
path: &Path,
) -> Result<(), BuildNamespaceError>
pub fn add_object( &mut self, cap: Capability, path: &Path, ) -> Result<(), BuildNamespaceError>
Add a capability cap
at path
. As a result, the framework will create a
namespace entry at the parent directory of path
.
Sourcepub fn add_entry(
&mut self,
cap: Capability,
path: &NamespacePath,
) -> Result<(), BuildNamespaceError>
pub fn add_entry( &mut self, cap: Capability, path: &NamespacePath, ) -> Result<(), BuildNamespaceError>
Add a capability cap
at path
. As a result, the framework will create a
namespace entry at path
directly. The capability will be exercised when the user
opens the path
.
pub fn serve(self) -> Result<Namespace, BuildNamespaceError>
Auto Trait Implementations§
impl Freeze for NamespaceBuilder
impl !RefUnwindSafe for NamespaceBuilder
impl Send for NamespaceBuilder
impl Sync for NamespaceBuilder
impl Unpin for NamespaceBuilder
impl !UnwindSafe for NamespaceBuilder
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