pub enum Format {
Json,
Json5,
Yaml,
Toml,
}Expand description
Supported textual formats for the JSON-family disassembler.
Variants§
Json
Json5
Yaml
Toml
TOML is intentionally isolated from the other formats: TOML’s syntactic constraints (no nulls, no array root, bare keys must precede tables) mean conversions through TOML can reorder or fail to represent values produced by JSON/JSON5/YAML. TOML files can therefore only be split into TOML files and reassembled into TOML.
Implementations§
Source§impl Format
impl Format
Sourcepub fn is_cross_format_compatible(self) -> bool
pub fn is_cross_format_compatible(self) -> bool
Whether this format participates in cross-format conversions. TOML is the only format that does not.
Sourcepub fn from_path(path: &Path) -> Result<Self>
pub fn from_path(path: &Path) -> Result<Self>
Best-effort detection of a format from a file path’s extension.
Sourcepub fn parse(self, input: &str) -> Result<Value>
pub fn parse(self, input: &str) -> Result<Value>
Parse a string in this format into a generic Value.
Trait Implementations§
Source§impl From<Format> for SerdeFormat
impl From<Format> for SerdeFormat
Source§impl From<SerdeFormat> for Format
impl From<SerdeFormat> for Format
Source§fn from(f: SerdeFormat) -> Self
fn from(f: SerdeFormat) -> Self
Converts to this type from the input type.
impl Copy for Format
impl Eq for Format
impl StructuralPartialEq for Format
Auto Trait Implementations§
impl Freeze for Format
impl RefUnwindSafe for Format
impl Send for Format
impl Sync for Format
impl Unpin for Format
impl UnsafeUnpin for Format
impl UnwindSafe for Format
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.