pub trait TiffValue {
const BYTE_LEN: u8;
const FIELD_TYPE: Type;
// Required methods
fn count(&self) -> usize;
fn data(&self) -> Cow<'_, [u8]>;
// Provided methods
fn bytes(&self) -> usize { ... }
fn write<W: Write>(&self, writer: &mut TiffWriter<W>) -> TiffResult<()> { ... }
}Expand description
Trait for types that can be encoded in a tiff file
Required Associated Constants§
Required Methods§
Provided Methods§
fn bytes(&self) -> usize
Sourcefn write<W: Write>(&self, writer: &mut TiffWriter<W>) -> TiffResult<()>
fn write<W: Write>(&self, writer: &mut TiffWriter<W>) -> TiffResult<()>
Write this value to a TiffWriter.
While the default implementation will work in all cases, it may require unnecessary allocations.
The written bytes of any custom implementation MUST be the same as yielded by self.data().
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.
Implementations on Foreign Types§
Source§impl TiffValue for [ExtraSamples]
This is implemented for slices as the ExtraSamples tag takes a count of N.
impl TiffValue for [ExtraSamples]
This is implemented for slices as the ExtraSamples tag takes a count of N.
Use core::slice::from_ref if you really need to write a single element.
Source§impl TiffValue for [SampleFormat]
This is implemented for slices as the SampleFormat tag takes a count of N.
impl TiffValue for [SampleFormat]
This is implemented for slices as the SampleFormat tag takes a count of N.
Use core::slice::from_ref if you really need to write a single element.
Source§impl<T, const N: usize> TiffValue for [T; N]
An array is treated like a slice of the same length.
impl<T, const N: usize> TiffValue for [T; N]
An array is treated like a slice of the same length.