pub struct Message {
pub name: String,
pub body: Node,
}Expand description
One UCI / OMS message: a global element and its body.
Fields§
§name: String§body: NodeImplementations§
Source§impl Message
impl Message
Sourcepub fn violations(&self, schema: &Schema) -> Vec<Violation>
pub fn violations(&self, schema: &Schema) -> Vec<Violation>
Every way this message departs from schema; empty when none.
See validate for what that does and does not cover.
Sourcepub fn from_json(text: &str, schema: &Schema) -> Result<Self, UciError>
pub fn from_json(text: &str, schema: &Schema) -> Result<Self, UciError>
Parses OMS JSON. The root is a single-key object whose key is a
global element. $type selects a concrete type. An undeclared
field is carried as xs:string rather than refused.
§Errors
Returns UciError if the text is not a single-key object, the
element is unknown, a value cannot be mapped, or nesting exceeds
MAX_DEPTH.
Trait Implementations§
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
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