#[non_exhaustive]pub struct ActionSpec {
pub name: &'static str,
pub description: &'static str,
pub arguments: Vec<ParamSpec>,
pub cost: CostModel,
}Expand description
One action a device offers (#129).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: &'static strThe name the key spells: device/{device}/action/{name}.
description: &'static strOne line for the operator reading the list cold.
arguments: Vec<ParamSpec>Its arguments, with the configuration plane’s kinds (#125).
cost: CostModelWhat it costs.
Implementations§
Source§impl ActionSpec
impl ActionSpec
Sourcepub const fn new(
name: &'static str,
description: &'static str,
cost: CostModel,
) -> Self
pub const fn new( name: &'static str, description: &'static str, cost: CostModel, ) -> Self
An action with no arguments; add them with with.
Sourcepub fn check(
&self,
arguments: &BTreeMap<String, ConfigValue>,
) -> Result<(), ActionError>
pub fn check( &self, arguments: &BTreeMap<String, ConfigValue>, ) -> Result<(), ActionError>
Whether arguments are ones this action takes: every name declared,
every value of its kind and within its bounds, the bound named.
Trait Implementations§
Source§impl Clone for ActionSpec
impl Clone for ActionSpec
Source§impl Debug for ActionSpec
impl Debug for ActionSpec
impl Eq for ActionSpec
Source§impl PartialEq for ActionSpec
impl PartialEq for ActionSpec
impl StructuralPartialEq for ActionSpec
Auto Trait Implementations§
impl Freeze for ActionSpec
impl RefUnwindSafe for ActionSpec
impl Send for ActionSpec
impl Sync for ActionSpec
impl Unpin for ActionSpec
impl UnsafeUnpin for ActionSpec
impl UnwindSafe for ActionSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more