Skip to main content

Canonicalizer

Struct Canonicalizer 

Source
pub struct Canonicalizer<R, W> { /* private fields */ }
Expand description

Canonicalizers take XML and return the canonicalised form of that XML.

Implementations§

Source§

impl<R, W> Canonicalizer<R, W>

Source

pub fn read_from_reader(reader: R) -> Self

Initialize a new Canonicalizer that reads from the provided reader.

Source§

impl<'a, W> Canonicalizer<&'a [u8], W>

Source

pub fn read_from_str(str: &'a str) -> Self

Initialize a new Canonicalizer that reads from the provided str.

Source§

impl<W> Canonicalizer<BufReader<File>, W>

Source

pub fn read_from_file<P: AsRef<Path>>(path: P) -> Result<Self, Arc<Error>>

Initialize a new Canonicalizer that reads from the provided str.

§Errors

Returns an I/O error if the file couldn’t be opened and/or read.

Source§

impl<R, W: Write> Canonicalizer<R, W>

Source

pub fn write_to_writer(self, writer: W) -> Self

Set the writer for this Canonicalizer to a writer.

Source§

impl<R> Canonicalizer<R, BufWriter<File>>

Source

pub fn write_to_file<P: AsRef<Path>>(self, path: P) -> Result<Self, Error>

Set the writer for this Canonicalizer to a file.

§Errors

Returns an I/O error if the file couldn’t be opened and/or read.

Source§

impl<R: BufRead, W: Write> Canonicalizer<R, W>

Source

pub fn canonicalize(self, retain_comments: bool) -> Result<(), Error>

Start canonicalizing the document to the writer.

§Errors

Returns an XML error if the XML parsed is invalid.

§Panics

This will panic is a writer has not been initialised with write_to_string, write_to_file, or write_to_writer.

Auto Trait Implementations§

§

impl<R, W> Freeze for Canonicalizer<R, W>
where R: Freeze, W: Freeze,

§

impl<R, W> RefUnwindSafe for Canonicalizer<R, W>

§

impl<R, W> Send for Canonicalizer<R, W>
where R: Send, W: Send,

§

impl<R, W> Sync for Canonicalizer<R, W>
where R: Sync, W: Sync,

§

impl<R, W> Unpin for Canonicalizer<R, W>
where R: Unpin, W: Unpin,

§

impl<R, W> UnsafeUnpin for Canonicalizer<R, W>
where R: UnsafeUnpin, W: UnsafeUnpin,

§

impl<R, W> UnwindSafe for Canonicalizer<R, W>
where R: UnwindSafe, W: 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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more