[][src]Trait webthing::action::Action

pub trait Action: Send + Sync {
    pub fn set_href_prefix(&mut self, prefix: String);
pub fn get_id(&self) -> String;
pub fn get_name(&self) -> String;
pub fn get_href(&self) -> String;
pub fn get_status(&self) -> String;
pub fn get_thing(&self) -> Option<Arc<RwLock<Box<dyn Thing>>>>;
pub fn get_time_requested(&self) -> String;
pub fn get_time_completed(&self) -> Option<String>;
pub fn get_input(&self) -> Option<Map<String, Value>>;
pub fn set_status(&mut self, status: String);
pub fn start(&mut self);
pub fn perform_action(&mut self);
pub fn cancel(&mut self);
pub fn finish(&mut self); pub fn as_action_description(&self) -> Map<String, Value> { ... } }

High-level Action trait.

Required methods

pub fn set_href_prefix(&mut self, prefix: String)[src]

Set the prefix of any hrefs associated with this action.

pub fn get_id(&self) -> String[src]

Get this action's ID.

pub fn get_name(&self) -> String[src]

Get this action's name.

pub fn get_href(&self) -> String[src]

Get this action's href.

pub fn get_status(&self) -> String[src]

Get this action's status.

pub fn get_thing(&self) -> Option<Arc<RwLock<Box<dyn Thing>>>>[src]

Get the thing associated with this action.

pub fn get_time_requested(&self) -> String[src]

Get the time the action was requested.

pub fn get_time_completed(&self) -> Option<String>[src]

Get the time the action was completed.

pub fn get_input(&self) -> Option<Map<String, Value>>[src]

Get the inputs for this action.

pub fn set_status(&mut self, status: String)[src]

Set the status of this action.

pub fn start(&mut self)[src]

Start performing the action.

pub fn perform_action(&mut self)[src]

Override this with the code necessary to perform the action.

pub fn cancel(&mut self)[src]

Override this with the code necessary to cancel the action.

pub fn finish(&mut self)[src]

Finish performing the action.

Loading content...

Provided methods

pub fn as_action_description(&self) -> Map<String, Value>[src]

Get the action description.

Returns a JSON map describing the action.

Loading content...

Implementors

impl Action for BaseAction[src]

An Action represents an individual action on a thing.

pub fn set_href_prefix(&mut self, prefix: String)[src]

Set the prefix of any hrefs associated with this action.

pub fn get_id(&self) -> String[src]

Get this action's ID.

pub fn get_name(&self) -> String[src]

Get this action's name.

pub fn get_href(&self) -> String[src]

Get this action's href.

pub fn get_status(&self) -> String[src]

Get this action's status.

pub fn get_thing(&self) -> Option<Arc<RwLock<Box<dyn Thing>>>>[src]

Get the thing associated with this action.

pub fn get_time_requested(&self) -> String[src]

Get the time the action was requested.

pub fn get_time_completed(&self) -> Option<String>[src]

Get the time the action was completed.

pub fn get_input(&self) -> Option<Map<String, Value>>[src]

Get the inputs for this action.

pub fn set_status(&mut self, status: String)[src]

Set the status of this action.

pub fn start(&mut self)[src]

Start performing the action.

pub fn perform_action(&mut self)[src]

Override this with the code necessary to perform the action.

pub fn cancel(&mut self)[src]

Override this with the code necessary to cancel the action.

pub fn finish(&mut self)[src]

Finish performing the action.

Loading content...