SpanBuilder

Struct SpanBuilder 

Source
pub struct SpanBuilder<'f1, T, S: State = Empty> { /* private fields */ }
Expand description

Use builder syntax to set the inputs and finish with build().

Implementations§

Source§

impl<'f1, T, S: State> SpanBuilder<'f1, T, S>

Source

pub fn build(self, options: Option<&'f1 Options>) -> Span<T>
where S: IsComplete,

Finishes building and performs the requested action.

Source

pub fn children(self, value: Vec<T>) -> SpanBuilder<'f1, T, SetChildren<S>>
where S::Children: IsUnset,

Required.

Child nodes contained within this span

Source

pub fn attributes( self, value: KeyMap<String, String>, ) -> SpanBuilder<'f1, T, SetAttributes<S>>
where S::Attributes: IsUnset,

Optional (Some / Option setters).

Attributes for this span element

Source

pub fn maybe_attributes( self, value: Option<KeyMap<String, String>>, ) -> SpanBuilder<'f1, T, SetAttributes<S>>
where S::Attributes: IsUnset,

Optional (Some / Option setters).

Attributes for this span element

Source

pub fn classes(self, value: ClassList) -> SpanBuilder<'f1, T, SetClasses<S>>
where S::Classes: IsUnset,

Optional (Some / Option setters).

Classes applied to this span

Source

pub fn maybe_classes( self, value: Option<ClassList>, ) -> SpanBuilder<'f1, T, SetClasses<S>>
where S::Classes: IsUnset,

Optional (Some / Option setters).

Classes applied to this span

Source

pub fn height(self, value: f64) -> SpanBuilder<'f1, T, SetHeight<S>>
where S::Height: IsUnset,

Optional (Some / Option setters).

Height of this span element

Source

pub fn maybe_height( self, value: Option<f64>, ) -> SpanBuilder<'f1, T, SetHeight<S>>
where S::Height: IsUnset,

Optional (Some / Option setters).

Height of this span element

Source

pub fn depth(self, value: f64) -> SpanBuilder<'f1, T, SetDepth<S>>
where S::Depth: IsUnset,

Optional (Some / Option setters).

Depth of this span element

Source

pub fn maybe_depth(self, value: Option<f64>) -> SpanBuilder<'f1, T, SetDepth<S>>
where S::Depth: IsUnset,

Optional (Some / Option setters).

Depth of this span element

Source

pub fn width(self, value: Option<f64>) -> SpanBuilder<'f1, T, SetWidth<S>>
where S::Width: IsUnset,

Optional (Some / Option setters).

Optional width of this span element

Source

pub fn maybe_width( self, value: Option<Option<f64>>, ) -> SpanBuilder<'f1, T, SetWidth<S>>
where S::Width: IsUnset,

Optional (Some / Option setters).

Optional width of this span element

Source

pub fn max_font_size(self, value: f64) -> SpanBuilder<'f1, T, SetMaxFontSize<S>>
where S::MaxFontSize: IsUnset,

Optional (Some / Option setters).

Maximum font size used in this span

Source

pub fn maybe_max_font_size( self, value: Option<f64>, ) -> SpanBuilder<'f1, T, SetMaxFontSize<S>>
where S::MaxFontSize: IsUnset,

Optional (Some / Option setters).

Maximum font size used in this span

Source

pub fn style(self, value: CssStyle) -> SpanBuilder<'f1, T, SetStyle<S>>
where S::Style: IsUnset,

Optional (Some / Option setters).

Inline CSS style object

Source

pub fn maybe_style( self, value: Option<CssStyle>, ) -> SpanBuilder<'f1, T, SetStyle<S>>
where S::Style: IsUnset,

Optional (Some / Option setters).

Inline CSS style object

Source

pub fn is_middle( self, value: (String, Options), ) -> SpanBuilder<'f1, T, SetIsMiddle<S>>
where S::IsMiddle: IsUnset,

Optional (Some / Option setters).

is_middle tuple

Source

pub fn maybe_is_middle( self, value: Option<(String, Options)>, ) -> SpanBuilder<'f1, T, SetIsMiddle<S>>
where S::IsMiddle: IsUnset,

Optional (Some / Option setters).

is_middle tuple

Auto Trait Implementations§

§

impl<'f1, T, S> Freeze for SpanBuilder<'f1, T, S>

§

impl<'f1, T, S> RefUnwindSafe for SpanBuilder<'f1, T, S>
where T: RefUnwindSafe,

§

impl<'f1, T, S> Send for SpanBuilder<'f1, T, S>
where T: Send,

§

impl<'f1, T, S> Sync for SpanBuilder<'f1, T, S>
where T: Sync,

§

impl<'f1, T, S> Unpin for SpanBuilder<'f1, T, S>
where T: Unpin,

§

impl<'f1, T, S> UnwindSafe for SpanBuilder<'f1, T, S>
where T: UnwindSafe,

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

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.