pub struct Command(/* private fields */);
Implementations§
Source§impl Command
impl Command
pub fn new(entity: ReactiveEntity) -> Result<Self, NotACommand>
pub fn new_unchecked(entity: ReactiveEntity) -> Self
pub fn builder() -> CommandDefinitionBuilder
pub fn get_entity_type(&self) -> EntityType
Sourcepub fn execute_with_args(
&self,
args: HashMap<String, Value>,
) -> Result<Option<Value>, CommandExecutionFailed>
pub fn execute_with_args( &self, args: HashMap<String, Value>, ) -> Result<Option<Value>, CommandExecutionFailed>
Executes a command with the given arguments Stores the command result in the command result property
pub fn namespace(&self) -> Option<String>
pub fn name(&self) -> Option<String>
pub fn label(&self) -> Option<String>
pub fn args(&self) -> Result<CommandArgs, CommandArgsError>
pub fn command(&self) -> Option<Command>
pub fn help(&self) -> Option<String>
pub fn ty(&self) -> EntityTypeId
pub fn get_instance(&self) -> ReactiveEntity
Trait Implementations§
Source§impl From<CommandDefinition> for Command
impl From<CommandDefinition> for Command
Source§fn from(definition: CommandDefinition) -> Self
fn from(definition: CommandDefinition) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Command
impl !RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl !UnwindSafe for Command
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> 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