Struct serve_processargs::NamespaceBuilder
source · 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(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>
Trait Implementations§
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