pub trait BinaryViewTypeBase: AsRef<BinaryViewType> {
// Required method
fn is_valid_for(&self, data: &BinaryView) -> bool;
// Provided methods
fn is_deprecated(&self) -> bool { ... }
fn is_force_loadable(&self) -> bool { ... }
fn default_load_settings_for_data(
&self,
data: &BinaryView,
) -> Option<Ref<Settings>> { ... }
fn load_settings_for_data(
&self,
_data: &BinaryView,
) -> Option<Ref<Settings>> { ... }
}Required Methods§
Sourcefn is_valid_for(&self, data: &BinaryView) -> bool
fn is_valid_for(&self, data: &BinaryView) -> bool
Is this BinaryViewType valid for the given the raw BinaryView?
Typical implementations will read the magic bytes (e.g. ‘MZ’), this is a performance-sensitive path so prefer inexpensive checks rather than comprehensive ones.
Provided Methods§
Sourcefn is_deprecated(&self) -> bool
fn is_deprecated(&self) -> bool
Is this BinaryViewType deprecated and should not be used?
We specify this such that the view type may still be used by existing databases, but not newly created views.
Sourcefn is_force_loadable(&self) -> bool
fn is_force_loadable(&self) -> bool
Is this BinaryViewType able to be loaded forcefully?
If so, it will be shown in the drop-down when a user opens a file with options.