Skip to main content

BinaryTag

Enum BinaryTag 

Source
#[repr(u8)]
pub enum BinaryTag {
Show 20 variants Nil = 0, False = 1, True = 2, Number = 3, Symbol = 4, String = 5, Bytes = 6, List = 7, Vector = 8, Map = 9, Set = 10, Call = 11, Infix = 12, Prefix = 13, Postfix = 14, Block = 15, Quote = 16, Annotated = 17, Extension = 18, Local = 19,
}
Expand description

The one-byte tag that prefixes each node in a frame body.

Each variant selects the Expr shape that follows and fixes its wire layout. The discriminant is the on-wire byte; decoding rejects any byte without a matching variant.

Variants§

§

Nil = 0

The nil value; no payload.

§

False = 1

The boolean false; no payload.

§

True = 2

The boolean true; no payload.

§

Number = 3

A number: a number-domain table index then the canonical text.

§

Symbol = 4

A symbol, given as an index into the symbol table.

§

String = 5

A UTF-8 string, length-prefixed.

§

Bytes = 6

A raw byte blob, length-prefixed.

§

List = 7

A list: a count then that many body nodes.

§

Vector = 8

A vector: a count then that many body nodes.

§

Map = 9

A map: a count then that many canonically ordered key/value node pairs.

§

Set = 10

A set: a count then that many canonically ordered body nodes.

§

Call = 11

A call: an operator node, a count, then that many argument nodes.

§

Infix = 12

An infix application: an operator symbol index then left and right nodes.

§

Prefix = 13

A prefix application: an operator symbol index then the argument node.

§

Postfix = 14

A postfix application: an operator symbol index then the argument node.

§

Block = 15

A block: a count then that many body nodes.

§

Quote = 16

A quote: a quote-mode byte then the quoted node.

§

Annotated = 17

An annotated node: the inner node then a count of symbol/value pairs.

§

Extension = 18

An extension: a tag symbol index then the payload node.

§

Local = 19

A local binding reference, given as an index into the symbol table.

Trait Implementations§

Source§

impl Clone for BinaryTag

Source§

fn clone(&self) -> BinaryTag

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for BinaryTag

Source§

impl Debug for BinaryTag

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for BinaryTag

Source§

impl PartialEq for BinaryTag

Source§

fn eq(&self, other: &BinaryTag) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for BinaryTag

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.