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>, token: WeakInstanceToken, ) -> 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 UnsafeUnpin 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
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>
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 more