Skip to main content

TagValue

Enum TagValue 

Source
#[non_exhaustive]
pub enum TagValue {
Show 18 variants Byte(u8), Short(u16), SignedByte(i8), SignedShort(i16), Signed(i32), SignedBig(i64), Unsigned(u32), UnsignedBig(u64), Float(f32), Double(f64), List(Vec<TagValue>), Rational(u32, u32), RationalBig(u64, u64), SRational(i32, i32), SRationalBig(i64, i64), Ascii(String), Ifd(u32), IfdBig(u64),
}
Expand description

A dynamically-typed value parsed from a TIFF IFD entry.

Each variant corresponds to one of the TIFF data types. Multi-value entries are represented as TagValue::List.

Conversion methods like into_u16 and into_f64_vec handle widening casts and return an error on type mismatches.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Byte(u8)

8-bit unsigned integer (TIFF type BYTE).

§

Short(u16)

16-bit unsigned integer (TIFF type SHORT).

§

SignedByte(i8)

8-bit signed integer (TIFF type SBYTE).

§

SignedShort(i16)

16-bit signed integer (TIFF type SSHORT).

§

Signed(i32)

32-bit signed integer (TIFF type SLONG).

§

SignedBig(i64)

64-bit signed integer (BigTIFF type SLONG8).

§

Unsigned(u32)

32-bit unsigned integer (TIFF type LONG).

§

UnsignedBig(u64)

64-bit unsigned integer (BigTIFF type LONG8).

§

Float(f32)

32-bit IEEE floating point (TIFF type FLOAT).

§

Double(f64)

64-bit IEEE floating point (TIFF type DOUBLE).

§

List(Vec<TagValue>)

A sequence of values from a multi-count IFD entry.

§

Rational(u32, u32)

Unsigned rational: numerator and denominator (TIFF type RATIONAL).

§

RationalBig(u64, u64)

Unsigned rational with 64-bit components (BigTIFF).

§

SRational(i32, i32)

Signed rational: numerator and denominator (TIFF type SRATIONAL).

§

SRationalBig(i64, i64)

Signed rational with 64-bit components (BigTIFF).

§

Ascii(String)

ASCII string parsed from TIFF type ASCII

§

Ifd(u32)

32-bit IFD offset (TIFF type IFD).

§

IfdBig(u64)

64-bit IFD offset (BigTIFF type IFD8).

Implementations§

Source§

impl TagValue

Source

pub fn into_u8(self) -> TiffResult<u8>

Convert this TagValue into a u8, returning an error if the type is incompatible.

Source

pub fn into_i8(self) -> TiffResult<i8>

Convert this TagValue into an i8, returning an error if the type is incompatible.

Source

pub fn into_u16(self) -> TiffResult<u16>

Convert this TagValue into a u16, returning an error if the type is incompatible.

Source

pub fn into_i16(self) -> TiffResult<i16>

Convert this TagValue into an i16, returning an error if the type is incompatible.

Source

pub fn into_u32(self) -> TiffResult<u32>

Convert this TagValue into a u32, returning an error if the type is incompatible.

Source

pub fn into_i32(self) -> TiffResult<i32>

Convert this TagValue into an i32, returning an error if the type is incompatible.

Source

pub fn into_u64(self) -> TiffResult<u64>

Convert this TagValue into a u64, returning an error if the type is incompatible.

Source

pub fn into_i64(self) -> TiffResult<i64>

Convert this TagValue into an i64, returning an error if the type is incompatible.

Source

pub fn into_f32(self) -> TiffResult<f32>

Convert this TagValue into a f32, returning an error if the type is incompatible.

Source

pub fn into_f64(self) -> TiffResult<f64>

Convert this TagValue into a f64, returning an error if the type is incompatible.

Source

pub fn into_string(self) -> TiffResult<String>

Convert this TagValue into a String, returning an error if the type is incompatible.

Source

pub fn into_u32_vec(self) -> TiffResult<Vec<u32>>

Convert this TagValue into a Vec<u32>, returning an error if the type is incompatible.

Source

pub fn into_u8_vec(self) -> TiffResult<Vec<u8>>

Convert this TagValue into a Vec<u8>, returning an error if the type is incompatible.

Source

pub fn into_u16_vec(self) -> TiffResult<Vec<u16>>

Convert this TagValue into a Vec<u16>, returning an error if the type is incompatible.

Source

pub fn into_i32_vec(self) -> TiffResult<Vec<i32>>

Convert this TagValue into a Vec<i32>, returning an error if the type is incompatible.

Source

pub fn into_f32_vec(self) -> TiffResult<Vec<f32>>

Convert this TagValue into a Vec<f32>, returning an error if the type is incompatible.

Source

pub fn into_f64_vec(self) -> TiffResult<Vec<f64>>

Convert this TagValue into a Vec<f64>, returning an error if the type is incompatible.

Source

pub fn into_u64_vec(self) -> TiffResult<Vec<u64>>

Convert this TagValue into a Vec<u64>, returning an error if the type is incompatible.

Source

pub fn into_i64_vec(self) -> TiffResult<Vec<i64>>

Convert this TagValue into a Vec<i64>, returning an error if the type is incompatible.

Trait Implementations§

Source§

impl Clone for TagValue

Source§

fn clone(&self) -> TagValue

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TagValue

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for TagValue

Source§

fn eq(&self, other: &TagValue) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for TagValue

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more