Enum CommandSource
#[non_exhaustive]pub enum CommandSource {
Player {
player: PlayerRef,
permission: PermissionLevel,
},
Console {
permission: PermissionLevel,
},
CommandBlock {
position: [i32; 3],
level: DimensionKey,
permission: PermissionLevel,
},
CommandBlockMinecart {
entity: EntityRef,
permission: PermissionLevel,
},
Function {
id: Identifier,
permission: PermissionLevel,
},
}Expand description
The origin of a registered mod command, independent of execute as’s executor.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Player
A player’s command; their state is swapped in for the listener.
Fields
§
permission: PermissionLevelThe execution permission, including function overrides.
Console
The dedicated server console or RCON.
Fields
§
permission: PermissionLevelThe execution permission.
CommandBlock
A command block, including when execute moves its execution position.
Fields
§
level: DimensionKeyThe block’s dimension.
§
permission: PermissionLevelThe execution permission.
CommandBlockMinecart
A command-block minecart.
Fields
§
permission: PermissionLevelThe execution permission.
Function
The innermost executing function; feedback still follows its caller.
Fields
§
id: IdentifierThe function’s namespaced identifier.
§
permission: PermissionLevelThe function’s execution permission.
Implementations§
§impl CommandSource
impl CommandSource
pub fn permission(&self) -> PermissionLevel
pub fn permission(&self) -> PermissionLevel
The effective permission checked before parsing and argument resolution.
Trait Implementations§
§impl Clone for CommandSource
impl Clone for CommandSource
§fn clone(&self) -> CommandSource
fn clone(&self) -> CommandSource
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for CommandSource
impl Debug for CommandSource
§impl PartialEq for CommandSource
impl PartialEq for CommandSource
impl StructuralPartialEq for CommandSource
Auto Trait Implementations§
impl Freeze for CommandSource
impl RefUnwindSafe for CommandSource
impl Send for CommandSource
impl Sync for CommandSource
impl Unpin for CommandSource
impl UnsafeUnpin for CommandSource
impl UnwindSafe for CommandSource
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