#[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>>,
pub po_serialize: SerializeOptions,
}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. FCL always uses collated (id, ctxt) order
because its line order is a storage invariant; order_by controls PO output.
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.
po_serialize: SerializeOptionsPO serializer controls for the rendered output, e.g. width folding.
This only affects PO rendering. FCL output has a canonical line shape and ignores these controls. Embedded newline characters always render as valid multiline PO syntax, even with width folding disabled.
Implementations§
Source§impl<'a> RenderOptions<'a>
impl<'a> RenderOptions<'a>
Sourcepub fn with_order_by(self, order_by: OrderBy) -> RenderOptions<'a>
pub fn with_order_by(self, order_by: OrderBy) -> RenderOptions<'a>
Returns options that render messages with the given sort order.
Sourcepub fn with_include_origins(self, include_origins: bool) -> RenderOptions<'a>
pub fn with_include_origins(self, include_origins: bool) -> RenderOptions<'a>
Returns options that enable or disable rendered source origins.
Sourcepub fn with_placeholder_comments(
self,
print_placeholders_in_comments: PlaceholderCommentMode,
) -> RenderOptions<'a>
pub fn with_placeholder_comments( self, print_placeholders_in_comments: PlaceholderCommentMode, ) -> RenderOptions<'a>
Returns options that use the given placeholder comment mode.
Sourcepub fn with_custom_header_attributes(
self,
custom_header_attributes: &'a BTreeMap<String, String>,
) -> RenderOptions<'a>
pub fn with_custom_header_attributes( self, custom_header_attributes: &'a BTreeMap<String, String>, ) -> RenderOptions<'a>
Returns options that inject or override the given header attributes.
Sourcepub fn with_po_serialize_options(
self,
po_serialize: SerializeOptions,
) -> RenderOptions<'a>
pub fn with_po_serialize_options( self, po_serialize: SerializeOptions, ) -> RenderOptions<'a>
Returns options that render PO output with the given serializer
controls, e.g. SerializeOptions::default().with_fold_length(0) to
disable automatic width folding.
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 more