pub struct InputSource<'a> { /* private fields */ }Implementations§
Source§impl<'a> InputSource<'a>
impl<'a> InputSource<'a>
pub fn from_reader( reader: impl Read + 'a, encoding: Option<&str>, ) -> Result<Self, XMLError>
pub fn from_content(str: &str) -> Self
pub fn grow(&mut self) -> Result<(), XMLError>
pub fn content_bytes(&self) -> &[u8] ⓘ
pub fn content_str(&self) -> &str
pub fn total_read(&self) -> usize
pub fn next_char(&mut self) -> Result<Option<char>, XMLError>
pub fn next_char_if( &mut self, f: impl Fn(char) -> bool, ) -> Result<Option<char>, XMLError>
pub fn peek_char(&mut self) -> Result<Option<char>, XMLError>
pub fn advance(&mut self, len: usize) -> Result<(), XMLError>
Sourcepub fn is_empty(&self) -> bool
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.
Sourcepub fn encoding_name(&self) -> &'static str
pub fn encoding_name(&self) -> &'static str
The encoding name of the decoder currently in use.
Sourcepub fn source_id(&self) -> usize
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.
pub fn system_id(&self) -> Option<&URIStr>
pub fn public_id(&self) -> Option<&str>
pub fn set_system_id(&mut self, system_id: impl Into<URIString>)
pub fn set_public_id(&mut self, public_id: impl Into<String>)
Trait Implementations§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more