Skip to main content

Nodes

Struct Nodes 

Source
pub struct Nodes {
    pub in_use: usize,
    pub props: Properties,
    pub sync: Option<Box<SyncFields>>,
    pub double_free: Option<(u8, u32)>,
    pub par_temp: NodeRef,
    pub lua_refs: LuaRefs,
    /* private fields */
}
Expand description

The node arena.

Fields§

§in_use: usize

Number of nodes in use.

§props: Properties

Lua node properties.

§sync: Option<Box<SyncFields>>

SyncTeX fields of the nodes, while SyncTeX is on (see SyncFields).

§double_free: Option<(u8, u32)>

The first node freed twice, with its type before the first free: a fatal error in LuaTeX, reported by the engine (see Engine::check_double_free).

§par_temp: NodeRef

The temporary head of a paragraph during its node processing callbacks: LuaTeX’s is not a node that can be freed.

§lua_refs: LuaRefs

The numbers of the Lua values nodes keep by reference.

Implementations§

Source§

impl Nodes

Source

pub fn new() -> Self

An arena with only the null node.

Source

pub fn enable_sync(&mut self)

Starts keeping SyncTeX fields (for nodes made from now on).

Source

pub fn sync_fields(&self, p: NodeRef) -> (u32, i32)

The SyncTeX tag and line of p, (0, 0) if it has none.

Source

pub fn set_sync_fields(&mut self, p: NodeRef, f: (u32, i32))

Sets the SyncTeX tag and line of p (when SyncTeX is on).

Source

pub fn sync_as_copied(&mut self, p: NodeRef)

Sets the SyncTeX fields of p, a node just made by font processing that LuaTeX’s Lua code makes by copying (kerns from OpenType positioning): the current tag and line.

Source

pub fn capacity(&self) -> usize

The number of node slots in the arena.

Source

pub fn alloc(&mut self, id: u8, subtype: u16, data: NodeData) -> NodeRef

Allocates a node.

Source

pub fn free(&mut self, p: NodeRef)

Frees a single node (not its sublists).

Source

pub fn lua_ref_of(&mut self, p: NodeRef) -> Option<i32>

The reference number of the Lua value node p keeps, if any.

Source

pub fn is_free(&self, p: NodeRef) -> bool

Whether p was freed (and not allocated again).

Source

pub fn get(&self, p: NodeRef) -> &Node

The node at p.

Source

pub fn get_mut(&mut self, p: NodeRef) -> &mut Node

The node at p, mutably.

Source

pub fn id(&self, p: NodeRef) -> u8

The type id of p.

Source

pub fn next(&self, p: NodeRef) -> NodeRef

The next link of p.

Links q after p (sets p.next and q.prev).

Source

pub fn box_data(&self, p: NodeRef) -> Option<&BoxData>

The box data of an hlist/vlist node.

Source

pub fn box_data_mut(&mut self, p: NodeRef) -> Option<&mut BoxData>

The box data of an hlist/vlist node, mutably.

Source

pub fn tail_of(&self, p: NodeRef) -> NodeRef

The last node of the list starting at p.

Source

pub fn bounded_tail(&self, p: NodeRef) -> Option<NodeRef>

The last node of the list starting at p, or None if the list is circular (Lua code can link nodes into a loop).

Source

pub fn flush_list(&mut self, p: NodeRef)

Frees a whole node list, including sublists (flush_node_list).

Source

pub fn copy_list(&mut self, p: NodeRef) -> NodeRef

Copies a whole node list, including sublists (copy_node_list).

Source

pub fn copy_node(&mut self, p: NodeRef) -> NodeRef

Copies one node with its sublists; the copy’s links are null.

Source

pub fn new_null_box(&mut self, hlist: bool) -> NodeRef

A new empty box of the given type (new_null_box).

Source

pub fn new_glue(&mut self, spec: Glue, subtype: u16) -> NodeRef

A new glue node.

Source

pub fn new_kern(&mut self, w: i32, subtype: u16) -> NodeRef

A new kern node.

Source

pub fn new_penalty(&mut self, m: i32, subtype: u16) -> NodeRef

A new penalty node.

Source

pub fn new_temp(&mut self) -> NodeRef

A new temporary list head.

Source

pub fn new_glyph(&mut self, font: u32, chr: u32) -> NodeRef

A new glyph node.

Source

pub fn new_rule(&mut self, width: i32, height: i32, depth: i32) -> NodeRef

A new rule node with the given dimensions.

Source

pub fn new_disc(&mut self, subtype: u16, penalty: i32) -> NodeRef

A new empty discretionary node.

Source

pub fn new_math(&mut self, surround: i32, subtype: u16) -> NodeRef

A new math node.

Source

pub fn data(&self, p: NodeRef) -> &NodeData

The type-specific data of p.

Source

pub fn data_mut(&mut self, p: NodeRef) -> &mut NodeData

The type-specific data of p, mutably.

Source

pub fn subtype(&self, p: NodeRef) -> u16

The subtype of p.

Source

pub fn set_subtype(&mut self, p: NodeRef, s: u16)

Sets the subtype of p.

Source

pub fn prev(&self, p: NodeRef) -> NodeRef

The prev link of p.

Source

pub fn set_next(&mut self, p: NodeRef, q: NodeRef)

Sets only the next link of p.

Source

pub fn set_prev(&mut self, p: NodeRef, q: NodeRef)

Sets only the prev link of p.

Source

pub fn is_glyph(&self, p: NodeRef) -> bool

Whether p is a glyph node.

Source

pub fn glyph(&self, p: NodeRef) -> Option<&GlyphData>

The glyph data of a glyph node.

Source

pub fn glyph_mut(&mut self, p: NodeRef) -> Option<&mut GlyphData>

The glyph data of a glyph node, mutably.

Source

pub fn glue_spec(&self, p: NodeRef) -> Glue

The glue specification of a glue node.

Source

pub fn width(&self, p: NodeRef) -> i32

The width of a node that has one (boxes, rules, glue, kerns, math, margin kerns, unset nodes); zero otherwise. Glyph widths need the font and are not handled here.

Source

pub fn penalty(&self, p: NodeRef) -> i32

The penalty of a penalty node (0 for other nodes).

Source

pub fn disc_lists(&self, p: NodeRef) -> (NodeRef, NodeRef, NodeRef)

The (pre, post, replace) lists of a discretionary.

Source

pub fn set_disc_lists(&mut self, p: NodeRef, l: (NodeRef, NodeRef, NodeRef))

Sets the lists of a discretionary.

Source

pub fn list_ptr(&self, p: NodeRef) -> NodeRef

The list of a box, unset node, insertion or adjust node.

Source

pub fn set_list_ptr(&mut self, p: NodeRef, l: NodeRef)

Sets the list of a box, unset node, insertion or adjust node.

Source

pub fn attr(&self, p: NodeRef) -> Option<&AttrList>

The attribute list of p.

Source

pub fn set_attr(&mut self, p: NodeRef, a: Option<AttrList>)

Sets the attribute list of p.

Source

pub fn noad(&self, p: NodeRef) -> Option<&NoadData>

The noad fields of a noad, radical or accent node.

Source

pub fn noad_mut(&mut self, p: NodeRef) -> Option<&mut NoadData>

The noad fields of a noad, radical or accent node, mutably.

Source

pub fn list_ptr_kernel(&self, p: NodeRef) -> NodeRef

The list of a sub_box or sub_mlist kernel (null otherwise).

Source

pub fn set_kernel_list(&mut self, p: NodeRef, l: NodeRef)

Sets the list of a sub_box or sub_mlist kernel.

Source

pub fn scripts_allowed(&self, p: NodeRef) -> bool

Whether p is a noad that can carry scripts (scripts_allowed).

Source

pub fn list_len(&self, p: NodeRef) -> usize

The number of nodes in the list starting at p.

Trait Implementations§

Source§

impl Clone for Nodes

Source§

fn clone(&self) -> Self

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 Nodes

Source§

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

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

impl Default for Nodes

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl !Send for Nodes

§

impl !Sync for Nodes

§

impl Freeze for Nodes

§

impl RefUnwindSafe for Nodes

§

impl Unpin for Nodes

§

impl UnsafeUnpin for Nodes

§

impl UnwindSafe for Nodes

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> ErasedDestructor for T
where T: 'static,

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.