Struct texlang::types::MathCode

source ·
pub struct MathCode(pub u16);
Expand description

A math code.

The inner value is in the range [0, 32768).

See chapter 17 of the TeXBook for information on this type. The TeXBook presents an interpretation of the inner value. For example, the highest 3 bits represent the “class” of the math character. From Texlang’s perspective, however, a math character is just a regular integer and such interpretations are scoped to algorithms that consumes math characters.

Tuple Fields§

§0: u16

Implementations§

source§

impl MathCode

source

pub const MAX: usize = 32_767usize

The maximum value of the inner value. This is 2^15-1.

Trait Implementations§

source§

impl Clone for MathCode

source§

fn clone(&self) -> MathCode

Returns a copy 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 MathCode

source§

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

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

impl Default for MathCode

source§

fn default() -> MathCode

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

impl<'de> Deserialize<'de> for MathCode

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<S: TexlangState> Parsable<S> for MathCode

source§

fn parse_impl(input: &mut ExpandedStream<S>) -> Result<Self, Box<Error>>

Parses a value from the vm::ExpandedStream.
source§

fn parse<I>(input: &mut I) -> Result<Self, Box<Error>>where I: AsMut<ExpandedStream<S>>,

Parses a value from an input stream. Read more
source§

impl Serialize for MathCode

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl SupportedType for MathCode

source§

fn new_command<S>( ref_fn: RefFn<S, Self>, ref_mut_fn: MutRefFn<S, Self>, index_resolver: Option<IndexResolver<S>> ) -> Command<S>

Create a new command of this type with the provided reference functions and index resolver.
source§

fn update_save_stack<S>( input: &mut ExecutionInput<S>, variable: &TypedVariable<S, Self>, scope: Scope, overwritten_value: Self )

Update the VM’s save stack after a variable assignment.
source§

fn new_typed_variable<S>( command: &Command<S>, index: Index ) -> Option<TypedVariable<S, Self>>

Create a new typed variable of this type from the getters in the command and the provided index. Read more
source§

fn recycle<S>(input: &mut ExecutionInput<S>, overwritten_value: Self)

Recycle a value that’s about to be dropped. Read more
source§

impl Copy for MathCode

Auto Trait Implementations§

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> ToOwned for Twhere T: Clone,

§

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 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.
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,