pub(crate) struct CommandRegistration<S>where
S: CommandPermissionSource,{
id: Identifier,
aliases: Vec<Box<str>>,
permission: Option<PermissionExpr>,
subcommand_permissions: Vec<Vec<Box<str>>>,
default_access: bool,
factory: Box<dyn FnOnce(NodeId) -> CommandNodeBuilder<S, SteelCommandRuntime> + Send + 'static>,
}Expand description
One complete command tree and its stable owner identity.
Fields§
§id: Identifier§aliases: Vec<Box<str>>§permission: Option<PermissionExpr>§subcommand_permissions: Vec<Vec<Box<str>>>§default_access: bool§factory: Box<dyn FnOnce(NodeId) -> CommandNodeBuilder<S, SteelCommandRuntime> + Send + 'static>Implementations§
Source§impl<S> CommandRegistration<S>where
S: CommandPermissionSource,
impl<S> CommandRegistration<S>where
S: CommandPermissionSource,
Sourcepub(crate) fn new(
id: Identifier,
factory: impl FnOnce(NodeId) -> CommandNodeBuilder<S, SteelCommandRuntime> + Send + 'static,
) -> Self
pub(crate) fn new( id: Identifier, factory: impl FnOnce(NodeId) -> CommandNodeBuilder<S, SteelCommandRuntime> + Send + 'static, ) -> Self
Declares a command whose factory receives the target dispatcher’s root.
Sourcepub(crate) fn alias(self, alias: impl Into<Box<str>>) -> Self
pub(crate) fn alias(self, alias: impl Into<Box<str>>) -> Self
Adds a fixed unqualified alias owned by this command.
Sourcepub(crate) const fn default_access(self) -> Self
pub(crate) const fn default_access(self) -> Self
Allows an unset root permission while still respecting an explicit deny.
Sourcepub(crate) fn permission(self, permission: PermissionExpr) -> Self
pub(crate) fn permission(self, permission: PermissionExpr) -> Self
Replaces the permission expression derived from this command’s ID.
Sourcepub(crate) fn subcommand_permission<I, T>(self, path: I) -> Self
pub(crate) fn subcommand_permission<I, T>(self, path: I) -> Self
Allows a literal path through a permission derived from the command ID.
The root permission remains a fallback grant. For example,
minecraft.command.tick.freeze permits only /tick freeze, while
minecraft.command.tick permits every tick subcommand.
fn validate(&self) -> Result<(), CommandRegistrationError>
Auto Trait Implementations§
impl<S> !RefUnwindSafe for CommandRegistration<S>
impl<S> !Sync for CommandRegistration<S>
impl<S> !UnwindSafe for CommandRegistration<S>
impl<S> Freeze for CommandRegistration<S>
impl<S> Send for CommandRegistration<S>
impl<S> Unpin for CommandRegistration<S>
impl<S> UnsafeUnpin for CommandRegistration<S>
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<>>