pub struct Lookup {
pub globs: Globs,
pub magic: Magic,
pub types: Types,
}Expand description
The whole database: names, contents, and the type graph.
Fields§
§globs: Globs§magic: Magic§types: TypesImplementations§
Source§impl Lookup
impl Lookup
Sourcepub fn load_from(data_dirs: &[PathBuf]) -> Lookup
pub fn load_from(data_dirs: &[PathBuf]) -> Lookup
Reads every part of the database from the given data directories.
Sourcepub fn of_file(&self, path: &Path, follow: bool) -> Found
pub fn of_file(&self, path: &Path, follow: bool) -> Found
What this file is, reading it if the name does not settle it.
follow decides whether a symlink is reported as itself or as
what it points at.
Sourcepub fn of_data_and_name(&self, data: &[u8], path: Option<&Path>) -> Found
pub fn of_data_and_name(&self, data: &[u8], path: Option<&Path>) -> Found
The same question for bytes already in hand, with the name if there is one — a paste, a download, or standard input.
Sourcepub fn is_subclass_of(&self, mime: &str, parent: &str) -> bool
pub fn is_subclass_of(&self, mime: &str, parent: &str) -> bool
Whether an application registered for parent can be expected to
open a mime — the subclass question, asked the way a caller
means it.
Trait Implementations§
impl Eq for Lookup
impl StructuralPartialEq for Lookup
Auto Trait Implementations§
impl Freeze for Lookup
impl RefUnwindSafe for Lookup
impl Send for Lookup
impl Sync for Lookup
impl Unpin for Lookup
impl UnsafeUnpin for Lookup
impl UnwindSafe for Lookup
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