pub trait Action: Send + Sync {
Show 15 methods
fn set_href_prefix(&mut self, prefix: String);
fn get_id(&self) -> String;
fn get_name(&self) -> String;
fn get_href(&self) -> String;
fn get_status(&self) -> String;
fn get_thing(&self) -> Option<Arc<RwLock<Box<dyn Thing>>>>;
fn get_time_requested(&self) -> String;
fn get_time_completed(&self) -> Option<String>;
fn get_input(&self) -> Option<Map<String, Value>>;
fn set_status(&mut self, status: String);
fn start(&mut self);
fn perform_action(&mut self);
fn cancel(&mut self);
fn finish(&mut self);
fn as_action_description(&self) -> Map<String, Value> { ... }
}
Expand description
High-level Action trait.
Required Methods
sourcefn set_href_prefix(&mut self, prefix: String)
fn set_href_prefix(&mut self, prefix: String)
Set the prefix of any hrefs associated with this action.
sourcefn get_status(&self) -> String
fn get_status(&self) -> String
Get this action’s status.
Get the thing associated with this action.
sourcefn get_time_requested(&self) -> String
fn get_time_requested(&self) -> String
Get the time the action was requested.
sourcefn get_time_completed(&self) -> Option<String>
fn get_time_completed(&self) -> Option<String>
Get the time the action was completed.
sourcefn set_status(&mut self, status: String)
fn set_status(&mut self, status: String)
Set the status of this action.
sourcefn perform_action(&mut self)
fn perform_action(&mut self)
Override this with the code necessary to perform the action.
Provided Methods
sourcefn as_action_description(&self) -> Map<String, Value>
fn as_action_description(&self) -> Map<String, Value>
Get the action description.
Returns a JSON map describing the action.
Implementors
impl Action for BaseAction
An Action represents an individual action on a thing.