#[non_exhaustive]pub struct ParamSpec {
pub name: &'static str,
pub kind: ParamKind,
pub sensitive: bool,
pub description: &'static str,
pub file_key: Option<&'static str>,
}Expand description
One parameter a device declares (#125).
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 a change addresses, unique within its group — and the key the startup TOML spells it under, so a bound is written once.
kind: ParamKindWhat values it accepts.
sensitive: boolWrite-only: never read back, published, logged or evented. A PIN, a key. It appears in the schema and never with a value.
description: &'static strOne line for the operator reading the schema cold.
file_key: Option<&'static str>The key the startup file spells it under, when that is not name:
a dotted path into the device’s section (duty_budget.fraction).
The driver reads the file and the device never sees it; this is
how the read-back says a value came from the file (#125).
Implementations§
Source§impl ParamSpec
impl ParamSpec
Sourcepub const fn new(
name: &'static str,
kind: ParamKind,
description: &'static str,
) -> Self
pub const fn new( name: &'static str, kind: ParamKind, description: &'static str, ) -> Self
A parameter of the given kind.
Sourcepub const fn file_key(self, key: &'static str) -> Self
pub const fn file_key(self, key: &'static str) -> Self
The startup file’s key for it, when that is not the name.
Sourcepub fn key_in_file(&self) -> &str
pub fn key_in_file(&self) -> &str
The startup file’s key for it.
Trait Implementations§
impl Eq for ParamSpec
impl StructuralPartialEq for ParamSpec
Auto Trait Implementations§
impl Freeze for ParamSpec
impl RefUnwindSafe for ParamSpec
impl Send for ParamSpec
impl Sync for ParamSpec
impl Unpin for ParamSpec
impl UnsafeUnpin for ParamSpec
impl UnwindSafe for ParamSpec
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