pub struct Schema {
pub ty: String,
pub variants: Vec<Variant>,
}Expand description
The program’s command union, flattened to what a decoder needs.
Fields§
§ty: StringThe union’s name — Command, unless the program named it something else.
variants: Vec<Variant>Implementations§
Source§impl Schema
impl Schema
pub fn of(placed: &Placed) -> Schema
Sourcepub fn of_union(placed: &Placed, name: &str) -> Schema
pub fn of_union(placed: &Placed, name: &str) -> Schema
The same, for any union a client may construct values of.
D30’s gestures need one: a gesture is built by a handler in the page exactly as a command is, so it needs the same resolved decoder — and it needs a separate one, because the two unions are different types and a client that could decode a gesture as a command would have found the write surface §3.5 closes.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Schema
impl<'de> Deserialize<'de> for Schema
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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 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