Skip to main content

Stored

Enum Stored 

Source
pub enum Stored {
Show 44 variants None, Bool(bool), String(SymStr), Charcode(u16), Int(i64), Node(Node), Chars(Box<[char]>), Fontmap(Rc<[Option<char>]>), Strings(Rc<[SymStr]>), VecDigested(Vec<Digested>), Stash(StashTable), HashString(FxHashMap<String, String>), VecDequeStored(VecDeque<Stored>), HashStored(SymHashMap<Stored>), HashTagData(FxHashMap<String, Vec<TagData>>), FrontmatterRaw(Vec<RawFrontmatter>), Catcode(Catcode), Token(Token), Tokens(Tokens), Number(Number), Float(Float), Glue(Glue), MuGlue(MuGlue), Dimension(Dimension), MuDimension(MuDimension), Locator(Box<Locator>), Rewrite(Box<Rewrite>), Ligature(Box<Ligature>), Reversion(Reversion), Register(Rc<Register>), Expandable(Rc<Expandable>), Conditional(Rc<Conditional>), Primitive(Rc<Primitive>), MathPrimitive(Rc<MathPrimitive>), Constructor(Rc<Constructor>), Digested(Digested), Parameter(Rc<Parameter>), Font(Rc<Font>), FontDirective(FontDirective), Mouth(Rc<RefCell<Mouth>>), IfFrame(Rc<RefCell<IfFrame>>), KeyVal(KeyVal), KeyVals(Rc<KeyVals>), Template(Rc<Template>),
}
Expand description

The original global state (in Perl) allowed arbitrary values. To stay consistent, we create an extremely permissive struct that affords all essential kinds of values that appear essential.

Variants§

§

None

if we want to keep a key but make it ‘undef’, set it to None

§

Bool(bool)

atomic data (Copy)

§

String(SymStr)

atomic data (Clone)

§

Charcode(u16)

atomic data (Copy)

§

Int(i64)

atomic data (Copy) note that we currently work with 64-bit integers

§

Node(Node)

atomic data (Clone)

§

Chars(Box<[char]>)

boxed char

§

Fontmap(Rc<[Option<char>]>)

boxed [Option<char>]

§

Strings(Rc<[SymStr]>)

boxed collection

§

VecDigested(Vec<Digested>)

boxed collection (latexml)

§

Stash(StashTable)

the heart of state - a stored Stash table

§

HashString(FxHashMap<String, String>)

boxed map

§

VecDequeStored(VecDeque<Stored>)

boxed collection - Stored

§

HashStored(SymHashMap<Stored>)

boxed map - Stored

§

HashTagData(FxHashMap<String, Vec<TagData>>)

boxed map (latexml)

§

FrontmatterRaw(Vec<RawFrontmatter>)

queued-but-undigested frontmatter commands (Perl: frontmatter_raw)

§

Catcode(Catcode)

latexml object

§

Token(Token)

latexml object

§

Tokens(Tokens)

latexml object

§

Number(Number)

latexml object

§

Float(Float)

latexml object

§

Glue(Glue)

latexml object

§

MuGlue(MuGlue)

latexml object

§

Dimension(Dimension)

latexml object

§

MuDimension(MuDimension)

latexml object

§

Locator(Box<Locator>)

metadata object

§

Rewrite(Box<Rewrite>)

latexml object

§

Ligature(Box<Ligature>)

latexml object

§

Reversion(Reversion)

latexml object

§

Register(Rc<Register>)

latexml object (Rc-wrapped)

§

Expandable(Rc<Expandable>)

latexml object (Rc-wrapped)

§

Conditional(Rc<Conditional>)

latexml object (Rc-wrapped)

§

Primitive(Rc<Primitive>)

latexml object (Rc-wrapped)

§

MathPrimitive(Rc<MathPrimitive>)

latexml object (Rc-wrapped)

§

Constructor(Rc<Constructor>)

latexml object (Rc-wrapped)

§

Digested(Digested)

latexml object (Rc-wrapped from within)

§

Parameter(Rc<Parameter>)

latexml object (Rc-wrapped)

§

Font(Rc<Font>)

latexml object (Rc-wrapped)

§

FontDirective(FontDirective)

a stored FontDirective (Font or closure building a Font)

§

Mouth(Rc<RefCell<Mouth>>)

WALL OF SHAME (interior mutability) – can we dispense with these?

§

IfFrame(Rc<RefCell<IfFrame>>)

WALL OF SHAME (interior mutability) – can we dispense with these?

§

KeyVal(KeyVal)

latexml keyval definition

§

KeyVals(Rc<KeyVals>)

latexml keyvals collection

§

Template(Rc<Template>)

alignment template (for storing between macros, e.g. deluxetable)

Implementations§

Source§

impl Stored

Source

pub fn eq_text(&self, target: &str) -> bool

Zero-alloc equivalent of self.to_string() == target for the two string-carrying variants (String, Tokens). Falls back to to_string() for everything else, where the Display impl allocates anyway.

Source

pub fn is_list(&self) -> bool

A list-shaped value: exposed to the Rhai LookupValue binding as an array (mirroring Perl’s LookupValue returning an arrayref), and having no scalar string form — so lookup_string returns “” for it rather than leaking the internal Debug repr (#315). The two variants a push_value / list AssignValue can produce: VecDequeStored (a pushed queue, e.g. class_options) and Strings (an immutable string array).

Source

pub fn list_items(&self) -> Option<Vec<String>>

The items of a list value as strings, for structural access. None for a non-list value.

Source

pub fn starts_with_text(&self, prefix: &str) -> bool

Zero-alloc self.to_string().starts_with(prefix) for the string-carrying variants; falls back to to_string() for others.

Source

pub fn ends_with_text(&self, suffix: &str) -> bool

Zero-alloc self.to_string().ends_with(suffix) for the String / Token variants (where the entire Display output equals the interned text). For Tokens, we still walk into a small owned String — ends_with requires anchoring at the tail and rolling backward, which needs random access. Others fall back to to_string() (cost paid anyway via the Display impl).

Source

pub fn cast_to_string_hash( in_map: &SymHashMap<Stored>, ) -> HashMap<String, String>

helper method that uses ToString::to_string to flatten a map with Stored values

Source

pub fn read_arguments(&self) -> Result<Vec<ArgWrap>>

Dynamic dispatch for Definition’s read_arguments, to circumvent the limitations of using trait objects with Rc<Definition>

Source

pub fn to_attribute(&self) -> String

Uses NumericOps::to_attribute for Stored values supporting it, otherwise ToString::to_string

Source

pub fn to_definition(&self) -> Option<Rc<dyn Definition>>

Trait Implementations§

Source§

impl Clone for Stored

Source§

fn clone(&self) -> Stored

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 Debug for Stored

Source§

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

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

impl Default for Stored

Source§

fn default() -> Stored

Returns the “default value” for a type. Read more
Source§

impl Display for Stored

Source§

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

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

impl<'a, 'b> From<&'a &'b Stored> for Option<Digested>

Source§

fn from(value: &'a &'b Stored) -> Option<Digested>

Converts to this type from the input type.
Source§

impl<'a> From<&'a Stored> for Option<&'a VecDeque<Stored>>

Source§

fn from(value: &'a Stored) -> Option<&'a VecDeque<Stored>>

Converts to this type from the input type.
Source§

impl<'a> From<&'a Stored> for Option<Rc<Font>>

Source§

fn from(value: &'a Stored) -> Option<Rc<Font>>

Converts to this type from the input type.
Source§

impl<'a> From<&'a Stored> for Option<Number>

Source§

fn from(value: &'a Stored) -> Option<Number>

Converts to this type from the input type.
Source§

impl<'a> From<&'a Stored> for Option<Float>

Source§

fn from(value: &'a Stored) -> Option<Float>

Converts to this type from the input type.
Source§

impl<'a> From<&'a Stored> for Option<Dimension>

Source§

fn from(value: &'a Stored) -> Option<Dimension>

Converts to this type from the input type.
Source§

impl<'a> From<&'a Stored> for Option<Glue>

Source§

fn from(value: &'a Stored) -> Option<Glue>

Converts to this type from the input type.
Source§

impl<'a> From<&'a Stored> for Option<Rc<Register>>

Source§

fn from(value: &'a Stored) -> Option<Rc<Register>>

Converts to this type from the input type.
Source§

impl<'a> From<&'a Stored> for Option<Catcode>

Source§

fn from(value: &'a Stored) -> Option<Catcode>

Converts to this type from the input type.
Source§

impl<'a> From<&'a Stored> for Option<&'a [char]>

Source§

fn from(value: &'a Stored) -> Option<&'a [char]>

Converts to this type from the input type.
Source§

impl<'a> From<&'a Stored> for Option<RegisterValue>

Source§

fn from(value: &'a Stored) -> Option<RegisterValue>

Converts to this type from the input type.
Source§

impl<'a> From<&'a Stored> for Option<Digested>

Source§

fn from(value: &'a Stored) -> Option<Digested>

Converts to this type from the input type.
Source§

impl<'a> From<&'a Stored> for Token

Source§

fn from(value: &'a Stored) -> Token

Converts to this type from the input type.
Source§

impl<'a> From<&'a String> for Stored

Source§

fn from(value: &'a String) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a Token> for Stored

Source§

fn from(value: &'a Token) -> Self

Converts to this type from the input type.
Source§

impl From<&'static str> for Stored

Source§

fn from(value: &'static str) -> Self

Converts to this type from the input type.
Source§

impl From<&Digested> for Stored

Source§

fn from(value: &Digested) -> Self

Converts to this type from the input type.
Source§

impl From<&Stored> for bool

Source§

fn from(value: &Stored) -> bool

Converts to this type from the input type.
Source§

impl From<&Stored> for String

Source§

fn from(value: &Stored) -> String

Converts to this type from the input type.
Source§

impl From<&Stored> for Option<Rc<[Option<char>]>>

Source§

fn from(value: &Stored) -> Option<Rc<[Option<char>]>>

Converts to this type from the input type.
Source§

impl From<Alignment> for Stored

Source§

fn from(a: Alignment) -> Self

Converts to this type from the input type.
Source§

impl From<Box<Digested>> for Stored

Source§

fn from(value: Box<Digested>) -> Self

Converts to this type from the input type.
Source§

impl From<Box<[char]>> for Stored

Source§

fn from(value: Box<[char]>) -> Self

Converts to this type from the input type.
Source§

impl From<Catcode> for Stored

Source§

fn from(value: Catcode) -> Self

Converts to this type from the input type.
Source§

impl From<Conditional> for Stored

Source§

fn from(value: Conditional) -> Self

Converts to this type from the input type.
Source§

impl From<Constructor> for Stored

Source§

fn from(value: Constructor) -> Self

Converts to this type from the input type.
Source§

impl From<Cow<'_, Font>> for Stored

Source§

fn from(value: Cow<'_, Font>) -> Self

Converts to this type from the input type.
Source§

impl From<Cow<'_, str>> for Stored

Source§

fn from(value: Cow<'_, str>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Cow<'a, Digested>> for Stored

Source§

fn from(value: Cow<'a, Digested>) -> Self

Converts to this type from the input type.
Source§

impl From<Digested> for Stored

Source§

fn from(value: Digested) -> Self

Converts to this type from the input type.
Source§

impl From<Dimension> for Stored

Source§

fn from(value: Dimension) -> Self

Converts to this type from the input type.
Source§

impl From<Expandable> for Stored

Storing all definitions is expected - Expandable case

Source§

fn from(definition: Expandable) -> Self

Converts to this type from the input type.
Source§

impl From<Float> for Stored

Source§

fn from(value: Float) -> Self

Converts to this type from the input type.
Source§

impl From<Font> for Stored

Source§

fn from(value: Font) -> Self

Converts to this type from the input type.
Source§

impl From<Glue> for Stored

Source§

fn from(value: Glue) -> Self

Converts to this type from the input type.
Source§

impl From<HashMap<String, Stored, FxBuildHasher>> for Stored

Source§

fn from(str_hash: HashMap<String, Stored>) -> Self

Converts to this type from the input type.
Source§

impl From<HashMap<String, String, FxBuildHasher>> for Stored

Source§

fn from(value: HashMap<String, String>) -> Self

Converts to this type from the input type.
Source§

impl From<HashMap<String, Vec<TagData>, FxBuildHasher>> for Stored

Source§

fn from(value: HashMap<String, Vec<TagData>>) -> Self

Converts to this type from the input type.
Source§

impl From<HashMap<SymbolU32, Stored, FxBuildHasher>> for Stored

Source§

fn from(value: HashMap<SymStr, Stored>) -> Self

Converts to this type from the input type.
Source§

impl From<KeyVal> for Stored

Source§

fn from(kv: KeyVal) -> Stored

Converts to this type from the input type.
Source§

impl From<KeyVals> for Stored

Source§

fn from(kvs: KeyVals) -> Stored

Converts to this type from the input type.
Source§

impl From<Ligature> for Stored

Source§

fn from(lig: Ligature) -> Stored

Converts to this type from the input type.
Source§

impl From<List> for Stored

Source§

fn from(value: List) -> Self

Converts to this type from the input type.
Source§

impl From<Locator> for Stored

Source§

fn from(value: Locator) -> Self

Converts to this type from the input type.
Source§

impl From<MathPrimitive> for Stored

Source§

fn from(value: MathPrimitive) -> Self

Converts to this type from the input type.
Source§

impl From<Mouth> for Stored

Source§

fn from(value: Mouth) -> Self

Converts to this type from the input type.
Source§

impl From<MuDimension> for Stored

Source§

fn from(value: MuDimension) -> Self

Converts to this type from the input type.
Source§

impl From<MuGlue> for Stored

Source§

fn from(value: MuGlue) -> Self

Converts to this type from the input type.
Source§

impl From<Node> for Stored

Source§

fn from(value: Node) -> Self

Converts to this type from the input type.
Source§

impl From<Number> for Stored

Source§

fn from(value: Number) -> Self

Converts to this type from the input type.
Source§

impl From<Option<&Stored>> for Stored

Source§

fn from(stored_opt: Option<&Stored>) -> Stored

Converts to this type from the input type.
Source§

impl<T> From<Option<T>> for Stored
where T: Into<Stored> + Sized,

Source§

fn from(value_opt: Option<T>) -> Self

Converts to this type from the input type.
Source§

impl From<Parameter> for Stored

Source§

fn from(value: Parameter) -> Self

Converts to this type from the input type.
Source§

impl From<Primitive> for Stored

Source§

fn from(value: Primitive) -> Self

Converts to this type from the input type.
Source§

impl From<Rc<Conditional>> for Stored

Source§

fn from(definition: Rc<Conditional>) -> Self

Converts to this type from the input type.
Source§

impl From<Rc<Constructor>> for Stored

Source§

fn from(definition: Rc<Constructor>) -> Self

Converts to this type from the input type.
Source§

impl From<Rc<Expandable>> for Stored

Source§

fn from(definition: Rc<Expandable>) -> Self

Converts to this type from the input type.
Source§

impl From<Rc<Font>> for Stored

Source§

fn from(font: Rc<Font>) -> Self

Converts to this type from the input type.
Source§

impl From<Rc<MathPrimitive>> for Stored

Source§

fn from(definition: Rc<MathPrimitive>) -> Self

Converts to this type from the input type.
Source§

impl From<Rc<Primitive>> for Stored

Source§

fn from(definition: Rc<Primitive>) -> Self

Converts to this type from the input type.
Source§

impl From<Rc<RefCell<IfFrame>>> for Stored

Source§

fn from(frame: Rc<RefCell<IfFrame>>) -> Stored

Converts to this type from the input type.
Source§

impl From<Rc<Register>> for Stored

Source§

fn from(register: Rc<Register>) -> Self

Converts to this type from the input type.
Source§

impl From<Rc<[Option<char>]>> for Stored

Source§

fn from(value: Rc<[Option<char>]>) -> Self

Converts to this type from the input type.
Source§

impl From<Rc<[SymbolU32]>> for Stored

Source§

fn from(value: Rc<[SymStr]>) -> Self

Converts to this type from the input type.
Source§

impl From<Register> for Stored

Source§

fn from(register: Register) -> Self

Converts to this type from the input type.
Source§

impl From<RegisterValue> for Stored

Source§

fn from(rv: RegisterValue) -> Self

Converts to this type from the input type.
Source§

impl From<Reversion> for Stored

Source§

fn from(rev: Reversion) -> Stored

Converts to this type from the input type.
Source§

impl From<Rewrite> for Stored

Source§

fn from(value: Rewrite) -> Self

Converts to this type from the input type.
Source§

impl From<Stored> for Option<Tokens>

Source§

fn from(value: Stored) -> Option<Tokens>

Converts to this type from the input type.
Source§

impl From<Stored> for Option<Rc<[Option<char>]>>

Source§

fn from(value: Stored) -> Option<Rc<[Option<char>]>>

Converts to this type from the input type.
Source§

impl From<Stored> for Option<Digested>

Source§

fn from(value: Stored) -> Option<Digested>

Converts to this type from the input type.
Source§

impl From<Stored> for Result<ArgWrap>

Source§

fn from(t: Stored) -> Result<ArgWrap>

Converts to this type from the input type.
Source§

impl From<String> for Stored

Source§

fn from(value: String) -> Self

Converts to this type from the input type.
Source§

impl From<SymHashMap<Stored>> for Stored

Source§

fn from(value: SymHashMap<Stored>) -> Self

Converts to this type from the input type.
Source§

impl From<SymbolU32> for Stored

Source§

fn from(value: SymStr) -> Self

Converts to this type from the input type.
Source§

impl From<Template> for Stored

Source§

fn from(t: Template) -> Stored

Converts to this type from the input type.
Source§

impl From<Token> for Stored

Source§

fn from(value: Token) -> Self

Converts to this type from the input type.
Source§

impl From<Tokens> for Stored

Source§

fn from(value: Tokens) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Vec<&'a str>> for Stored

Source§

fn from(value: Vec<&'a str>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<Digested>> for Stored

Source§

fn from(value: Vec<Digested>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<String>> for Stored

Source§

fn from(value: Vec<String>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<Token>> for Stored

Source§

fn from(value: Vec<Token>) -> Self

Converts to this type from the input type.
Source§

impl From<VecDeque<Stored>> for Stored

Source§

fn from(value: VecDeque<Stored>) -> Self

Converts to this type from the input type.
Source§

impl From<bool> for Stored

Source§

fn from(value: bool) -> Self

Converts to this type from the input type.
Source§

impl From<bool> for &Stored

Source§

fn from(value: bool) -> Self

Converts to this type from the input type.
Source§

impl From<char> for Stored

Source§

fn from(value: char) -> Self

Converts to this type from the input type.
Source§

impl From<f64> for Stored

Source§

fn from(value: f64) -> Self

Converts to this type from the input type.
Source§

impl From<i32> for Stored

Source§

fn from(value: i32) -> Self

Converts to this type from the input type.
Source§

impl From<i64> for Stored

Source§

fn from(value: i64) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for Stored

Source§

fn from(value: u8) -> Self

Converts to this type from the input type.
Source§

impl From<usize> for Stored

Source§

fn from(value: usize) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Stored

Note: PartialEq on Stored is structural. See WISDOM.md for RegisterType trap.

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl Send for Stored

Source§

impl Sync for Stored

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.