Struct XMLBuilder

Source
pub struct XMLBuilder { /* private fields */ }
Expand description

Builder structure used to generate a custom XML structure.

Implementations§

Source§

impl XMLBuilder

Source

pub fn new() -> Self

Builds a new XMLBuilder

Source

pub fn version(self, version: XMLVersion) -> Self

Sets the XML version attribute field.

§Arguments

version - An enum value representing the new version to use for the XML.

Source

pub fn encoding(self, encoding: String) -> Self

Sets the XML encoding attribute field.

§Arguments

encoding - A String representing the encoding to use for the document.

Source

pub fn standalone(self, standalone: Option<bool>) -> Self

Sets the standalone attribute for this XML document.

Source

pub fn indent(self, indent: bool) -> Self

Sets the XML indentation.

Source

pub fn sort_attributes(self, sort: bool) -> Self

Enables attributes sorting.

Source

pub fn break_lines(self, break_lines: bool) -> Self

Sets whether to break lines.

Source

pub fn expand_empty_tags(self, expand_empty_tags: bool) -> Self

Sets whether to expand empty tags.

Source

pub fn build(self) -> XML

Builds a new XML structure by consuming self.

Trait Implementations§

Source§

impl Default for XMLBuilder

Source§

fn default() -> Self

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

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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

Source§

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.