#[non_exhaustive]pub struct Schema {
pub groups: Vec<ConfigGroup>,
}Expand description
A device’s configuration schema: its groups (#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.groups: Vec<ConfigGroup>The groups, in the order the device lists them.
Implementations§
Source§impl Schema
impl Schema
Sourcepub fn with(self, group: ConfigGroup) -> Self
pub fn with(self, group: ConfigGroup) -> Self
Builder form of pushing a group.
Sourcepub fn group(&self, name: &str) -> Option<&ConfigGroup>
pub fn group(&self, name: &str) -> Option<&ConfigGroup>
One group by name.
Sourcepub fn check(
&self,
group: &str,
name: &str,
value: &ConfigValue,
) -> Result<(), ConfigError>
pub fn check( &self, group: &str, name: &str, value: &ConfigValue, ) -> Result<(), ConfigError>
Whether value is one group/name accepts: the kind, and the bounds
— with the bound named, which is what a startup value that fails at
start reports (#125, completing #114).
Trait Implementations§
impl Eq for Schema
impl StructuralPartialEq for Schema
Auto Trait Implementations§
impl Freeze for Schema
impl RefUnwindSafe for Schema
impl Send for Schema
impl Sync for Schema
impl Unpin for Schema
impl UnsafeUnpin for Schema
impl UnwindSafe for Schema
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