[][src]Struct json5format::ParsedDocument

pub struct ParsedDocument { /* fields omitted */ }

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]

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

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, 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.