[−][src]Struct webthing::action::BaseAction
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]
id: String,
name: String,
input: Option<Map<String, Value>>,
thing: Weak<RwLock<Box<dyn Thing>>>
) -> Self
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.
pub fn as_action_description(&self) -> Map<String, Value>
[src]
Auto Trait Implementations
impl RefUnwindSafe for BaseAction
[src]
impl Send for BaseAction
[src]
impl Sync for BaseAction
[src]
impl Unpin for BaseAction
[src]
impl UnwindSafe for BaseAction
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Erased for T
impl<T> From<T> for T
[src]
impl<T> GetTypeId for T where
T: Any,
[src]
T: Any,
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,