Struct exile::PI[][src]

pub struct PI { /* fields omitted */ }

Represents a Processing Instruction (PI) in an XML document.

XML Spec

https://www.w3.org/TR/2006/REC-xml11-20060816/#sec-pi [Definition: Processing instructions (PIs) allow documents to contain instructions for applications.]

Processing Instructions

[16] PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>' [17] PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))

PIs are not part of the document's character data, but must be passed through to the application. The PI begins with a target (PITarget) used to identify the application to which the instruction is directed. The target names "XML", "xml", and so on are reserved for standardization in this or future versions of this specification. The XML Notation mechanism may be used for formal declaration of PI targets. Parameter entity references must not be recognized within processing instructions.

Implementations

impl PI[src]

pub fn new<S1, S2>(target: S1, data: S2) -> Result<Self, XDocErr> where
    S1: Into<String> + AsRef<str>,
    S2: Into<String> + AsRef<str>, 
[src]

Create a new processing instruction.

pub fn target(&self) -> &String[src]

Return the target from a processing instruction, e.g. in <?foo bar baz?>, foo is the target.

pub fn data(&self) -> &String[src]

Return the data from a processing instruction, e.g. in <?foo bar baz?>, bar baz is the data.

pub fn write<W>(
    &self,
    writer: &mut W,
    opts: &WriteOpts,
    depth: usize
) -> Result<(), XDocErr> where
    W: Write
[src]

Write the processing instruction to the Write object.

Trait Implementations

impl Clone for PI[src]

impl Debug for PI[src]

impl Default for PI[src]

impl Display for PI[src]

impl Eq for PI[src]

impl Hash for PI[src]

impl Ord for PI[src]

impl PartialEq<PI> for PI[src]

impl PartialOrd<PI> for PI[src]

impl StructuralEq for PI[src]

impl StructuralPartialEq for PI[src]

Auto Trait Implementations

impl RefUnwindSafe for PI[src]

impl Send for PI[src]

impl Sync for PI[src]

impl Unpin for PI[src]

impl UnwindSafe for PI[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.