pub struct FormatMeta {
pub id: FormatId,
pub kind: FormatKind,
pub extensions: &'static [&'static str],
pub magics: &'static [MagicRule],
pub priority: i16,
}Expand description
Registration metadata for one format.
Fields§
§id: FormatId§kind: FormatKind§extensions: &'static [&'static str]Extensions without the leading dot, lowercase. e.g. ["gz", "tgz"].
magics: &'static [MagicRule]§priority: i16Breaks ties when several formats share a magic. Higher wins.
The ZIP family is why this exists: jar, apk, docx, epub, odt and zip all
begin PK\x03\x04, so longest-magic-wins cannot separate them. Rank the
base format above its derivatives, and a bare stream resolves to the
base while a derivative is reached by extension.
Implementations§
Source§impl FormatMeta
impl FormatMeta
Trait Implementations§
Source§impl Clone for FormatMeta
impl Clone for FormatMeta
Source§fn clone(&self) -> FormatMeta
fn clone(&self) -> FormatMeta
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for FormatMeta
Auto Trait Implementations§
impl Freeze for FormatMeta
impl RefUnwindSafe for FormatMeta
impl Send for FormatMeta
impl Sync for FormatMeta
impl Unpin for FormatMeta
impl UnsafeUnpin for FormatMeta
impl UnwindSafe for FormatMeta
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