[][src]Struct webthing::action::BaseAction

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.

Implementations

impl BaseAction[src]

pub fn new(
    id: String,
    name: String,
    input: Option<Map<String, Value>>,
    thing: Weak<RwLock<Box<dyn Thing>>>
) -> Self
[src]

Create a new BaseAction.

Trait Implementations

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.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Erased for T

impl<T> From<T> for T[src]

impl<T> GetTypeId for T where
    T: Any
[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,