Struct tfm::pl::ast::Branch

source ·
pub struct Branch<D, E> {
    pub data: D,
    pub data_span: Range<usize>,
    pub children: Vec<E>,
}
Expand description

Value of a branch node in the AST.

A branch node contains a property list and optionally a piece of data. For example, CHARACTER nodes specify a character in the data, and then a property list of Character nodes.

Fields§

§data: D

Data in this branch node.

§data_span: Range<usize>

Span of the data in the property list source code.

§children: Vec<E>

Elements of the property list.

Trait Implementations§

source§

impl<'a, D, E> Arbitrary<'a> for Branch<D, E>where D: Arbitrary<'a>, E: Arbitrary<'a>,

source§

fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>

Generate an arbitrary value of Self from the given unstructured data. Read more
§

fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>

Generate an arbitrary value of Self from the entirety of the given unstructured data. Read more
§

fn size_hint(depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
source§

impl<D: Debug, E: Debug> Debug for Branch<D, E>

source§

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

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

impl<D, E> From<(D, Vec<E, Global>)> for Branch<D, E>

source§

fn from(value: (D, Vec<E>)) -> Self

Converts to this type from the input type.
source§

impl<D: PartialEq, E: PartialEq> PartialEq<Branch<D, E>> for Branch<D, E>

source§

fn eq(&self, other: &Branch<D, E>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<D: Eq, E: Eq> Eq for Branch<D, E>

source§

impl<D, E> StructuralEq for Branch<D, E>

source§

impl<D, E> StructuralPartialEq for Branch<D, E>

Auto Trait Implementations§

§

impl<D, E> RefUnwindSafe for Branch<D, E>where D: RefUnwindSafe, E: RefUnwindSafe,

§

impl<D, E> Send for Branch<D, E>where D: Send, E: Send,

§

impl<D, E> Sync for Branch<D, E>where D: Sync, E: Sync,

§

impl<D, E> Unpin for Branch<D, E>where D: Unpin, E: Unpin,

§

impl<D, E> UnwindSafe for Branch<D, E>where D: UnwindSafe, E: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.