Skip to main content

render_options

Macro render_options 

Source
macro_rules! render_options {
    ( $( $field:ident : $value:expr ),* $(,)? ) => { ... };
}
Expand description

Construct crate::RenderOptions from defaults and a list of field assignments.

This macro exists to keep call sites ergonomic while allowing RenderOptions to evolve over time (e.g., adding fields) without forcing downstream crates to use struct literal syntax.

Defaults:

Example:

use serde_saphyr::{SnippetMode, UserMessageFormatter};

let user = UserMessageFormatter;
let opts = serde_saphyr::render_options! {
    formatter: &user,
};