Struct json5format::ParsedDocument [−][src]
Represents the parsed state of a given JSON5 document.
Implementations
impl ParsedDocument
[src]
pub fn from_str(buffer: &str, filename: Option<String>) -> Result<Self, Error>
[src]
Parses the JSON5 document represented by buffer
, and returns a parsed representation of
the document that can be formatted by
Json5Format::to_utf8().
If a filename is also provided, any parsing errors will include the filename with the line number and column where the error was encountered.
pub fn from_string(
buffer: String,
filename: Option<String>
) -> Result<Self, Error>
[src]
buffer: String,
filename: Option<String>
) -> Result<Self, Error>
Parses the JSON5 document represented by buffer
, and returns a parsed representation of
the document that can be formatted by
Json5Format::to_utf8().
The returned ParsedDocument
object retains ownership of the input buffer, which can be
useful in situations where borrowing the buffer (via
from_str() requires burdensome workarounds.
If a filename is also provided, any parsing errors will include the filename with the line number and column where the error was encountered.
pub fn filename(&self) -> &Option<String>
[src]
Returns the filename, if provided when the object was created.
pub fn input_buffer(&self) -> &Option<String>
[src]
Borrows the input buffer owned by this object, if provided by calling from_string().
Auto Trait Implementations
impl !RefUnwindSafe for ParsedDocument
[src]
impl !Send for ParsedDocument
[src]
impl !Sync for ParsedDocument
[src]
impl Unpin for ParsedDocument
[src]
impl !UnwindSafe for ParsedDocument
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,