ParserNode

Enum ParserNode 

Source
pub enum ParserNode {
Show 38 variants LexerToken(Token), Ability { ability: Ability, }, AbilityTree { tree: AbilityTree, }, Condition { condition: Condition, }, ContinuousEffect { effect: ContinuousEffect, }, Colors { colors: Colors, }, Cost { cost: Cost, }, CostModification { cost_modification: CostModification, }, CostModificationEffect { cost_modification: CostModificationEffect, }, CountSpecifier { count: CountSpecifier, }, CreatedTokenKind { kind: CreatedTokenKind, }, CreatureAction { action: CreatureAction, }, CreatureSubtypeList { list: ArrayVec<CreatureSubtype, 24>, }, Event { event: Event, }, EventReplacement { replacement: EventReplacement, }, EventSource { source: EventSource, }, EventSourceReference { source: EventSourceReference, }, ExileFollowUp { follow_up: ExileFollowUp, }, Imperative { imperative: Imperative, }, ImperativeList { imperatives: ImperativeList, }, ImperativeChoices { choices: HeapArrayVec<SpellAbility, 23>, }, KeywordAbility { ability: KeywordAbility, }, ManaCost { mana_cost: ManaCost, }, Number { number: Number, }, ObjectReference { reference: ObjectReference, }, ObjectSpecifier { specifier: ObjectSpecifier, }, ObjectSpecifiers { specifiers: ObjectSpecifiers, }, Player { player: PlayerSpecifier, }, PlayerAction { action: PlayerAction, }, PreviouslyMentionnedObject { object: PreviouslyMentionnedObject, }, PutCounterKind { kind: CounterKind, }, SpellAbility { ability: SpellAbility, }, Statement { statement: Statement, }, StaticAbilityKind { kind: StaticAbilityKind, }, TokenDefinition { token: TokenLayout, }, TriggerCondition { condition: TriggerCondition, }, AbilityKind { ability: AbilityKind, }, ZoneReference { zone: ZoneReference, },
}
Expand description

Since this can carry entire ability trees, we need to box the biggest variants. Otherwise, this can easily blow up the stack when attempting to store multiple of them. Current size is 112 bytes, let’s try to keep it around here ?

Variants§

§

LexerToken(Token)

§

Ability

Fields

§ability: Ability
§

AbilityTree

Fields

§

Condition

Fields

§condition: Condition
§

ContinuousEffect

Fields

§

Colors

Fields

§colors: Colors
§

Cost

Fields

§cost: Cost
§

CostModification

Fields

§cost_modification: CostModification
§

CostModificationEffect

Fields

§cost_modification: CostModificationEffect
§

CountSpecifier

Fields

§

CreatedTokenKind

Fields

§

CreatureAction

Fields

§

CreatureSubtypeList

Fields

§

Event

Fields

§event: Event
§

EventReplacement

Fields

§replacement: EventReplacement
§

EventSource

Fields

§

EventSourceReference

§

ExileFollowUp

Fields

§follow_up: ExileFollowUp
§

Imperative

Fields

§imperative: Imperative
§

ImperativeList

Fields

§imperatives: ImperativeList
§

ImperativeChoices

Fields

§

KeywordAbility

Fields

§

ManaCost

Fields

§mana_cost: ManaCost
§

Number

Fields

§number: Number
§

ObjectReference

Fields

§

ObjectSpecifier

Fields

§

ObjectSpecifiers

Fields

§specifiers: ObjectSpecifiers
§

Player

Fields

§

PlayerAction

Fields

§

PreviouslyMentionnedObject

§

PutCounterKind

Fields

§

SpellAbility

Fields

§

Statement

Fields

§statement: Statement
§

StaticAbilityKind

§

TokenDefinition

Fields

§

TriggerCondition

Fields

§

AbilityKind

Fields

§ability: AbilityKind
§

ZoneReference

Fields

Trait Implementations§

Source§

impl Clone for ParserNode

Source§

fn clone(&self) -> ParserNode

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ParserNode

Source§

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

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

impl From<Token> for ParserNode

Source§

fn from(token: Token) -> Self

Converts to this type from the input type.
Source§

impl Idris for ParserNode

Source§

const COUNT: usize

Source§

fn id(&self) -> usize

Source§

fn name_from_id(id: usize) -> &'static str

Source§

impl PartialEq for ParserNode

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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 Eq for ParserNode

Source§

impl StructuralPartialEq for ParserNode

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.