pub trait Format: Send + Sync {
// Required methods
fn extensions(&self) -> &'static [&'static str];
fn parse<T: DeserializeOwned>(&self, input: &[u8]) -> Result<T, FmtError>;
}Expand description
Abstract format parser that converts bytes into a structured object.
Note: This trait is not object-safe due to the generic parse method.
Use format::AnyFormat for dynamic dispatch.
Required Methods§
Sourcefn extensions(&self) -> &'static [&'static str]
fn extensions(&self) -> &'static [&'static str]
List of supported extensions or identifiers.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.