Expand description
Utilities for Typst.
Modules§
- fat
- Fat pointer handling.
Macros§
- assign_
impl - Implement an assign trait based on an existing non-assign trait.
- singleton
- Create a lazy initialized, globally unique
'staticreference to a value. - sub_
impl - Implement the
Subtrait based on existingNegandAddimpls.
Structs§
- BitSet
- Stores a set of numbers which are expected to be rather small.
- Deferred
- A value that is lazily executed on another thread.
- Group
ByKey - This struct is created by
SliceExt::group_by_key. - Hash
Lock - Storage for lazy hash computation.
- Lazy
Hash - A wrapper type with lazily-computed hash.
- ListSet
- A set backed by a mutable slice-like data structure.
- Manually
Hash - A wrapper type with a manually computed hash.
- PicoStr
- An interned string representation that is cheap to copy and hash, but more expensive to access.
- Resolved
Pico Str - This is returned by
PicoStr::resolve. - Scalar
- A 64-bit float that implements
Eq,OrdandHash. - Small
BitSet - Efficiently stores a set of numbers which are expected to be very small.
Values
< 32/64(depending on the architecture) are stored inline, while values larger than that will lead to an allocation. - Static
- A container around a static reference that is cheap to clone and hash.
Traits§
- ArcExt
- Extra methods for
Arc. - Get
- Generic access to a structure’s components.
- Maybe
Reverse Iter - Adapter for reversing iterators conditionally.
- NonZero
Ext - An extra constant for
NonZeroUsize. - Numeric
- A numeric type.
- Option
Ext - Extra methods for
Option. - Slice
Ext - Extra methods for
[T].
Functions§
- debug
- Turn a closure into a struct implementing
Debug. - default_
math_ class - Returns the default math class of a character in Typst, if it has one.
- defer
- Automatically calls a deferred function when the returned handle is dropped.
- display
- Turn a closure into a struct implementing
Display. - format_
duration - Formats a duration with a precision suitable for human display.
- hash128
- Calculate a 128-bit siphash of a value.
- option_
eq - Check if the
Option-wrapped L is same to R. - round_
int_ with_ precision - This is used for rounding into integer digits, and is a no-op for positive
precision. - round_
with_ precision - Returns value with
ndigits after floating point wherenisprecision. Standard rounding rules apply (ifn+1th digit >= 5, round away from zero).