#[non_exhaustive]pub struct DetectOptions {
pub base: u64,
pub len: Option<u64>,
}Expand description
Where to look for a filesystem, and anything else detection needs to be told.
Every input to detect_with is a field here rather than a parameter, so an input
detection grows arrives as a field a caller may ignore.
// The filesystem in a 16 MiB partition that begins one mebibyte into a whole-disk image.
let options = DetectOptions::new().base(1 << 20).len(16 << 20);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.base: u64Byte offset within the source at which the filesystem begins — zero for a bare image, the partition’s start for one inside a disk image, and wherever a carver located a candidate region.
Offset is a first-class concept everywhere a filesystem is read, and it is one here for the same reason: the question detection answers is “what is at this location”, which a classifier fixed to the start of its source cannot be asked.
len: Option<u64>How many bytes from base on the region holds, or None for every byte
to the source’s end — the same region
OpenOptions::len names to a reader.
Detection reads through the region alone: the source ends at the region’s end, so no byte past it is read as the filesystem’s.
Implementations§
Source§impl DetectOptions
impl DetectOptions
Trait Implementations§
Source§impl Clone for DetectOptions
impl Clone for DetectOptions
Source§fn clone(&self) -> DetectOptions
fn clone(&self) -> DetectOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more