pub enum Format {
Json,
}Variants§
Json
Implementations§
Source§impl Format
impl Format
Sourcepub fn from_path<P: AsRef<Path>>(path: P) -> Option<Format>
pub fn from_path<P: AsRef<Path>>(path: P) -> Option<Format>
Format implied by a file extension; None if unrecognised.
Sourcepub fn detect(content: &str) -> Format
pub fn detect(content: &str) -> Format
Format sniffed from document content: a leading < means XML.
Without the xml feature everything is treated as JSON (and XML
input then fails JSON parsing with a clear error).
pub fn extension(&self) -> &'static str
Trait Implementations§
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