InputSource

Struct InputSource 

Source
pub struct InputSource<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> InputSource<'a>

Source

pub fn from_reader( reader: impl Read + 'a, encoding: Option<&str>, ) -> Result<Self, XMLError>

Source

pub fn from_content(str: &str) -> Self

Source

pub fn grow(&mut self) -> Result<(), XMLError>

Source

pub fn content_bytes(&self) -> &[u8]

Source

pub fn content_str(&self) -> &str

Source

pub fn total_read(&self) -> usize

Source

pub fn next_char(&mut self) -> Result<Option<char>, XMLError>

Source

pub fn next_char_if( &mut self, f: impl Fn(char) -> bool, ) -> Result<Option<char>, XMLError>

Source

pub fn peek_char(&mut self) -> Result<Option<char>, XMLError>

Source

pub fn advance(&mut self, len: usize) -> Result<(), XMLError>

Source

pub fn is_empty(&self) -> bool

Returns true if both the decoded but unused string and the read but undecoded data are 0 bytes.

§Note

Returning true does not mean that EOF has been reached.
If all of the read data has been decoded and you continue to consume the decoded strings without explicitly calling grow, this function may return true before reaching EOF.

Source

pub fn encoding_name(&self) -> &'static str

The encoding name of the decoder currently in use.

Source

pub fn source_id(&self) -> usize

A unique identifier for the source.

To determine whether markup spans different sources, even sources created from the same file or character data are assigned different IDs.

Source

pub fn system_id(&self) -> Option<&URIStr>

Source

pub fn public_id(&self) -> Option<&str>

Source

pub fn set_system_id(&mut self, system_id: impl Into<URIString>)

Source

pub fn set_public_id(&mut self, public_id: impl Into<String>)

Trait Implementations§

Source§

impl Default for InputSource<'_>

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl<'a> Freeze for InputSource<'a>

§

impl<'a> !RefUnwindSafe for InputSource<'a>

§

impl<'a> !Send for InputSource<'a>

§

impl<'a> !Sync for InputSource<'a>

§

impl<'a> Unpin for InputSource<'a>

§

impl<'a> !UnwindSafe for InputSource<'a>

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.