pub enum View<'a> {
Builtin(Builtin),
Array(Box<View<'a>>, usize),
Slice(Box<View<'a>>),
Struct(ViewStruct<'a>),
Enum(ViewEnum<'a>),
RecUse(usize),
RecNew(usize, Box<View<'a>>),
}Available on crate feature
schema only.Variants§
Builtin(Builtin)
Array(Box<View<'a>>, usize)
Slice(Box<View<'a>>)
Struct(ViewStruct<'a>)
Enum(ViewEnum<'a>)
RecUse(usize)
RecNew(usize, Box<View<'a>>)
Implementations§
Source§impl View<'_>
impl View<'_>
Sourcepub fn simplify(&self) -> View<'static>
pub fn simplify(&self) -> View<'static>
Simplifies a view preserving wire compatibility.
Performs the following simplifications:
- Remove field names and use empty names for variants
[x; 0]becomes()[x; 1]becomesx[[x; n]; m]becomes[x; n * m][{}; 2+]becomes{}(xs.. (ys..) zs..)becomes(xs.. ys.. zs..)(xs.. {} zs..)becomes{}(xs.. ys.. zs..)becomes(xs.. [y; n] zs..)ifys..isntimesy(x)becomesx{xs.. =t:{} zs..}becomes{xs.. zs..}{xs..}becomes{ys..}whereys..isxs..sorted by tags<n>:x(resp<n>) becomes<k>:x(resp.<k>) withkthe number of recursion binders from the root
pub fn simplify_struct(xs: &ViewStruct<'_>) -> View<'static>
Trait Implementations§
impl<'a> Eq for View<'a>
impl<'a> StructuralPartialEq for View<'a>
Auto Trait Implementations§
impl<'a> Freeze for View<'a>
impl<'a> RefUnwindSafe for View<'a>
impl<'a> Send for View<'a>
impl<'a> Sync for View<'a>
impl<'a> Unpin for View<'a>
impl<'a> UnwindSafe for View<'a>
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