pub struct Patch<A>(pub A);Expand description
A shape whose members may all be absent, under a name of its own.
What a caller sends to change part of a value: the same shape, with nothing required. The name moves with it, so the patch and the whole can be told apart wherever both are declared.
Tuple Fields§
§0: ATrait Implementations§
impl<A: Copy> Copy for Patch<A>
Source§impl<A> ShapeAlg for Patch<A>where
A: ShapeAlg,
impl<A> ShapeAlg for Patch<A>where
A: ShapeAlg,
Source§fn literal(&self, text: &str) -> A::Ty
fn literal(&self, text: &str) -> A::Ty
One fixed piece of text, as a value: content that happens to be constant.
Source§fn name_word(&self, words: Words<'_>) -> A::Ty
fn name_word(&self, words: Words<'_>) -> A::Ty
A value whose content is a name, spelled however the interpretation spells names. Read more
Source§fn hex(&self, item: A::Ty) -> A::Ty
fn hex(&self, item: A::Ty) -> A::Ty
Written as
0x-prefixed hexadecimal, rather than however the item would appear alone.Source§fn decimal(&self, item: A::Ty) -> A::Ty
fn decimal(&self, item: A::Ty) -> A::Ty
Written as decimal digits in text, which is what a width beyond a JSON number requires.
Source§fn choice(&self, alternatives: Vec<A::Ty>) -> A::Ty
fn choice(&self, alternatives: Vec<A::Ty>) -> A::Ty
A choice between alternatives, carrying no discriminant of its own. Read more
Auto Trait Implementations§
impl<A> Freeze for Patch<A>where
A: Freeze,
impl<A> RefUnwindSafe for Patch<A>where
A: RefUnwindSafe,
impl<A> Send for Patch<A>where
A: Send,
impl<A> Sync for Patch<A>where
A: Sync,
impl<A> Unpin for Patch<A>where
A: Unpin,
impl<A> UnsafeUnpin for Patch<A>where
A: UnsafeUnpin,
impl<A> UnwindSafe for Patch<A>where
A: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<This> ShapeDeclareExt<This> for This
impl<This> ShapeDeclareExt<This> for This
Source§impl<This> ShapeExt<This> for Thiswhere
This: ShapeAlg,
impl<This> ShapeExt<This> for Thiswhere
This: ShapeAlg,
Source§fn bytes_array(&self) -> <This as Sorts>::Ty
fn bytes_array(&self) -> <This as Sorts>::Ty
Bytes written as an array of JSON numbers, which is a sequence of octets and nothing more.
Source§fn int_decimal(&self, signed: bool, bits: u16) -> <This as Sorts>::Ty
fn int_decimal(&self, signed: bool, bits: u16) -> <This as Sorts>::Ty
An integer written as decimal digits, for a width a JSON number cannot hold.
Source§fn int_hex(&self, signed: bool, bits: u16) -> <This as Sorts>::Ty
fn int_hex(&self, signed: bool, bits: u16) -> <This as Sorts>::Ty
An integer written as a 0x quantity, as the Ethereum JSON-RPC specification states one.
Source§fn named_product(
&self,
words: &[&str],
fields: Vec<<This as Sorts>::Field>,
) -> <This as Sorts>::Ty
fn named_product( &self, words: &[&str], fields: Vec<<This as Sorts>::Field>, ) -> <This as Sorts>::Ty
A named product: the shape most types have.
Source§impl<This> ShapeProgramExt<This> for This
impl<This> ShapeProgramExt<This> for This
Source§fn compile_shape<Program>(
&self,
program: Program,
) -> <Program as ShapeProgramAlg<This>>::Tywhere
Program: ShapeProgramAlg<This>,
fn compile_shape<Program>(
&self,
program: Program,
) -> <Program as ShapeProgramAlg<This>>::Tywhere
Program: ShapeProgramAlg<This>,
Folds a declaration with this interpretation.
Source§impl<This> ShapeTaggedExt<This> for This
impl<This> ShapeTaggedExt<This> for This
Source§fn sum_external<'w>(
&self,
alternatives: Vec<(&'w [&'w str], <This as Sorts>::Ty)>,
) -> <This as Sorts>::Ty
fn sum_external<'w>( &self, alternatives: Vec<(&'w [&'w str], <This as Sorts>::Ty)>, ) -> <This as Sorts>::Ty
A choice written as one object per alternative, keyed by its name.