Skip to main content

RenderOptions

Struct RenderOptions 

Source
pub struct RenderOptions {
    pub theme: Theme,
    pub font_family: Option<String>,
    pub font_size: Option<f64>,
    pub max_width: Option<f64>,
    pub background: Option<String>,
}
Expand description

Per-call rendering configuration passed to render_with_options and try_render_with_options.

Use RenderOptions::default() to get a zero-configuration value and then set individual fields as needed.

§Examples

use ariel_rs::{RenderOptions, theme::Theme};

let opts = RenderOptions {
    theme: Theme::Dark,
    font_family: Some("monospace".to_string()),
    ..RenderOptions::default()
};

Fields§

§theme: Theme

The colour theme to apply to the rendered diagram.

§font_family: Option<String>

Optional CSS font-family string (e.g. "sans-serif").

When None the renderer uses its built-in default. Support for this field in individual renderers is planned for a future release.

§font_size: Option<f64>

Optional base font size in points.

When None the renderer uses its built-in default. Support for this field in individual renderers is planned for a future release.

§max_width: Option<f64>

Optional maximum width of the output SVG in pixels.

When None the renderer uses its built-in default. Support for this field in individual renderers is planned for a future release.

§background: Option<String>

Optional background colour as a CSS colour string (e.g. "#ffffff").

When None the renderer uses the theme’s default background. Support for this field in individual renderers is planned for a future release.

Trait Implementations§

Source§

impl Default for RenderOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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