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

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

pub fn use_compact_format(self) -> Self

Use a highly compact RDF syntax and layout.

source

pub fn use_canonical_format(self) -> Self

Use a canonical form of RDF.

source

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.

source

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.

source

pub fn omit_all_formatting(self) -> Self

Omit all formatting whitespace.

source

pub fn omit_xmp_meta_element(self) -> Self

Omit the x:xmpmeta element surrounding the rdf:RDF element.

source

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

source§

fn clone(&self) -> ToStringOptions

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ToStringOptions

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for ToStringOptions

source§

fn default() -> ToStringOptions

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

impl PartialEq<ToStringOptions> for ToStringOptions

source§

fn eq(&self, other: &ToStringOptions) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for ToStringOptions

source§

impl StructuralEq for ToStringOptions

source§

impl StructuralPartialEq for ToStringOptions

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.