Xml

Enum Xml 

Source
pub enum Xml<S> {
    XmlDecl(Vec<(S, S)>),
    DocType {
        name: S,
        external: Option<S>,
        internal: Option<S>,
    },
    Pi {
        target: S,
        content: Option<S>,
    },
    Tac(S, Vec<(S, S)>, Option<Box<Self>>),
    Seq(Vec<Self>),
    Scalar(Val),
    Cdata(S),
    Comment(S),
}
Expand description

XML value.

Variants§

§

XmlDecl(Vec<(S, S)>)

XML declaration, e.g. <?xml version='1.0' encoding='UTF-8' standalone='yes'?>

§

DocType

DOCTYPE directive, e.g. <!DOCTYPE greeting SYSTEM "hello.dtd" [...]>

Fields

§name: S

name of the document type, e.g. “greeting”

§external: Option<S>

reference to an external file, e.g. SYSTEM "hello.dtd"

§internal: Option<S>

internal definition of the DTD, e.g. ...

§

Pi

Processing instruction, e.g. `

Fields

§target: S

target, e.g. xml-stylesheet

§content: Option<S>

content, e.g. type="text/css" href="style.css"

§

Tac(S, Vec<(S, S)>, Option<Box<Self>>)

An element consisting of a Tag, an Attribute, and Content

For example, <a href="bla">Link</a>.

§

Seq(Vec<Self>)

A sequence of XML values, e.g. Hello<br />World

§

Scalar(Val)

A string, e.g. Hello world

§

Cdata(S)

CDATA, e.g. <![CDATA[text]]>

§

Comment(S)

Comment, e.g. <!-- text -->

Implementations§

Source§

impl Xml<&[u8]>

Source

pub fn write(&self, w: &mut dyn Write) -> Result<()>

Write an XML value.

Trait Implementations§

Source§

impl Display for Xml<&[u8]>

Source§

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

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

impl<'a> TryFrom<&'a Val> for Xml<&'a [u8]>

Source§

type Error = SError

The type returned in the event of a conversion error.
Source§

fn try_from(v: &'a Val) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<S> !Freeze for Xml<S>

§

impl<S> RefUnwindSafe for Xml<S>
where S: RefUnwindSafe,

§

impl<S> !Send for Xml<S>

§

impl<S> !Sync for Xml<S>

§

impl<S> Unpin for Xml<S>
where S: Unpin,

§

impl<S> UnwindSafe for Xml<S>
where S: UnwindSafe,

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.