pub struct Topic {
pub name: &'static str,
pub prefix: &'static str,
pub gate: fn(&Context) -> bool,
pub keys: fn(&Context) -> Vec<u32>,
pub render: fn(&PropSet, &Context) -> Vec<(String, String)>,
pub env: fn(&PropSet, &Context) -> Vec<(String, String)>,
}Expand description
One subject the device can be asked about.
Fields§
§name: &'static strWhat to type after info.
prefix: &'static strWhat --env prefixes this topic’s variables with.
gate: fn(&Context) -> boolWhether this device has anything to say on the subject.
keys: fn(&Context) -> Vec<u32>The properties the renderers below read.
render: fn(&PropSet, &Context) -> Vec<(String, String)>§env: fn(&PropSet, &Context) -> Vec<(String, String)>NAME=VALUE pairs, unprefixed — the caller adds Self::prefix.
A component the device did not report is an absent variable
rather than an empty one, so ${RADIO_SF:-} is how a script asks
whether there is a spreading factor at all.
Auto Trait Implementations§
impl Freeze for Topic
impl RefUnwindSafe for Topic
impl Send for Topic
impl Sync for Topic
impl Unpin for Topic
impl UnwindSafe for Topic
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more