pub struct Rational {
pub n: u32,
pub d: u32,
}
Expand description
Type to represent tiff values of type RATIONAL
Fields§
§n: u32
§d: u32
Trait Implementations§
source§impl TiffValue for Rational
impl TiffValue for Rational
const BYTE_LEN: u8 = 8u8
const FIELD_TYPE: Type = Type::RATIONAL
fn count(&self) -> usize
source§fn 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()
.source§fn data(&self) -> Cow<'_, [u8]>
fn data(&self) -> Cow<'_, [u8]>
Access this value as an contiguous sequence of bytes.
If their is no trivial representation, allocate it on the heap.
fn bytes(&self) -> usize
Auto Trait Implementations§
impl Freeze for Rational
impl RefUnwindSafe for Rational
impl Send for Rational
impl Sync for Rational
impl Unpin for Rational
impl UnwindSafe for Rational
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more