Skip to main content

EngineSemantics

Struct EngineSemantics 

Source
pub struct EngineSemantics {
    pub profile: ProfileId,
    pub kind: EngineKind,
    pub primitives: Vec<PrimitiveSpec>,
    pub catcodes: CatcodeDefaults,
    pub mathcodes: MathcodeDefaults,
    pub registers: RegisterDefaults,
    pub fonts: FontSemantics,
    pub extensions: ExtensionPolicy,
    pub patches: EnginePatches,
}
Expand description

Owned copy of profile settings so shared TeX code can check the active profile at runtime.

Fields§

§profile: ProfileId

Profile identifier for this semantics snapshot.

§kind: EngineKind

Engine variant reported by the profile.

§primitives: Vec<PrimitiveSpec>

Primitives declared by the profile.

§catcodes: CatcodeDefaults

Category code defaults for this profile.

§mathcodes: MathcodeDefaults

Math code defaults for this profile.

§registers: RegisterDefaults

Register count defaults for this profile.

§fonts: FontSemantics

Font capability settings for this profile.

§extensions: ExtensionPolicy

Extension families active for this profile.

§patches: EnginePatches

Computed patch flags derived from the extension policy.

Implementations§

Source§

impl EngineSemantics

Source

pub fn from_profile<P>(profile: &P) -> Self
where P: EngineProfile,

Constructs an EngineSemantics snapshot from any EngineProfile implementor.

Source

pub fn primitives(&self) -> &[PrimitiveSpec]

Returns the slice of primitives registered for this profile.

Source

pub fn primitive(&self, name: &str) -> Option<&PrimitiveSpec>

Finds a PrimitiveSpec by control sequence name, or None if not registered.

Source

pub fn has_primitive(&self, name: &str) -> bool

Returns true if a primitive with the given name is registered for this profile.

Source

pub const fn has_patch(&self, patch: EnginePatch) -> bool

Returns true if the given engine patch is active.

Source

pub const fn is_xetex(&self) -> bool

Returns true if the XeTeX patch is active.

Trait Implementations§

Source§

impl Clone for EngineSemantics

Source§

fn clone(&self) -> EngineSemantics

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 EngineSemantics

Source§

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

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

impl Eq for EngineSemantics

Source§

impl PartialEq for EngineSemantics

Source§

fn eq(&self, other: &EngineSemantics) -> 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 EngineSemantics

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.