Struct webthing::action::BaseAction [−][src]
pub struct BaseAction { /* fields omitted */ }Basic action implementation.
An Action represents an individual action which can be performed on a thing.
This can easily be used by other actions to handle most of the boring work.
Methods
impl BaseAction[src]
impl BaseActionpub fn new(
id: String,
name: String,
input: Option<Map<String, Value>>,
thing: Weak<RwLock<Box<Thing>>>
) -> BaseAction[src]
pub fn new(
id: String,
name: String,
input: Option<Map<String, Value>>,
thing: Weak<RwLock<Box<Thing>>>
) -> BaseActionCreate a new BaseAction.
id -- ID of this action name -- name of the action input -- any action inputs
Trait Implementations
impl Action for BaseAction[src]
impl Action for BaseActionAn Action represents an individual action on a thing.
fn set_href_prefix(&mut self, prefix: String)[src]
fn set_href_prefix(&mut self, prefix: String)Set the prefix of any hrefs associated with this action.
prefix -- the prefix
fn get_id(&self) -> String[src]
fn get_id(&self) -> StringGet this action's ID.
fn get_name(&self) -> String[src]
fn get_name(&self) -> StringGet this action's name.
fn get_href(&self) -> String[src]
fn get_href(&self) -> StringGet this action's href.
fn get_status(&self) -> String[src]
fn get_status(&self) -> StringGet this action's status.
fn get_thing(&self) -> Option<Arc<RwLock<Box<Thing>>>>[src]
fn get_thing(&self) -> Option<Arc<RwLock<Box<Thing>>>>Get the thing associated with this action.
fn get_time_requested(&self) -> String[src]
fn get_time_requested(&self) -> StringGet the time the action was requested.
fn get_time_completed(&self) -> Option<String>[src]
fn get_time_completed(&self) -> Option<String>Get the time the action was completed.
fn get_input(&self) -> Option<Map<String, Value>>[src]
fn get_input(&self) -> Option<Map<String, Value>>Get the inputs for this action.
fn set_status(&mut self, status: String)[src]
fn set_status(&mut self, status: String)Set the status of this action.
status -- new status
fn start(&mut self)[src]
fn start(&mut self)Start performing the action.
fn perform_action(&mut self)[src]
fn perform_action(&mut self)Override this with the code necessary to perform the action.
fn cancel(&mut self)[src]
fn cancel(&mut self)Override this with the code necessary to cancel the action.
fn finish(&mut self)[src]
fn finish(&mut self)Finish performing the action.
fn as_action_description(&self) -> Map<String, Value>[src]
fn as_action_description(&self) -> Map<String, Value>Get the action description. Read more
Auto Trait Implementations
impl Send for BaseAction
impl Send for BaseActionimpl Sync for BaseAction
impl Sync for BaseAction