pub enum Body {
Record(Vec<Field>),
Enum(Vec<Constructor>),
Newtype(Term),
Host,
Nondata,
}Expand description
What a template declares.
Variants§
Record(Vec<Field>)
A record of these fields.
Enum(Vec<Constructor>)
An enum of these constructors.
Newtype(Term)
A newtype over this base.
Host
A host type.
Nondata
A type that is not data.
Trait Implementations§
impl Eq for Body
Source§impl Keyed for Body
impl Keyed for Body
Source§fn payload<'a>(&'a self, parts: &mut Vec<&'a dyn AnyWire>)
fn payload<'a>(&'a self, parts: &mut Vec<&'a dyn AnyWire>)
Pushes its payload’s parts to
parts, in the order they are
written, without its constructor’s number.Source§fn open_payload(number: u64, at: usize) -> Result<Opened, DecodeError>
fn open_payload(number: u64, at: usize) -> Result<Opened, DecodeError>
Source§fn payload_bytes(&self) -> Vec<u8> ⓘ
fn payload_bytes(&self) -> Vec<u8> ⓘ
Its payload’s bytes.
Source§fn decode_payload(number: u64, bytes: &[u8]) -> Result<Self, DecodeError>
fn decode_payload(number: u64, bytes: &[u8]) -> Result<Self, DecodeError>
The one value of the constructor written with
number whose
payload bytes hold, and nothing else. Read moreSource§impl Shaped for Body
impl Shaped for Body
Source§fn write_at(
&self,
catalog: &mut ValueWriter<'_, '_>,
ty: &Type,
) -> Result<(), EncodeError>
fn write_at( &self, catalog: &mut ValueWriter<'_, '_>, ty: &Type, ) -> Result<(), EncodeError>
Source§fn read_at(
catalog: &mut ValueReader<'_, '_, '_>,
ty: &Type,
) -> Result<Self, DecodeError>
fn read_at( catalog: &mut ValueReader<'_, '_, '_>, ty: &Type, ) -> Result<Self, DecodeError>
impl StructuralPartialEq for Body
Source§impl Wire for Body
impl Wire for Body
Source§fn write_head<'a>(&'a self, out: &mut Vec<u8>, parts: &mut Vec<&'a dyn AnyWire>)
fn write_head<'a>(&'a self, out: &mut Vec<u8>, parts: &mut Vec<&'a dyn AnyWire>)
Appends the bytes it writes before its parts to
out, and pushes
its parts to parts in the order they are written after them.Source§fn open(reader: &mut Reader<'_>) -> Result<Opened, DecodeError>
fn open(reader: &mut Reader<'_>) -> Result<Opened, DecodeError>
Reads its head at
reader: the value itself when it has no parts,
else its parts to read and what joins them. Read moreSource§fn write(&self, out: &mut Vec<u8>)
fn write(&self, out: &mut Vec<u8>)
Appends its bytes to
out: its head, and then each part’s bytes in
order, written over a stack on the heap, so a value nested however
deep is written on a native stack of fixed size.Auto Trait Implementations§
impl Forget for Body
impl Freeze for Bodywhere
*const u8 is !null: Freeze,
PhantomData<Field>: Freeze,
PhantomData<Constructor>: Freeze,
*const Term is !null: Freeze,
PhantomData<Term>: Freeze,
PhantomData<u64>: Freeze,
impl Move for Body
impl RefUnwindSafe for Body
impl Send for Body
impl Sync for Body
impl Unpin for Body
impl UnsafeUnpin for Bodywhere
*const u8 is !null: UnsafeUnpin,
PhantomData<Field>: UnsafeUnpin,
PhantomData<Constructor>: UnsafeUnpin,
*const Term is !null: UnsafeUnpin,
PhantomData<Term>: UnsafeUnpin,
PhantomData<u64>: UnsafeUnpin,
impl UnwindSafe for Body
Blanket Implementations§
Source§impl<T> AnyWire for Twhere
T: Wire,
impl<T> AnyWire for Twhere
T: Wire,
Source§fn write_head<'a>(&'a self, out: &mut Vec<u8>, parts: &mut Vec<&'a dyn AnyWire>)
fn write_head<'a>(&'a self, out: &mut Vec<u8>, parts: &mut Vec<&'a dyn AnyWire>)
As
Wire::write_head.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