[−][src]Struct json5format::Json5Format
A JSON5 formatter that parses a valid JSON5 input buffer and produces a new, formatted document.
Implementations
impl Json5Format
[src]
pub fn with_options(options: FormatOptions) -> Result<Self, Error>
[src]
Create and return a Json5Format, with the given options to be applied to the Json5Format::to_utf8() operation.
pub fn new() -> Result<Self, Error>
[src]
Create and return a Json5Format, with the default settings.
pub fn to_utf8(
&self,
parsed_document: &ParsedDocument
) -> Result<Vec<u8>, Error>
[src]
&self,
parsed_document: &ParsedDocument
) -> Result<Vec<u8>, Error>
Formats the parsed document into a new Vector of UTF8 bytes.
Arguments
parsed_document
- The parsed state of the incoming document.
Example
let format = Json5Format::new()?; let parsed_document = ParsedDocument::from_str(&buffer, Some(filename))?; let bytes = format.to_utf8(&parsed_document)?;
pub fn to_string(
&self,
parsed_document: &ParsedDocument
) -> Result<String, Error>
[src]
&self,
parsed_document: &ParsedDocument
) -> Result<String, Error>
Auto Trait Implementations
impl !RefUnwindSafe for Json5Format
impl !Send for Json5Format
impl !Sync for Json5Format
impl Unpin for Json5Format
impl !UnwindSafe for Json5Format
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,
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.
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>,