Module foundations
Expand description
Foundational types and functions.
Modules§
- Calculations and processing of numeric values.
- Operations on values.
- Debug representation of values.
- System-related things.
Macros§
- Implements
Reflect
,FromValue
, andIntoValue
for a type. - Create a new
EcoString
from a format string. - Create a new
EcoVec
with the given elements.
Structs§
- An argument to a function call:
12
ordraw: false
. - Captured arguments to a function.
- A sequence of values.
- A value that indicates a smart default.
- A bound value with metadata.
- A sequence of bytes.
- A user-defined closure.
- A piece of document content.
- Data that is contextually made available to code.
- Executes a
context
block. - A fixed-point decimal number type.
- A type that accumulates depth when folded.
- A type that contains a user-visible source portion and something that is derived from it, but not user-visible.
- A map from string keys to values.
- A format in which a datetime can be displayed.
- Represents a positive or negative span of time.
- A value that is not part of the built-in enum.
- A document element.
- An iterator over the entries in a style chain.
- A mapping from argument values to a return value.
- A hash table where the iteration order of the key-value pairs is independent of the hash values of the keys.
- A label for an element.
- An iterator over the links of a style chain.
- A selector that can be used with
query
. - An module of definitions.
- Defines a native element.
- Defines a native function.
- Defines a native type.
- A value that indicates the absence of any other value.
- One element, or multiple provided as an array.
- A packed element of a static type.
- Describes a function parameter.
- A function loaded from a WebAssembly plugin.
- A style property originating from a set rule or constructor.
- A show rule recipe.
- Identifies a show rule recipe from the top of the chain.
- A regular expression.
- A map from binding names to values.
- A stack of scopes.
- A sequence of content.
- A selector that can be used with show rules.
- A sequence of Unicode codepoints.
- A chain of styles, similar to a linked list.
- Content alongside styles.
- A list of style properties.
- A Unicode symbol.
- A single character.
- A value that can be cast to a symbol.
- This element exists solely to host the
target
style chain field. It is never constructed and not visible to users. - A value that can be cast to bytes.
- A value that can be cast to bytes.
- A value that can be cast to dictionary.
- A value that can be cast to a float.
- A value that can be cast to an integer.
- Describes a kind of value.
- A version with an arbitrary number of components.
Enums§
- A key that can be used to get an argument: either the index of a positional argument, or the name of a named argument.
- What the variable was captured by.
- Describes a possible value for a cast.
- Represents a date, a time, or a combination of both.
- Represents the byte order used for converting integers and floats to bytes and vice versa.
- An error arising when trying to access a field of content.
- An uninhabitable type.
- A replacement for a matched
Str
- A filter for selecting elements within the document.
- A value that can be automatically determined.
- A pattern which can be searched for in a string.
- A side of a string.
- A single style property or recipe.
- The export target.
- A value that can be cast to a decimal.
- A value that can be cast to a string.
- A show rule transformation that can be applied to a match.
- A computational value.
- One or multiple version components.
Traits§
- A variant of fold for foldable optional (
Option<T>
) values where an innerNone
value isn’t respected (contrary toOption
’s usualFold
implementation, with which folding with an innerNone
always returnsNone
). Instead, when either of theOption
objects isNone
, the other one is necessarily returned byfold_or
. Normal folding still occurs when both values areSome
, usingT
’sFold
implementation. - Used to cast an element to a trait object for a trait it implements.
- Things that can be attached to a style chain.
- An element’s constructor function.
- A container for an argument.
- Defines how fields of an element are accessed.
- A property that is folded to determine its final value.
- Try to cast a Typst
Value
into a Rust type. - Things that can be used as arguments.
- Cast a Rust type or result into a
SourceResult<Value>
. - Cast a Rust type into a Typst
Value
. - A Typst element that is defined by a native Rust type.
- A Typst function that is defined by a native Rust type that shadows a native Rust function.
- Defines the associated scope of a Rust type.
- A Typst type that is defined by a native Rust type.
- Tries to extract the plain-text representation of the element.
- Determine details of a type.
- A trait that defines the
repr
of a Typst value. - A property that is resolved with other properties from the style chain.
- An element’s set rule.
- Defines a built-in show rule for an element.
- Defines built-in show set rules for an element.
- Synthesize fields on an element. This happens before execution of any show rule.
- Indicates that an element cannot be labelled.
Functions§
- Ensures that a condition is fulfilled.
- Evaluates a string as Typst code.
- List the available fields for a type.
- Fails with an error.
- Loads a WebAssembly module.
- Returns the current export target.
Attribute Macros§
- Makes a native Rust type usable as a Typst element.
- Makes a native Rust function usable as a Typst function.
- Provides an associated scope to a native function, type, or element.
- Makes a native Rust type usable as a Typst type.
Derive Macros§
- Implements
Reflect
,FromValue
, andIntoValue
for an enum.