Trait typst::foundations::Fold

source ·
pub trait Fold {
    // Required method
    fn fold(self, outer: Self) -> Self;
}
Expand description

A property that is folded to determine its final value.

In the example below, the chain of stroke values is folded into a single value: 4pt + red.

#set rect(stroke: red)
#set rect(stroke: 4pt)
#rect()

Required Methods§

source

fn fold(self, outer: Self) -> Self

Fold this inner value with an outer folded value.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Fold for bool

source§

fn fold(self, _: Self) -> Self

source§

impl<T> Fold for Vec<T>

source§

fn fold(self, outer: Self) -> Self

source§

impl<T, const N: usize> Fold for SmallVec<[T; N]>

source§

fn fold(self, outer: Self) -> Self

source§

impl<T: Clone + Fold> Fold for Arc<T>

source§

fn fold(self, outer: Self) -> Self

source§

impl<T: Fold> Fold for Option<T>

source§

fn fold(self, outer: Self) -> Self

Implementors§