#[non_exhaustive]pub struct RenderOptions<'a> {
pub order_by: OrderBy,
pub include_origins: bool,
pub print_placeholders_in_comments: PlaceholderCommentMode,
pub custom_header_attributes: Option<&'a BTreeMap<String, String>>,
}catalog only.Expand description
Shared rendering options for catalog serialization.
These fields control how a catalog is sorted and which optional reference and
placeholder details are written. Some storage formats still impose their own
invariants: FCL always renders in canonical (id, ctxt) order, while origin
and placeholder detail flags apply across supported catalog storage formats.
References render the source file only; Ferrocat does not track or emit line
numbers (see CatalogOrigin).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.order_by: OrderBySort order for the final rendered catalog.
include_origins: boolWhether source origins should be rendered as references.
print_placeholders_in_comments: PlaceholderCommentModeControls emission of placeholder comments.
custom_header_attributes: Option<&'a BTreeMap<String, String>>Optional additional header attributes to inject or override.
Implementations§
Source§impl<'a> RenderOptions<'a>
impl<'a> RenderOptions<'a>
Sourcepub fn with_order_by(self, order_by: OrderBy) -> Self
pub fn with_order_by(self, order_by: OrderBy) -> Self
Returns options that render messages with the given sort order.
Sourcepub fn with_include_origins(self, include_origins: bool) -> Self
pub fn with_include_origins(self, include_origins: bool) -> Self
Returns options that enable or disable rendered source origins.
Sourcepub fn with_placeholder_comments(
self,
print_placeholders_in_comments: PlaceholderCommentMode,
) -> Self
pub fn with_placeholder_comments( self, print_placeholders_in_comments: PlaceholderCommentMode, ) -> Self
Returns options that use the given placeholder comment mode.
Sourcepub fn with_custom_header_attributes(
self,
custom_header_attributes: &'a BTreeMap<String, String>,
) -> Self
pub fn with_custom_header_attributes( self, custom_header_attributes: &'a BTreeMap<String, String>, ) -> Self
Returns options that inject or override the given header attributes.
Trait Implementations§
Source§impl<'a> Clone for RenderOptions<'a>
impl<'a> Clone for RenderOptions<'a>
Source§fn clone(&self) -> RenderOptions<'a>
fn clone(&self) -> RenderOptions<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'a> Debug for RenderOptions<'a>
impl<'a> Debug for RenderOptions<'a>
Source§impl Default for RenderOptions<'_>
impl Default for RenderOptions<'_>
impl<'a> Eq for RenderOptions<'a>
Source§impl<'a> PartialEq for RenderOptions<'a>
impl<'a> PartialEq for RenderOptions<'a>
Source§fn eq(&self, other: &RenderOptions<'a>) -> bool
fn eq(&self, other: &RenderOptions<'a>) -> bool
self and other values to be equal, and is used by ==.