pub struct CommandRegistration {
inner: CommandRegistration<CommandSource>,
}Expand description
A command declaration collected before the server constructs its dispatcher atomically.
Fields§
§inner: CommandRegistration<CommandSource>Implementations§
Source§impl CommandRegistration
impl CommandRegistration
Sourcepub fn new(
id: Identifier,
factory: impl FnOnce() -> CommandNode + Send + 'static,
) -> Self
pub fn new( id: Identifier, factory: impl FnOnce() -> CommandNode + Send + 'static, ) -> Self
Declares a command whose literal root must match the path of id.
Sourcepub fn alias(self, alias: impl Into<Box<str>>) -> Self
pub fn alias(self, alias: impl Into<Box<str>>) -> Self
Adds an unqualified alias owned by this command.
Sourcepub fn default_access(self) -> Self
pub fn default_access(self) -> Self
Allows an unset root permission while still respecting an explicit deny.
Sourcepub fn permission(self, permission: PermissionExpr) -> Self
pub fn permission(self, permission: PermissionExpr) -> Self
Replaces the permission expression derived from the command ID.
Sourcepub fn subcommand_permission<I, T>(self, path: I) -> Self
pub fn subcommand_permission<I, T>(self, path: I) -> Self
Allows a literal path through a permission derived from the command ID.
Auto Trait Implementations§
impl !RefUnwindSafe for CommandRegistration
impl !Sync for CommandRegistration
impl !UnwindSafe for CommandRegistration
impl Freeze for CommandRegistration
impl Send for CommandRegistration
impl Unpin for CommandRegistration
impl UnsafeUnpin for CommandRegistration
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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 moreWraps this value in an
Arc<SyncMutex<>>