pub trait OffsetSize:
Copy
+ Default
+ Add<Output = Self>
+ AddAssign
+ Mul<Output = Self>
+ Rem<Output = Self>
+ PartialOrd
+ PartialEq
+ Debug
+ 'static {
const INLINE_THRESHOLD: Self;
const ZERO: Self;
const ONE: Self;
const TWO: Self;
// Required methods
fn checked_add(self, rhs: Self) -> Option<Self>;
fn write_to(self, file: &mut EndianFile) -> Result<()>;
fn from_usize(val: usize) -> Self;
fn to_u64(self) -> u64;
}Expand description
Trait for offset sizes (u32 for TIFF, u64 for BigTIFF).
This trait abstracts over the integer type used for file offsets, allowing the same code to work with both standard TIFF (32-bit offsets) and Big///*TIFF (64-bit offsets).
Required Associated Constants§
Sourceconst INLINE_THRESHOLD: Self
const INLINE_THRESHOLD: Self
The inline value threshold (4 for TIFF, 8 for BigTIFF).
Required Methods§
Sourcefn checked_add(self, rhs: Self) -> Option<Self>
fn checked_add(self, rhs: Self) -> Option<Self>
Checked addition that returns None on overflow.
Sourcefn write_to(self, file: &mut EndianFile) -> Result<()>
fn write_to(self, file: &mut EndianFile) -> Result<()>
Write this offset value to an EndianFile.
Sourcefn from_usize(val: usize) -> Self
fn from_usize(val: usize) -> Self
Convert from usize (for lengths).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.