pub trait Rules {
Show 17 methods
// Required methods
fn follows(&self, w: &Walk<'_>, parent: &Ifd, kind: Kind, e: &Entry) -> bool;
fn follows_next(&self, w: &Walk<'_>, ifd: &Ifd, kind: Kind) -> bool;
fn ifd(&self, w: &Walk<'_>, ifd: &Ifd) -> Fate;
fn entry(&self, w: &Walk<'_>, ifd: &Ifd, index: usize) -> Fate;
fn image_data(&self, w: &Walk<'_>, ifd: &Ifd) -> Fate;
fn jpeg_stream(&self, w: &Walk<'_>, ifd: &Ifd) -> Fate;
// Provided methods
fn magic(&self, _magic: u16) -> bool { ... }
fn header_extension(&self, _w: &Walk<'_>) -> Option<(u64, Fate)> { ... }
fn value_tail(
&self,
_w: &Walk<'_>,
_ifd: &Ifd,
_index: usize,
) -> Option<(u64, Fate)> { ... }
fn chunk_use(
&self,
w: &Walk<'_>,
ifd: &Ifd,
tiles: bool,
offs: &[u64],
cnts: &[u64],
) -> Vec<ChunkUse> { ... }
fn pointer(&self, kind: Kind, e: &Entry) -> Option<(Kind, &'static str)> { ... }
fn pointer_offsets(&self, w: &Walk<'_>, e: &Entry, max: usize) -> Vec<u64> { ... }
fn value(&self, w: &Walk<'_>, ifd: &Ifd, index: usize) -> Fate { ... }
fn jpeg_table(&self, _w: &Walk<'_>, _ifd: &Ifd, _tag: u16) -> Fate { ... }
fn cancelled(&self) -> bool { ... }
fn rejects(
&self,
_w: &Walk<'_>,
_at: u64,
_kind: Kind,
) -> Option<&'static str> { ... }
fn extents(&self, w: &Walk<'_>, ifd: &Ifd) -> Vec<ExtentRule> { ... }
}Expand description
What one decode path does with a TIFF’s directories, entries and extents.
Required Methods§
Sourcefn follows(&self, w: &Walk<'_>, parent: &Ifd, kind: Kind, e: &Entry) -> bool
fn follows(&self, w: &Walk<'_>, parent: &Ifd, kind: Kind, e: &Entry) -> bool
Whether the decode path reads the directory the pointer entry e of
parent, reached as a kind directory, leads to.
Sourcefn follows_next(&self, w: &Walk<'_>, ifd: &Ifd, kind: Kind) -> bool
fn follows_next(&self, w: &Walk<'_>, ifd: &Ifd, kind: Kind) -> bool
Whether the decode path reads the directory the next pointer of
ifd, reached as a kind directory, leads to.
fn ifd(&self, w: &Walk<'_>, ifd: &Ifd) -> Fate
Sourcefn entry(&self, w: &Walk<'_>, ifd: &Ifd, index: usize) -> Fate
fn entry(&self, w: &Walk<'_>, ifd: &Ifd, index: usize) -> Fate
The entry (and, unless value says otherwise, its
out-of-line value).
Sourcefn image_data(&self, w: &Walk<'_>, ifd: &Ifd) -> Fate
fn image_data(&self, w: &Walk<'_>, ifd: &Ifd) -> Fate
Strips and tiles.
Sourcefn jpeg_stream(&self, w: &Walk<'_>, ifd: &Ifd) -> Fate
fn jpeg_stream(&self, w: &Walk<'_>, ifd: &Ifd) -> Fate
A JPEG stream located by JPEGInterchangeFormat (513/514).
Provided Methods§
Sourcefn magic(&self, _magic: u16) -> bool
fn magic(&self, _magic: u16) -> bool
Accept a TIFF version number other than 42 and 43 (ORF, RW2).
Sourcefn header_extension(&self, _w: &Walk<'_>) -> Option<(u64, Fate)>
fn header_extension(&self, _w: &Walk<'_>) -> Option<(u64, Fate)>
Bytes after the classic 8-byte header that the file format defines (CR2), and what the decode path does with them.
Sourcefn value_tail(
&self,
_w: &Walk<'_>,
_ifd: &Ifd,
_index: usize,
) -> Option<(u64, Fate)>
fn value_tail( &self, _w: &Walk<'_>, _ifd: &Ifd, _index: usize, ) -> Option<(u64, Fate)>
For a value the decode path consumes only in part: how many leading bytes it uses, and the fate of the rest (an ASCII value’s bytes after its NUL, for example).
Sourcefn chunk_use(
&self,
w: &Walk<'_>,
ifd: &Ifd,
tiles: bool,
offs: &[u64],
cnts: &[u64],
) -> Vec<ChunkUse>
fn chunk_use( &self, w: &Walk<'_>, ifd: &Ifd, tiles: bool, offs: &[u64], cnts: &[u64], ) -> Vec<ChunkUse>
How much of each strip or tile, located at offs with declared
lengths cnts, the decoder reads. The default follows image-tiff:
default_chunk_use.
Sourcefn pointer(&self, kind: Kind, e: &Entry) -> Option<(Kind, &'static str)>
fn pointer(&self, kind: Kind, e: &Entry) -> Option<(Kind, &'static str)>
The directory pointer entry e in a kind IFD leads to.
Sourcefn pointer_offsets(&self, w: &Walk<'_>, e: &Entry, max: usize) -> Vec<u64>
fn pointer_offsets(&self, w: &Walk<'_>, e: &Entry, max: usize) -> Vec<u64>
The TIFF-relative offsets a pointer entry holds, at most max of
them (the walk reads only as many as it can still queue).
Sourcefn jpeg_table(&self, _w: &Walk<'_>, _ifd: &Ifd, _tag: u16) -> Fate
fn jpeg_table(&self, _w: &Walk<'_>, _ifd: &Ifd, _tag: u16) -> Fate
External old-style JPEG tables (519, 520 or 521). Locating a table does not establish that the decoder uses it: an embedded JPEG header can supply tables instead. The default deliberately leaves consumption unknown, independently of strips and JPEGInterchangeFormat streams.
Override only when the codec’s rules establish the same disposition for every table reached by this tag. This is not privacy evidence.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".