pub(crate) struct CommandNode<S, R = BrigadierRuntime>where
R: CommandRuntime<S>,{
pub(super) data: CommandNodeData<R::Argument>,
pub(super) children: Vec<NodeId>,
pub(super) executor: Option<Arc<R::Executor>>,
pub(super) requirement: CommandRequirement<S>,
pub(super) execution_requirement: CommandRequirement<S>,
pub(super) redirect: Option<CommandRedirect<S, R>>,
}Expand description
One node stored in the dispatcher’s arena.
Fields§
§data: CommandNodeData<R::Argument>§children: Vec<NodeId>§executor: Option<Arc<R::Executor>>§requirement: CommandRequirement<S>§execution_requirement: CommandRequirement<S>§redirect: Option<CommandRedirect<S, R>>Implementations§
Source§impl<S, R> CommandNode<S, R>where
R: CommandRuntime<S>,
impl<S, R> CommandNode<S, R>where
R: CommandRuntime<S>,
pub(super) const fn root() -> Self
Sourcepub(crate) const fn is_executable(&self) -> bool
pub(crate) const fn is_executable(&self) -> bool
Returns whether this node has a command callback.
Sourcepub(crate) fn can_execute(&self, source: &S) -> bool
pub(crate) fn can_execute(&self, source: &S) -> bool
Returns whether this source may run the node’s executor.
Sourcepub(crate) fn is_forked_redirect(&self) -> bool
pub(crate) fn is_forked_redirect(&self) -> bool
Returns whether this node’s redirect forks its command source.
Sourcepub(crate) fn has_redirect_modifier(&self) -> bool
pub(crate) fn has_redirect_modifier(&self) -> bool
Returns whether this node transforms sources while redirecting.
Sourcepub(crate) const fn argument_type(&self) -> Option<&R::Argument>
pub(crate) const fn argument_type(&self) -> Option<&R::Argument>
Returns this node’s argument parser when it is an argument node.
Sourcepub(crate) fn allows(&self, source: &S) -> bool
pub(crate) fn allows(&self, source: &S) -> bool
Returns whether this node is available to source.
Sourcepub(crate) const fn is_restricted(&self) -> bool
pub(crate) const fn is_restricted(&self) -> bool
Returns whether this node is guarded by authorization.
pub(super) fn validate_compatible( &self, incoming: &UnregisteredCommandNode<S, R>, ) -> Result<(), RegistrationError>
Auto Trait Implementations§
impl<S, R = BrigadierRuntime> !RefUnwindSafe for CommandNode<S, R>
impl<S, R = BrigadierRuntime> !UnwindSafe for CommandNode<S, R>
impl<S, R> Freeze for CommandNode<S, R>
impl<S, R> Send for CommandNode<S, R>
impl<S, R> Sync for CommandNode<S, R>
impl<S, R> Unpin for CommandNode<S, R>
impl<S, R> UnsafeUnpin for CommandNode<S, R>
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<>>