Struct xmp_toolkit::ToStringOptions
source · pub struct ToStringOptions { /* private fields */ }
Expand description
Provides options for configuring the XMP serialization behavior
provided by XmpMeta::to_string_with_options
.
Note that the Rust XMP Toolkit only provides UTF-8 string encodings. No API is provided for accessing UTF-16 or UTF-32 string encodings.
We would welcome a PR that adds UTF-16 or UTF-32 encoding if you need it, but we have no plans to implement this ourselves.
Implementations§
source§impl ToStringOptions
impl ToStringOptions
sourcepub fn set_padding(self, padding: u32) -> Self
pub fn set_padding(self, padding: u32) -> Self
Set the amount of padding to be added if a writeable XML packet is created.
If zero or this function is not called, an appropriate amount of padding is computed.
sourcepub fn set_newline(self, newline: String) -> Self
pub fn set_newline(self, newline: String) -> Self
Set the string to be used as a line terminator.
If empty or this function is not called, defaults to linefeed, U+000A, the standard XML newline.
sourcepub fn set_indent_string(self, indent: String) -> Self
pub fn set_indent_string(self, indent: String) -> Self
Set the string to be used for each level of indentation in the serialized RDF.
If empty or this function is not called, defaults to two ASCII spaces, U+0020.
sourcepub fn set_base_indent(self, base_indent: u32) -> Self
pub fn set_base_indent(self, base_indent: u32) -> Self
Set the number of levels of indentation to be used for the outermost XML element in the serialized RDF. This is convenient when embedding the RDF in other text.
If this function is not called, the outermost XML element will have no indentation applied.
sourcepub fn omit_packet_wrapper(self) -> Self
pub fn omit_packet_wrapper(self) -> Self
Do not include an XML packet wrapper.
This can not be specified together with
ToStringOptions::read_only_packet
,
ToStringOptions::include_thumbnail_pad
, or
ToStringOptions::exact_packet_length
.
sourcepub fn read_only_packet(self) -> Self
pub fn read_only_packet(self) -> Self
Create a read-only XML packet wapper.
This can not be specified together with
ToStringOptions::omit_packet_wrapper
.
sourcepub fn use_compact_format(self) -> Self
pub fn use_compact_format(self) -> Self
Use a highly compact RDF syntax and layout.
sourcepub fn use_canonical_format(self) -> Self
pub fn use_canonical_format(self) -> Self
Use a canonical form of RDF.
sourcepub fn include_thumbnail_pad(self) -> Self
pub fn include_thumbnail_pad(self) -> Self
Include typical space for a JPEG thumbnail in the padding if
no xmp:Thumbnails
property is present.
This can not be specified together with
ToStringOptions::omit_packet_wrapper
.
sourcepub fn exact_packet_length(self) -> Self
pub fn exact_packet_length(self) -> Self
The padding parameter provides the overall packet length. The actual amount of padding is computed. An error is returned if the packet exceeds this length with no padding.
This can not be specified together with
ToStringOptions::omit_packet_wrapper
.
sourcepub fn omit_all_formatting(self) -> Self
pub fn omit_all_formatting(self) -> Self
Omit all formatting whitespace.
sourcepub fn omit_xmp_meta_element(self) -> Self
pub fn omit_xmp_meta_element(self) -> Self
Omit the x:xmpmeta
element surrounding the rdf:RDF
element.
sourcepub fn include_rdf_hash(self) -> Self
pub fn include_rdf_hash(self) -> Self
Include a rdf Hash
and Merged
flag in x:xmpmeta
element.
Trait Implementations§
source§impl Clone for ToStringOptions
impl Clone for ToStringOptions
source§fn clone(&self) -> ToStringOptions
fn clone(&self) -> ToStringOptions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ToStringOptions
impl Debug for ToStringOptions
source§impl Default for ToStringOptions
impl Default for ToStringOptions
source§fn default() -> ToStringOptions
fn default() -> ToStringOptions
source§impl PartialEq<ToStringOptions> for ToStringOptions
impl PartialEq<ToStringOptions> for ToStringOptions
source§fn eq(&self, other: &ToStringOptions) -> bool
fn eq(&self, other: &ToStringOptions) -> bool
self
and other
values to be equal, and is used
by ==
.