Skip to main content

HookStore

Struct HookStore 

Source
pub struct HookStore { /* private fields */ }
Expand description

The slots lthooks keeps a hook’s code in, named once (a hook read at every \selectfont keeps its own).

Implementations§

Source§

impl HookStore

Source

pub fn new(hook: &str) -> Self

Source

pub fn from_tokens(prop: Token, toplevel: Token, next: Token) -> Self

Build from already-pinned literal tokens (e.g. T_CS!("...")), safe across arena::reset() because pin! re-interns automatically.

Source

pub fn has_code(&self) -> bool

lthooks’ \hook_if_empty:nTF (latex.ltx:6436-6448) read from its storage, no expansion: the labelled code (\g__hook_<hook>_code_prop not \c_empty_prop), the document’s (\__hook_toplevel <hook>) and the next-use code (\__hook_next <hook>) — a slot holds code when it is a macro with a non-empty body (\__hook_cs_if_empty:c, :5688).

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> 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, 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.