pub struct ParamMeta { /* private fields */ }Expand description
What a ground station shows for one param: its description, unit, where it is grouped, and its valid range. Built from a per-group template:
use stable_flight::params::metadata::ParamMeta;
const LIMITS: ParamMeta = ParamMeta::in_group("Guidance", "Limits");
const TILT: ParamMeta = LIMITS
.param("GUID_TILT_MAX", "Largest tilt waypoint flight may request")
.with_units("deg")
.above(0.0)
.below(90.0);
assert_eq!(TILT.group(), "Limits");
assert!(!TILT.max().expect("bounded").inclusive());Implementations§
Source§impl ParamMeta
impl ParamMeta
Sourcepub const fn in_group(category: &'static str, group: &'static str) -> Self
pub const fn in_group(category: &'static str, group: &'static str) -> Self
A template for the params of one group (e.g. "Rate") within a category (the
component, e.g. "Stabilizer"): no name, unit, or range yet. Name it with
param.
Sourcepub const fn param(self, name: &'static str, description: &'static str) -> Self
pub const fn param(self, name: &'static str, description: &'static str) -> Self
This template as the param name, described by a one-line description.
Sourcepub const fn with_units(self, units: &'static str) -> Self
pub const fn with_units(self, units: &'static str) -> Self
With units as a ground station shows them, e.g. "deg/s"; empty for a dimensionless
param (gains, fractions).
Sourcepub const fn name(&self) -> &'static str
pub const fn name(&self) -> &'static str
The param’s name, as in its ParamTable.
Sourcepub const fn description(&self) -> &'static str
pub const fn description(&self) -> &'static str
One-line description.
Sourcepub const fn category(&self) -> &'static str
pub const fn category(&self) -> &'static str
The component the param belongs to, e.g. "Stabilizer".
Sourcepub const fn group(&self) -> &'static str
pub const fn group(&self) -> &'static str
The loop or feature within the component, e.g. "Rate".
Trait Implementations§
impl Copy for ParamMeta
impl StructuralPartialEq for ParamMeta
Auto Trait Implementations§
impl Freeze for ParamMeta
impl RefUnwindSafe for ParamMeta
impl Send for ParamMeta
impl Sync for ParamMeta
impl Unpin for ParamMeta
impl UnsafeUnpin for ParamMeta
impl UnwindSafe for ParamMeta
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.