Debian Codegraph @

src/decoder/ifd.rs

raw symbols SCIP
1 //! Function for reading TIFF tags
2
3 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::collectionsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/::HashMaprust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/HashMap#;
4 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::{selfrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/, Readrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Read#, Seekrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Seek#};
5 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/;
6 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/;
7
8 use superrust-analyzer cargo tiff 0.11.3 decoder/::streamrust-analyzer cargo tiff 0.11.3 decoder/stream/::{ByteOrderrust-analyzer cargo tiff 0.11.3 tags/ByteOrder#, EndianReaderrust-analyzer cargo tiff 0.11.3 decoder/stream/EndianReader#};
9 use craterust-analyzer cargo tiff 0.11.3 crate/::tagsrust-analyzer cargo tiff 0.11.3 tags/::{IfdPointerrust-analyzer cargo tiff 0.11.3 tags/IfdPointer#, Tagrust-analyzer cargo tiff 0.11.3 tags/Tag#, Typerust-analyzer cargo tiff 0.11.3 tags/Type#, ValueBufferrust-analyzer cargo tiff 0.11.3 tags/ValueBuffer#};
10 use craterust-analyzer cargo tiff 0.11.3 crate/::{TiffErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#, TiffFormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#, TiffResultrust-analyzer cargo tiff 0.11.3 error/TiffResult#};
11
12 use selfrust-analyzer cargo tiff 0.11.3 decoder/ifd/::Valuerust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#::{
13 Asciirust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Ascii#, Byterust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Byte#, Doublerust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Double#, Floatrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Float#, Ifdrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Ifd#, IfdBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#IfdBig#, Listrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#List#, Rationalrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Rational#, SRationalrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SRational#, Shortrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Short#, Signedrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Signed#, SignedBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SignedBig#,
14 SignedByterust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SignedByte#, SignedShortrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SignedShort#, Unsignedrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Unsigned#, UnsignedBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#UnsignedBig#,
15 };
16
17 #[allow(unused_qualifications)]
18 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:)]
19 #[non_exhaustive]
20 pub enum Valuerust-analyzer cargo tiff 0.11.3 decoder/ifd/Value# {
21 Byterust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Byte#(u8),
22 Shortrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Short#(u16),
23 SignedByterust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SignedByte#(i8),
24 SignedShortrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SignedShort#(i16),
25 Signedrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Signed#(i32),
26 SignedBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SignedBig#(i64),
27 Unsignedrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Unsigned#(u32),
28 UnsignedBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#UnsignedBig#(u64),
29 Floatrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Float#(f32),
30 Doublerust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Double#(f64),
31 Listrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#List#(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Valuerust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#>),
32 Rationalrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Rational#(u32, u32),
33 #[deprecated(
34 note = "Not implemented in BigTIFF with a standard tag value",
35 since = "0.11.1"
36 )]
37 RationalBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#RationalBig#(u64, u64),
38 SRationalrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SRational#(i32, i32),
39 #[deprecated(
40 note = "Not implemented in BigTIFF with a standard tag value",
41 since = "0.11.1"
42 )]
43 SRationalBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SRationalBig#(i64, i64),
44 Asciirust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Ascii#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#),
45 Ifdrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Ifd#(u32),
46 IfdBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#IfdBig#(u64),
47 }
48
49 impl Valuerust-analyzer cargo tiff 0.11.3 decoder/ifd/Value# {
50 pub fn into_u8rust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Value]into_u8().(self) -> TiffResultrust-analyzer cargo tiff 0.11.3 error/TiffResult#<u8> {
51 match self {
52 Byterust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Byte#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(val),
53 _ => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(TiffErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#::FormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#FormatError#(TiffFormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#::InvalidTypeForTagrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#InvalidTypeForTag#)),
54 }
55 }
56 pub fn into_i8rust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Value]into_i8().(self) -> TiffResultrust-analyzer cargo tiff 0.11.3 error/TiffResult#<i8> {
57 match self {
58 SignedByterust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SignedByte#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(val),
59 _ => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(TiffErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#::FormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#FormatError#(TiffFormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#::InvalidTypeForTagrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#InvalidTypeForTag#)),
60 }
61 }
62
63 pub fn into_u16rust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Value]into_u16().(self) -> TiffResultrust-analyzer cargo tiff 0.11.3 error/TiffResult#<u16> {
64 match self {
65 Byterust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Byte#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(val.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()),
66 Shortrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Short#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(val),
67 Unsignedrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Unsigned#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(u16::try_fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[u16][`TryFrom<u32>`]try_from().(val)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().),
68 UnsignedBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#UnsignedBig#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(u16::try_fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[u16][`TryFrom<u64>`]try_from().(val)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().),
69 _ => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(TiffErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#::FormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#FormatError#(TiffFormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#::InvalidTypeForTagrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#InvalidTypeForTag#)),
70 }
71 }
72
73 pub fn into_i16rust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Value]into_i16().(self) -> TiffResultrust-analyzer cargo tiff 0.11.3 error/TiffResult#<i16> {
74 match self {
75 SignedByterust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SignedByte#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(val.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()),
76 SignedShortrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SignedShort#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(val),
77 Signedrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Signed#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(i16::try_fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[i16][`TryFrom<i32>`]try_from().(val)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().),
78 SignedBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SignedBig#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(i16::try_fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[i16][`TryFrom<i64>`]try_from().(val)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().),
79 _ => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(TiffErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#::FormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#FormatError#(TiffFormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#::InvalidTypeForTagrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#InvalidTypeForTag#)),
80 }
81 }
82
83 pub fn into_u32rust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Value]into_u32().(self) -> TiffResultrust-analyzer cargo tiff 0.11.3 error/TiffResult#<u32> {
84 match self {
85 Byterust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Byte#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(val.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()),
86 Shortrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Short#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(val.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()),
87 Unsignedrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Unsigned#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(val),
88 UnsignedBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#UnsignedBig#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(u32::try_fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[u32][`TryFrom<u64>`]try_from().(val)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().),
89 Ifdrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Ifd#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(val),
90 IfdBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#IfdBig#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(u32::try_fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[u32][`TryFrom<u64>`]try_from().(val)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().),
91 _ => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(TiffErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#::FormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#FormatError#(TiffFormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#::InvalidTypeForTagrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#InvalidTypeForTag#)),
92 }
93 }
94
95 pub fn into_i32rust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Value]into_i32().(self) -> TiffResultrust-analyzer cargo tiff 0.11.3 error/TiffResult#<i32> {
96 match self {
97 SignedByterust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SignedByte#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(val.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()),
98 SignedShortrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SignedShort#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(val.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()),
99 Signedrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Signed#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(val),
100 SignedBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SignedBig#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(i32::try_fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[i32][`TryFrom<i64>`]try_from().(val)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().),
101 _ => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(TiffErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#::FormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#FormatError#(TiffFormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#::InvalidTypeForTagrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#InvalidTypeForTag#)),
102 }
103 }
104
105 pub fn into_u64rust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Value]into_u64().(self) -> TiffResultrust-analyzer cargo tiff 0.11.3 error/TiffResult#<u64> {
106 match self {
107 Byterust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Byte#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(val.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()),
108 Shortrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Short#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(val.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()),
109 Unsignedrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Unsigned#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(val.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()),
110 UnsignedBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#UnsignedBig#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(val),
111 Ifdrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Ifd#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(val.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()),
112 IfdBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#IfdBig#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(val),
113 _ => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(TiffErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#::FormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#FormatError#(TiffFormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#::InvalidTypeForTagrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#InvalidTypeForTag#)),
114 }
115 }
116
117 pub fn into_i64rust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Value]into_i64().(self) -> TiffResultrust-analyzer cargo tiff 0.11.3 error/TiffResult#<i64> {
118 match self {
119 SignedByterust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SignedByte#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(val.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()),
120 SignedShortrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SignedShort#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(val.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()),
121 Signedrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Signed#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(val.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()),
122 SignedBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SignedBig#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(val),
123 _ => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(TiffErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#::FormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#FormatError#(TiffFormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#::InvalidTypeForTagrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#InvalidTypeForTag#)),
124 }
125 }
126
127 pub fn into_f32rust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Value]into_f32().(self) -> TiffResultrust-analyzer cargo tiff 0.11.3 error/TiffResult#<f32> {
128 match self {
129 Floatrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Float#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(val),
130 _ => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(TiffErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#::FormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#FormatError#(TiffFormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#::InvalidTypeForTagrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#InvalidTypeForTag#)),
131 }
132 }
133
134 pub fn into_f64rust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Value]into_f64().(self) -> TiffResultrust-analyzer cargo tiff 0.11.3 error/TiffResult#<f64> {
135 match self {
136 Doublerust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Double#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(val),
137 _ => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(TiffErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#::FormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#FormatError#(TiffFormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#::InvalidTypeForTagrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#InvalidTypeForTag#)),
138 }
139 }
140
141 /// Turn this value into an `IfdPointer`.
142 ///
143 /// Notice that this does not take an argument, a 64-bit IFD is always allowed. If the
144 /// difference is crucial and you do not want to be permissive you're expected to filter this
145 /// out before.
146 ///
147 /// For compatibility the smaller sized tags should always be allowed i.e. you might use a
148 /// non-bigtiff's directory and its tag types and move it straight to a bigtiff. For instance
149 /// the SubIFD tag is defined as `LONG or IFD`:
150 ///
151 /// <https://web.archive.org/web/20181105221012/https://www.awaresystems.be/imaging/tiff/tifftags/subifds.html>
152 pub fn into_ifd_pointerrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Value]into_ifd_pointer().(self) -> TiffResultrust-analyzer cargo tiff 0.11.3 error/TiffResult#<IfdPointerrust-analyzer cargo tiff 0.11.3 tags/IfdPointer#> {
153 match self {
154 Unsignedrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Unsigned#(val) | Ifdrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Ifd#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(IfdPointerrust-analyzer cargo tiff 0.11.3 tags/IfdPointer#(val.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().())),
155 IfdBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#IfdBig#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(IfdPointerrust-analyzer cargo tiff 0.11.3 tags/IfdPointer#(val)),
156 _ => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(TiffErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#::FormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#FormatError#(TiffFormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#::InvalidTypeForTagrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#InvalidTypeForTag#)),
157 }
158 }
159
160 pub fn into_stringrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Value]into_string().(self) -> TiffResultrust-analyzer cargo tiff 0.11.3 error/TiffResult#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#> {
161 match self {
162 Asciirust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Ascii#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(val),
163 _ => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(TiffErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#::FormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#FormatError#(TiffFormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#::InvalidTypeForTagrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#InvalidTypeForTag#)),
164 }
165 }
166
167 pub fn into_u32_vecrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Value]into_u32_vec().(self) -> TiffResultrust-analyzer cargo tiff 0.11.3 error/TiffResult#<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u32>> {
168 match self {
169 Listrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#List#(vec) => {
170 let mut new_vec = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::with_capacityrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]with_capacity().(vec.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().());
171 for v in vec {
172 new_vec.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(v.into_u32rust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Value]into_u32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().)
173 }
174 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(new_vec)
175 }
176 Byterust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Byte#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![val.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()]),
177 Shortrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Short#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![val.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()]),
178 Unsignedrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Unsigned#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![val]),
179 UnsignedBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#UnsignedBig#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![u32::try_fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[u32][`TryFrom<u64>`]try_from().(val)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().]),
180 Rationalrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Rational#(numerator, denominator) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![numerator, denominator]),
181 #[expect(deprecated)]
182 Valuerust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#::RationalBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#RationalBig#(numerator, denominator) => {
183 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![u32::try_fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[u32][`TryFrom<u64>`]try_from().(numerator)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., u32::try_fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[u32][`TryFrom<u64>`]try_from().(denominator)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().])
184 }
185 Ifdrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Ifd#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![val]),
186 IfdBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#IfdBig#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![u32::try_fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[u32][`TryFrom<u64>`]try_from().(val)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().]),
187 Asciirust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Ascii#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(val.charsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]chars().().maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(u32::fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core char/convert/impl#[u32][`From<char>`]from().).collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().()),
188 _ => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(TiffErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#::FormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#FormatError#(TiffFormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#::InvalidTypeForTagrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#InvalidTypeForTag#)),
189 }
190 }
191
192 pub fn into_u8_vecrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Value]into_u8_vec().(self) -> TiffResultrust-analyzer cargo tiff 0.11.3 error/TiffResult#<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8>> {
193 match self {
194 Listrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#List#(vec) => {
195 let mut new_vec = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::with_capacityrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]with_capacity().(vec.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().());
196 for v in vec {
197 new_vec.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(v.into_u8rust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Value]into_u8().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().)
198 }
199 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(new_vec)
200 }
201 Byterust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Byte#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![val]),
202
203 _ => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(TiffErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#::FormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#FormatError#(TiffFormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#::InvalidTypeForTagrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#InvalidTypeForTag#)),
204 }
205 }
206
207 pub fn into_u16_vecrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Value]into_u16_vec().(self) -> TiffResultrust-analyzer cargo tiff 0.11.3 error/TiffResult#<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u16>> {
208 match self {
209 Listrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#List#(vec) => {
210 let mut new_vec = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::with_capacityrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]with_capacity().(vec.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().());
211 for v in vec {
212 new_vec.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(v.into_u16rust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Value]into_u16().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().)
213 }
214 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(new_vec)
215 }
216 Byterust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Byte#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![val.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()]),
217 Shortrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Short#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![val]),
218 _ => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(TiffErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#::FormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#FormatError#(TiffFormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#::InvalidTypeForTagrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#InvalidTypeForTag#)),
219 }
220 }
221
222 pub fn into_i32_vecrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Value]into_i32_vec().(self) -> TiffResultrust-analyzer cargo tiff 0.11.3 error/TiffResult#<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<i32>> {
223 match self {
224 Listrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#List#(vec) => {
225 let mut new_vec = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::with_capacityrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]with_capacity().(vec.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().());
226 for v in vec {
227 match v {
228 SRationalrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SRational#(numerator, denominator) => {
229 new_vec.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(numerator);
230 new_vec.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(denominator);
231 }
232 #[expect(deprecated)]
233 Valuerust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#::SRationalBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SRationalBig#(numerator, denominator) => {
234 new_vec.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(i32::try_fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[i32][`TryFrom<i64>`]try_from().(numerator)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().);
235 new_vec.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(i32::try_fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[i32][`TryFrom<i64>`]try_from().(denominator)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().);
236 }
237 _ => new_vec.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(v.into_i32rust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Value]into_i32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().),
238 }
239 }
240 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(new_vec)
241 }
242 SignedByterust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SignedByte#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![val.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()]),
243 SignedShortrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SignedShort#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![val.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()]),
244 Signedrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Signed#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![val]),
245 SignedBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SignedBig#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![i32::try_fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[i32][`TryFrom<i64>`]try_from().(val)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().]),
246 SRationalrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SRational#(numerator, denominator) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![numerator, denominator]),
247 #[expect(deprecated)]
248 Valuerust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#::SRationalBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SRationalBig#(numerator, denominator) => {
249 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![i32::try_fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[i32][`TryFrom<i64>`]try_from().(numerator)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., i32::try_fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[i32][`TryFrom<i64>`]try_from().(denominator)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().])
250 }
251 _ => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(TiffErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#::FormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#FormatError#(TiffFormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#::InvalidTypeForTagrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#InvalidTypeForTag#)),
252 }
253 }
254
255 pub fn into_f32_vecrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Value]into_f32_vec().(self) -> TiffResultrust-analyzer cargo tiff 0.11.3 error/TiffResult#<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<f32>> {
256 match self {
257 Listrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#List#(vec) => {
258 let mut new_vec = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::with_capacityrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]with_capacity().(vec.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().());
259 for v in vec {
260 new_vec.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(v.into_f32rust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Value]into_f32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().)
261 }
262 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(new_vec)
263 }
264 Floatrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Float#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![val]),
265 _ => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(TiffErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#::FormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#FormatError#(TiffFormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#::InvalidTypeForTagrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#InvalidTypeForTag#)),
266 }
267 }
268
269 pub fn into_f64_vecrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Value]into_f64_vec().(self) -> TiffResultrust-analyzer cargo tiff 0.11.3 error/TiffResult#<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<f64>> {
270 match self {
271 Listrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#List#(vec) => {
272 let mut new_vec = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::with_capacityrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]with_capacity().(vec.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().());
273 for v in vec {
274 new_vec.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(v.into_f64rust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Value]into_f64().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().)
275 }
276 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(new_vec)
277 }
278 Doublerust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Double#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![val]),
279 _ => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(TiffErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#::FormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#FormatError#(TiffFormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#::InvalidTypeForTagrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#InvalidTypeForTag#)),
280 }
281 }
282
283 pub fn into_u64_vecrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Value]into_u64_vec().(self) -> TiffResultrust-analyzer cargo tiff 0.11.3 error/TiffResult#<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u64>> {
284 match self {
285 Listrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#List#(vec) => {
286 let mut new_vec = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::with_capacityrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]with_capacity().(vec.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().());
287 for v in vec {
288 new_vec.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(v.into_u64rust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Value]into_u64().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().)
289 }
290 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(new_vec)
291 }
292 Byterust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Byte#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![val.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()]),
293 Shortrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Short#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![val.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()]),
294 Unsignedrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Unsigned#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![val.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()]),
295 UnsignedBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#UnsignedBig#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![val]),
296 Rationalrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Rational#(numerator, denominator) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![numerator.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), denominator.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()]),
297 #[expect(deprecated)]
298 Valuerust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#::RationalBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#RationalBig#(numerator, denominator) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![numerator, denominator]),
299 Ifdrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Ifd#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![val.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()]),
300 IfdBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#IfdBig#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![val]),
301 Asciirust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Ascii#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(val.charsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]chars().().maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(u32::fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core char/convert/impl#[u32][`From<char>`]from().).maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(u64::fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[u64][`From<u32>`]from().).collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().()),
302 _ => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(TiffErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#::FormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#FormatError#(TiffFormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#::InvalidTypeForTagrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#InvalidTypeForTag#)),
303 }
304 }
305
306 pub fn into_i64_vecrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Value]into_i64_vec().(self) -> TiffResultrust-analyzer cargo tiff 0.11.3 error/TiffResult#<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<i64>> {
307 match self {
308 Listrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#List#(vec) => {
309 let mut new_vec = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::with_capacityrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]with_capacity().(vec.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().());
310 for v in vec {
311 match v {
312 SRationalrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SRational#(numerator, denominator) => {
313 new_vec.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(numerator.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().());
314 new_vec.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(denominator.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().());
315 }
316 #[expect(deprecated)]
317 Valuerust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#::SRationalBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SRationalBig#(numerator, denominator) => {
318 new_vec.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(numerator);
319 new_vec.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(denominator);
320 }
321 _ => new_vec.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(v.into_i64rust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Value]into_i64().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().),
322 }
323 }
324 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(new_vec)
325 }
326 SignedByterust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SignedByte#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![val.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()]),
327 SignedShortrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SignedShort#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![val.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()]),
328 Signedrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Signed#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![val.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()]),
329 SignedBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SignedBig#(val) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![val]),
330 SRationalrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SRational#(numerator, denominator) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![numerator.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), denominator.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()]),
331 #[expect(deprecated)]
332 Valuerust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#::SRationalBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SRationalBig#(numerator, denominator) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![numerator, denominator]),
333 _ => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(TiffErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#::FormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#FormatError#(TiffFormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#::InvalidTypeForTagrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#InvalidTypeForTag#)),
334 }
335 }
336
337 pub fn into_ifd_vecrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Value]into_ifd_vec().(self) -> TiffResultrust-analyzer cargo tiff 0.11.3 error/TiffResult#<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<IfdPointerrust-analyzer cargo tiff 0.11.3 tags/IfdPointer#>> {
338 let vec = match self {
339 Unsignedrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Unsigned#(val) | Ifdrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Ifd#(val) => return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![IfdPointerrust-analyzer cargo tiff 0.11.3 tags/IfdPointer#(val.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().())]),
340 IfdBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#IfdBig#(val) => return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![IfdPointerrust-analyzer cargo tiff 0.11.3 tags/IfdPointer#(val)]),
341 Listrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#List#(vec) => vec,
342 _ => return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(TiffErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#::FormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#FormatError#(TiffFormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#::InvalidTypeForTagrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#InvalidTypeForTag#)),
343 };
344
345 vec.into_iterrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][IntoIterator]into_iter().().maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(Selfrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Value]::into_ifd_pointerrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Value]into_ifd_pointer().).collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().()
346 }
347 }
348
349 /// A combination of type, count, and offset.
350 ///
351 /// In a TIFF the data offset portion of an entry is used for inline data in case the length of the
352 /// encoded value does not exceed the size of the offset field. Since the size of the offset field
353 /// depends on the file kind (4 bytes for standard TIFF, 8 bytes for BigTIFF) the interpretation of
354 /// this struct is only complete in combination with file metadata.
355 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:)]
356 pub struct Entryrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry# {
357 type_rust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#type_.: Typerust-analyzer cargo tiff 0.11.3 tags/Type#,
358 countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count.: u64,
359 offsetrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#offset.: [u8; 8],
360 }
361
362 impl ::stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug# for Entryrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry# {
363 fn fmtrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry][Debug]fmt().(&self, fmt: &mut ::stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), ::stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Error#> {
364 fmt.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().(&formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!(
365 "Entry {{ type_: {:?}, count: {:?}, offset: {:?} }}",
366 self.type_rust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#type_., self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count., &self.offsetrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#offset.
367 ))
368 }
369 }
370
371 impl Entryrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry# {
372 /// Create a new entry fit to be added to a standard TIFF IFD.
373 pub fn newrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]new().(type_: Typerust-analyzer cargo tiff 0.11.3 tags/Type#, count: u32, offset: [u8; 4]) -> Entryrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry# {
374 let mut entry_off = [0u8; 8];
375 entry_off[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeTo#4]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut()..copy_from_slicerust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]copy_from_slice().(&offset);
376 Entryrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#::new_u64rust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]new_u64().(type_, count.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), entry_off)
377 }
378
379 /// Create a new entry with data for a Big TIFF IFD.
380 pub fn new_u64rust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]new_u64().(type_: Typerust-analyzer cargo tiff 0.11.3 tags/Type#, count: u64, offset: [u8; 8]) -> Entryrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry# {
381 Entryrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry# {
382 type_rust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#type_.,
383 countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count.,
384 offsetrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#offset.,
385 }
386 }
387
388 pub fn field_typerust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]field_type().(&self) -> Typerust-analyzer cargo tiff 0.11.3 tags/Type# {
389 self.type_rust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#type_.
390 }
391
392 pub fn countrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]count().(&self) -> u64 {
393 self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count.
394 }
395
396 pub(craterust-analyzer cargo tiff 0.11.3 crate/) fn offsetrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]offset().(&self) -> &[u8] {
397 &self.offsetrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#offset.
398 }
399
400 /// Returns a mem_reader for the offset/value field
401 pub(craterust-analyzer cargo tiff 0.11.3 crate/) fn offset_field_readerrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]offset_field_reader().(
402 &self,
403 byte_order: ByteOrderrust-analyzer cargo tiff 0.11.3 tags/ByteOrder#,
404 ) -> EndianReaderrust-analyzer cargo tiff 0.11.3 decoder/stream/EndianReader#<iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Cursorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/cursor/Cursor#<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8>>> {
405 EndianReaderrust-analyzer cargo tiff 0.11.3 decoder/stream/EndianReader#::newrust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]new().(iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Cursorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/cursor/Cursor#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/cursor/impl#[`Cursor<T>`]new().(self.offsetrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#offset..to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().()), byte_order)
406 }
407
408 pub(craterust-analyzer cargo tiff 0.11.3 crate/) fn valrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]val().<R: Readrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Read# + Seekrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Seek#>(
409 &self,
410 limits: &superrust-analyzer cargo tiff 0.11.3 decoder/::Limitsrust-analyzer cargo tiff 0.11.3 decoder/Limits#,
411 bigtiff: bool,
412 reader: &mut EndianReaderrust-analyzer cargo tiff 0.11.3 decoder/stream/EndianReader#<R>,
413 ) -> TiffResultrust-analyzer cargo tiff 0.11.3 error/TiffResult#<Valuerust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#> {
414 // Case 1: there are no values so we can return immediately.
415 if self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialEq<Self>`]eq().0 {
416 return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Listrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#List#(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().()));
417 }
418
419 let bo = reader.byte_orderrust-analyzer cargo tiff 0.11.3 decoder/stream/EndianReader#byte_order.;
420 let value_bytes = self.type_rust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#type_..value_bytesrust-analyzer cargo tiff 0.11.3 tags/impl#[Type]value_bytes().(self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count.)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
421
422 // Case 2: there is one value.
423 if self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialEq<Self>`]eq().1 {
424 // 2a: the value is 5-8 bytes and we're in BigTiff mode.
425 if bigtiff && value_bytes rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().4 && value_bytes rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]le().<=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]le(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]le().8 {
426 return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(match self.type_rust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#type_. {
427 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::LONG8rust-analyzer cargo tiff 0.11.3 tags/Type#LONG8# => UnsignedBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#UnsignedBig#(self.offset_field_readerrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]offset_field_reader().(bo).read_u64rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_u64().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().),
428 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::SLONG8rust-analyzer cargo tiff 0.11.3 tags/Type#SLONG8# => SignedBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SignedBig#(self.offset_field_readerrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]offset_field_reader().(bo).read_i64rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_i64().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().),
429 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::DOUBLErust-analyzer cargo tiff 0.11.3 tags/Type#DOUBLE# => Doublerust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Double#(self.offset_field_readerrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]offset_field_reader().(bo).read_f64rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_f64().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().),
430 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::RATIONALrust-analyzer cargo tiff 0.11.3 tags/Type#RATIONAL# => {
431 let mut r = self.offset_field_readerrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]offset_field_reader().(bo);
432 Rationalrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Rational#(r.read_u32rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_u32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., r.read_u32rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_u32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().)
433 }
434 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::SRATIONALrust-analyzer cargo tiff 0.11.3 tags/Type#SRATIONAL# => {
435 let mut r = self.offset_field_readerrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]offset_field_reader().(bo);
436 SRationalrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SRational#(r.read_i32rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_i32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., r.read_i32rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_i32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().)
437 }
438 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::IFD8rust-analyzer cargo tiff 0.11.3 tags/Type#IFD8# => IfdBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#IfdBig#(self.offset_field_readerrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]offset_field_reader().(bo).read_u64rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_u64().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().),
439 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::BYTErust-analyzer cargo tiff 0.11.3 tags/Type#BYTE#
440 | Typerust-analyzer cargo tiff 0.11.3 tags/Type#::SBYTErust-analyzer cargo tiff 0.11.3 tags/Type#SBYTE#
441 | Typerust-analyzer cargo tiff 0.11.3 tags/Type#::ASCIIrust-analyzer cargo tiff 0.11.3 tags/Type#ASCII#
442 | Typerust-analyzer cargo tiff 0.11.3 tags/Type#::UNDEFINEDrust-analyzer cargo tiff 0.11.3 tags/Type#UNDEFINED#
443 | Typerust-analyzer cargo tiff 0.11.3 tags/Type#::SHORTrust-analyzer cargo tiff 0.11.3 tags/Type#SHORT#
444 | Typerust-analyzer cargo tiff 0.11.3 tags/Type#::SSHORTrust-analyzer cargo tiff 0.11.3 tags/Type#SSHORT#
445 | Typerust-analyzer cargo tiff 0.11.3 tags/Type#::LONGrust-analyzer cargo tiff 0.11.3 tags/Type#LONG#
446 | Typerust-analyzer cargo tiff 0.11.3 tags/Type#::SLONGrust-analyzer cargo tiff 0.11.3 tags/Type#SLONG#
447 | Typerust-analyzer cargo tiff 0.11.3 tags/Type#::FLOATrust-analyzer cargo tiff 0.11.3 tags/Type#FLOAT#
448 | Typerust-analyzer cargo tiff 0.11.3 tags/Type#::IFDrust-analyzer cargo tiff 0.11.3 tags/Type#IFD# => unreachablerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/unreachable!!(),
449 });
450 }
451
452 // 2b: the value is at most 4 bytes or doesn't fit in the offset field.
453 return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(match self.type_rust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#type_. {
454 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::BYTErust-analyzer cargo tiff 0.11.3 tags/Type#BYTE# => Byterust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Byte#(self.offsetrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#offset.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().),
455 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::SBYTErust-analyzer cargo tiff 0.11.3 tags/Type#SBYTE# => SignedByterust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SignedByte#(self.offsetrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#offset.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index(). as i8),
456 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::UNDEFINEDrust-analyzer cargo tiff 0.11.3 tags/Type#UNDEFINED# => Byterust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Byte#(self.offsetrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#offset.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().),
457 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::SHORTrust-analyzer cargo tiff 0.11.3 tags/Type#SHORT# => Shortrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Short#(self.offset_field_readerrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]offset_field_reader().(bo).read_u16rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_u16().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().),
458 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::SSHORTrust-analyzer cargo tiff 0.11.3 tags/Type#SSHORT# => SignedShortrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SignedShort#(self.offset_field_readerrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]offset_field_reader().(bo).read_i16rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_i16().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().),
459 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::LONGrust-analyzer cargo tiff 0.11.3 tags/Type#LONG# => Unsignedrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Unsigned#(self.offset_field_readerrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]offset_field_reader().(bo).read_u32rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_u32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().),
460 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::SLONGrust-analyzer cargo tiff 0.11.3 tags/Type#SLONG# => Signedrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Signed#(self.offset_field_readerrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]offset_field_reader().(bo).read_i32rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_i32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().),
461 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::FLOATrust-analyzer cargo tiff 0.11.3 tags/Type#FLOAT# => Floatrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Float#(self.offset_field_readerrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]offset_field_reader().(bo).read_f32rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_f32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().),
462 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::ASCIIrust-analyzer cargo tiff 0.11.3 tags/Type#ASCII# => {
463 if self.offsetrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#offset.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().0 {
464 Asciirust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Ascii#("".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().())
465 } else {
466 return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(TiffErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#::FormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#FormatError#(TiffFormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#::InvalidTagrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#InvalidTag#));
467 }
468 }
469 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::LONG8rust-analyzer cargo tiff 0.11.3 tags/Type#LONG8# => {
470 reader.goto_offsetrust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]goto_offset().(self.offset_field_readerrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]offset_field_reader().(bo).read_u32rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_u32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().())?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
471 UnsignedBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#UnsignedBig#(reader.read_u64rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_u64().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().)
472 }
473 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::SLONG8rust-analyzer cargo tiff 0.11.3 tags/Type#SLONG8# => {
474 reader.goto_offsetrust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]goto_offset().(self.offset_field_readerrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]offset_field_reader().(bo).read_u32rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_u32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().())?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
475 SignedBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SignedBig#(reader.read_i64rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_i64().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().)
476 }
477 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::DOUBLErust-analyzer cargo tiff 0.11.3 tags/Type#DOUBLE# => {
478 reader.goto_offsetrust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]goto_offset().(self.offset_field_readerrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]offset_field_reader().(bo).read_u32rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_u32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().())?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
479 Doublerust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Double#(reader.read_f64rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_f64().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().)
480 }
481 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::RATIONALrust-analyzer cargo tiff 0.11.3 tags/Type#RATIONAL# => {
482 reader.goto_offsetrust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]goto_offset().(self.offset_field_readerrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]offset_field_reader().(bo).read_u32rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_u32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().())?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
483 Rationalrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Rational#(reader.read_u32rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_u32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., reader.read_u32rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_u32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().)
484 }
485 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::SRATIONALrust-analyzer cargo tiff 0.11.3 tags/Type#SRATIONAL# => {
486 reader.goto_offsetrust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]goto_offset().(self.offset_field_readerrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]offset_field_reader().(bo).read_u32rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_u32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().())?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
487 SRationalrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SRational#(reader.read_i32rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_i32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., reader.read_i32rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_i32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().)
488 }
489 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::IFDrust-analyzer cargo tiff 0.11.3 tags/Type#IFD# => Ifdrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Ifd#(self.offset_field_readerrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]offset_field_reader().(bo).read_u32rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_u32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().),
490 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::IFD8rust-analyzer cargo tiff 0.11.3 tags/Type#IFD8# => {
491 reader.goto_offsetrust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]goto_offset().(self.offset_field_readerrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]offset_field_reader().(bo).read_u32rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_u32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().())?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
492 IfdBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#IfdBig#(reader.read_u64rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_u64().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().)
493 }
494 });
495 }
496
497 // Case 3: There is more than one value, but it fits in the offset field.
498 if value_bytes rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]le().<=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]le(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]le().4 || bigtiff && value_bytes rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]le().<=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]le(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]le().8 {
499 match self.type_rust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#type_. {
500 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::BYTErust-analyzer cargo tiff 0.11.3 tags/Type#BYTE# => return offset_to_bytesrust-analyzer cargo tiff 0.11.3 decoder/ifd/offset_to_bytes().(self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count. as usize, self),
501 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::SBYTErust-analyzer cargo tiff 0.11.3 tags/Type#SBYTE# => return offset_to_sbytesrust-analyzer cargo tiff 0.11.3 decoder/ifd/offset_to_sbytes().(self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count. as usize, self),
502 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::ASCIIrust-analyzer cargo tiff 0.11.3 tags/Type#ASCII# => {
503 let mut buf = vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![0; self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count. as usize];
504 buf.copy_from_slicerust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]copy_from_slice().(&self.offsetrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#offset.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeTo#self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count. as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().);
505 if buf.is_asciirust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/ascii/impl#[`[u8]`]is_ascii().() && buf.ends_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]ends_with().(&[0]) {
506 let v = strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/::from_utf8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/converts/from_utf8().(&buf)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
507 let v = v.trim_matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]trim_matches().(char::fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core char/convert/impl#[char][`From<u8>`]from().(0));
508 return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Asciirust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Ascii#(v.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()));
509 } else {
510 return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(TiffErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#::FormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#FormatError#(TiffFormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#::InvalidTagrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#InvalidTag#));
511 }
512 }
513 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::UNDEFINEDrust-analyzer cargo tiff 0.11.3 tags/Type#UNDEFINED# => {
514 return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Listrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#List#(
515 self.offsetrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#offset.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count. as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().
516 .iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().()
517 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|&b| Byterust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Byte#(b))
518 .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().(),
519 ));
520 }
521 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::SHORTrust-analyzer cargo tiff 0.11.3 tags/Type#SHORT# => {
522 let mut r = self.offset_field_readerrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]offset_field_reader().(bo);
523 let mut v = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().();
524 for _ in 0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count. {
525 v.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(Shortrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Short#(r.read_u16rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_u16().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().));
526 }
527 return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Listrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#List#(v));
528 }
529 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::SSHORTrust-analyzer cargo tiff 0.11.3 tags/Type#SSHORT# => {
530 let mut r = self.offset_field_readerrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]offset_field_reader().(bo);
531 let mut v = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().();
532 for _ in 0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count. {
533 v.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(SignedShortrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SignedShort#(r.read_i16rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_i16().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().));
534 }
535 return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Listrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#List#(v));
536 }
537 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::LONGrust-analyzer cargo tiff 0.11.3 tags/Type#LONG# => {
538 let mut r = self.offset_field_readerrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]offset_field_reader().(bo);
539 let mut v = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().();
540 for _ in 0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count. {
541 v.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(Unsignedrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Unsigned#(r.read_u32rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_u32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().));
542 }
543 return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Listrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#List#(v));
544 }
545 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::SLONGrust-analyzer cargo tiff 0.11.3 tags/Type#SLONG# => {
546 let mut r = self.offset_field_readerrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]offset_field_reader().(bo);
547 let mut v = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().();
548 for _ in 0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count. {
549 v.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(Signedrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Signed#(r.read_i32rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_i32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().));
550 }
551 return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Listrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#List#(v));
552 }
553 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::FLOATrust-analyzer cargo tiff 0.11.3 tags/Type#FLOAT# => {
554 let mut r = self.offset_field_readerrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]offset_field_reader().(bo);
555 let mut v = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().();
556 for _ in 0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count. {
557 v.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(Floatrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Float#(r.read_f32rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_f32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().));
558 }
559 return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Listrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#List#(v));
560 }
561 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::IFDrust-analyzer cargo tiff 0.11.3 tags/Type#IFD# => {
562 let mut r = self.offset_field_readerrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]offset_field_reader().(bo);
563 let mut v = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().();
564 for _ in 0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count. {
565 v.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(Ifdrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Ifd#(r.read_u32rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_u32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().));
566 }
567 return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Listrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#List#(v));
568 }
569 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::LONG8rust-analyzer cargo tiff 0.11.3 tags/Type#LONG8#
570 | Typerust-analyzer cargo tiff 0.11.3 tags/Type#::SLONG8rust-analyzer cargo tiff 0.11.3 tags/Type#SLONG8#
571 | Typerust-analyzer cargo tiff 0.11.3 tags/Type#::RATIONALrust-analyzer cargo tiff 0.11.3 tags/Type#RATIONAL#
572 | Typerust-analyzer cargo tiff 0.11.3 tags/Type#::SRATIONALrust-analyzer cargo tiff 0.11.3 tags/Type#SRATIONAL#
573 | Typerust-analyzer cargo tiff 0.11.3 tags/Type#::DOUBLErust-analyzer cargo tiff 0.11.3 tags/Type#DOUBLE#
574 | Typerust-analyzer cargo tiff 0.11.3 tags/Type#::IFD8rust-analyzer cargo tiff 0.11.3 tags/Type#IFD8# => {
575 unreachablerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/unreachable!!()
576 }
577 }
578 }
579
580 // Case 4: there is more than one value, and it doesn't fit in the offset field.
581 let mut v;
582 self.set_reader_offset_relativerust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]set_reader_offset_relative().(bigtiff, reader, 0)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
583
584 match self.type_rust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#type_. {
585 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::BYTErust-analyzer cargo tiff 0.11.3 tags/Type#BYTE# | Typerust-analyzer cargo tiff 0.11.3 tags/Type#::UNDEFINEDrust-analyzer cargo tiff 0.11.3 tags/Type#UNDEFINED# => {
586 v = Selfrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]::vec_with_capacityrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]vec_with_capacity().(self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count., limits)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
587 self.decode_valuesrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]decode_values().(self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count., self.type_rust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#type_., reader, |bytes| {
588 v.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<T>`]extend().(bytes.iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().copiedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#copied().().maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(Byterust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Byte#))
589 })
590 }
591 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::SBYTErust-analyzer cargo tiff 0.11.3 tags/Type#SBYTE# => {
592 v = Selfrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]::vec_with_capacityrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]vec_with_capacity().(self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count., limits)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
593 self.decode_valuesrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]decode_values().(self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count., self.type_rust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#type_., reader, |bytes| {
594 v.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<T>`]extend().(bytes.iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().copiedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#copied().().maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|v| SignedByterust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SignedByte#(v as i8)))
595 })
596 }
597 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::SHORTrust-analyzer cargo tiff 0.11.3 tags/Type#SHORT# => {
598 v = Selfrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]::vec_with_capacityrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]vec_with_capacity().(self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count., limits)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
599 self.decode_valuesrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]decode_values().(self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count., self.type_rust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#type_., reader, |bytes| {
600 v.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<T>`]extend().(
601 bytes
602 .chunks_exactrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]chunks_exact().(2)
603 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|ch| Shortrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Short#(u16::from_ne_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u16]from_ne_bytes().(ch.try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/TryInto#try_into().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().()))),
604 )
605 })
606 }
607 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::SSHORTrust-analyzer cargo tiff 0.11.3 tags/Type#SSHORT# => {
608 v = Selfrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]::vec_with_capacityrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]vec_with_capacity().(self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count., limits)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
609 self.decode_valuesrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]decode_values().(self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count., self.type_rust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#type_., reader, |bytes| {
610 v.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<T>`]extend().(
611 bytes
612 .chunks_exactrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]chunks_exact().(2)
613 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|ch| SignedShortrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SignedShort#(i16::from_ne_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[i16]from_ne_bytes().(ch.try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/TryInto#try_into().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().()))),
614 )
615 })
616 }
617 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::LONGrust-analyzer cargo tiff 0.11.3 tags/Type#LONG# => {
618 v = Selfrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]::vec_with_capacityrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]vec_with_capacity().(self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count., limits)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
619 self.decode_valuesrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]decode_values().(self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count., self.type_rust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#type_., reader, |bytes| {
620 v.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<T>`]extend().(
621 bytes
622 .chunks_exactrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]chunks_exact().(4)
623 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|ch| Unsignedrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Unsigned#(u32::from_ne_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u32]from_ne_bytes().(ch.try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/TryInto#try_into().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().()))),
624 )
625 })
626 }
627 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::SLONGrust-analyzer cargo tiff 0.11.3 tags/Type#SLONG# => {
628 v = Selfrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]::vec_with_capacityrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]vec_with_capacity().(self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count., limits)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
629 self.decode_valuesrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]decode_values().(self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count., self.type_rust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#type_., reader, |bytes| {
630 v.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<T>`]extend().(
631 bytes
632 .chunks_exactrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]chunks_exact().(4)
633 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|ch| Signedrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Signed#(i32::from_ne_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[i32]from_ne_bytes().(ch.try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/TryInto#try_into().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().()))),
634 )
635 })
636 }
637 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::FLOATrust-analyzer cargo tiff 0.11.3 tags/Type#FLOAT# => {
638 v = Selfrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]::vec_with_capacityrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]vec_with_capacity().(self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count., limits)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
639 self.decode_valuesrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]decode_values().(self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count., self.type_rust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#type_., reader, |bytes| {
640 v.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<T>`]extend().(
641 bytes
642 .chunks_exactrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]chunks_exact().(4)
643 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|ch| Floatrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Float#(f32::from_ne_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]from_ne_bytes().(ch.try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`TryInto<U>`]try_into().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().()))),
644 )
645 })
646 }
647 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::DOUBLErust-analyzer cargo tiff 0.11.3 tags/Type#DOUBLE# => {
648 v = Selfrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]::vec_with_capacityrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]vec_with_capacity().(self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count., limits)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
649 self.decode_valuesrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]decode_values().(self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count., self.type_rust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#type_., reader, |bytes| {
650 v.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<T>`]extend().(
651 bytes
652 .chunks_exactrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]chunks_exact().(8)
653 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|ch| Doublerust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Double#(f64::from_ne_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/impl#[f64]from_ne_bytes().(ch.try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`TryInto<U>`]try_into().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().()))),
654 )
655 })
656 }
657 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::RATIONALrust-analyzer cargo tiff 0.11.3 tags/Type#RATIONAL# => {
658 v = Selfrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]::vec_with_capacityrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]vec_with_capacity().(self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count., limits)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
659 self.decode_valuesrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]decode_values().(self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count., self.type_rust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#type_., reader, |bytes| {
660 v.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<T>`]extend().(bytes.chunks_exactrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]chunks_exact().(8).maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|ch| {
661 Rationalrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Rational#(
662 u32::from_ne_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u32]from_ne_bytes().(ch[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeTo#4]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/TryInto#try_into().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().()),
663 u32::from_ne_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u32]from_ne_bytes().(ch[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().4..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/TryInto#try_into().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().()),
664 )
665 }))
666 })
667 }
668 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::SRATIONALrust-analyzer cargo tiff 0.11.3 tags/Type#SRATIONAL# => {
669 v = Selfrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]::vec_with_capacityrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]vec_with_capacity().(self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count., limits)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
670 self.decode_valuesrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]decode_values().(self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count., self.type_rust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#type_., reader, |bytes| {
671 v.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<T>`]extend().(bytes.chunks_exactrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]chunks_exact().(8).maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|ch| {
672 SRationalrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SRational#(
673 i32::from_ne_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[i32]from_ne_bytes().(ch[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeTo#4]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/TryInto#try_into().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().()),
674 i32::from_ne_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[i32]from_ne_bytes().(ch[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().4..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/TryInto#try_into().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().()),
675 )
676 }))
677 })
678 }
679 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::LONG8rust-analyzer cargo tiff 0.11.3 tags/Type#LONG8# => {
680 v = Selfrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]::vec_with_capacityrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]vec_with_capacity().(self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count., limits)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
681 self.decode_valuesrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]decode_values().(self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count., self.type_rust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#type_., reader, |bytes| {
682 v.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<T>`]extend().(
683 bytes
684 .chunks_exactrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]chunks_exact().(8)
685 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|ch| UnsignedBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#UnsignedBig#(u64::from_ne_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u64]from_ne_bytes().(ch.try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/TryInto#try_into().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().()))),
686 )
687 })
688 }
689 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::SLONG8rust-analyzer cargo tiff 0.11.3 tags/Type#SLONG8# => {
690 v = Selfrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]::vec_with_capacityrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]vec_with_capacity().(self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count., limits)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
691 self.decode_valuesrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]decode_values().(self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count., self.type_rust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#type_., reader, |bytes| {
692 v.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<T>`]extend().(
693 bytes
694 .chunks_exactrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]chunks_exact().(8)
695 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|ch| SignedBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#SignedBig#(i64::from_ne_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[i64]from_ne_bytes().(ch.try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/TryInto#try_into().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().()))),
696 )
697 })
698 }
699 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::IFDrust-analyzer cargo tiff 0.11.3 tags/Type#IFD# => {
700 v = Selfrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]::vec_with_capacityrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]vec_with_capacity().(self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count., limits)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
701 self.decode_valuesrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]decode_values().(self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count., self.type_rust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#type_., reader, |bytes| {
702 v.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<T>`]extend().(
703 bytes
704 .chunks_exactrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]chunks_exact().(4)
705 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|ch| Ifdrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Ifd#(u32::from_ne_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u32]from_ne_bytes().(ch.try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/TryInto#try_into().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().()))),
706 )
707 })
708 }
709 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::IFD8rust-analyzer cargo tiff 0.11.3 tags/Type#IFD8# => {
710 v = Selfrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]::vec_with_capacityrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]vec_with_capacity().(self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count., limits)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
711 self.decode_valuesrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]decode_values().(self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count., self.type_rust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#type_., reader, |bytes| {
712 v.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<T>`]extend().(
713 bytes
714 .chunks_exactrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]chunks_exact().(8)
715 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|ch| IfdBigrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#IfdBig#(u64::from_ne_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u64]from_ne_bytes().(ch.try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/TryInto#try_into().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().()))),
716 )
717 })
718 }
719 Typerust-analyzer cargo tiff 0.11.3 tags/Type#::ASCIIrust-analyzer cargo tiff 0.11.3 tags/Type#ASCII# => {
720 let n = usize::try_fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/ptr_try_from_impls/impl#[usize][`TryFrom<u64>`]try_from().(self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count.)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
721
722 if n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().limits.decoding_buffer_sizerust-analyzer cargo tiff 0.11.3 decoder/Limits#decoding_buffer_size. {
723 return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(dbgrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/dbg!!(TiffErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#::LimitsExceededrust-analyzer cargo tiff 0.11.3 error/TiffError#LimitsExceeded#));
724 }
725
726 let mut out = vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![0; n];
727 reader.innerrust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]inner().().read_exactrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Read#read_exact().(&mut out)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
728 // Strings may be null-terminated, so we trim anything downstream of the null byte
729 if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(first) = out.iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().positionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/iter/impl#[`Iter<'a, T>`][Iterator]position().(|&b| b rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().0) {
730 out.truncaterust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]truncate().(first);
731 }
732
733 return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Asciirust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Ascii#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::from_utf8rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]from_utf8().(out)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().));
734 }
735 }?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
736
737 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Listrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#List#(v))
738 }
739
740 pub(craterust-analyzer cargo tiff 0.11.3 crate/) fn buffered_valuerust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]buffered_value().<R: Readrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Read# + Seekrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Seek#>(
741 &self,
742 buf: &mut ValueBufferrust-analyzer cargo tiff 0.11.3 tags/ValueBuffer#,
743 limits: &superrust-analyzer cargo tiff 0.11.3 decoder/::Limitsrust-analyzer cargo tiff 0.11.3 decoder/Limits#,
744 bigtiff: bool,
745 reader: &mut EndianReaderrust-analyzer cargo tiff 0.11.3 decoder/stream/EndianReader#<R>,
746 ) -> TiffResultrust-analyzer cargo tiff 0.11.3 error/TiffResult#<()> {
747 if self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialEq<Self>`]eq().0 {
748 buf.assume_typerust-analyzer cargo tiff 0.11.3 tags/impl#[ValueBuffer]assume_type().(self.type_rust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#type_., 0, reader.byte_orderrust-analyzer cargo tiff 0.11.3 decoder/stream/EndianReader#byte_order.);
749 return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(());
750 }
751
752 let value_bytes = self.buffer_with_capacityrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]buffer_with_capacity().(buf, limits)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
753
754 // Case 1: the value fits in the offset field.
755 if value_bytes rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le().<=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le().4 || bigtiff && value_bytes rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le().<=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le().8 {
756 let src = &self.offsetrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#offset.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeTo#value_bytes]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().;
757 buf.raw_bytes_mutrust-analyzer cargo tiff 0.11.3 tags/impl#[ValueBuffer]raw_bytes_mut().()[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeTo#value_bytes]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut()..copy_from_slicerust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]copy_from_slice().(src);
758 buf.assume_typerust-analyzer cargo tiff 0.11.3 tags/impl#[ValueBuffer]assume_type().(self.type_rust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#type_., self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count., reader.byte_orderrust-analyzer cargo tiff 0.11.3 decoder/stream/EndianReader#byte_order.);
759
760 return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(());
761 }
762
763 // Case 2: the value is stored in the reader at an offset.
764 self.set_reader_offset_relativerust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]set_reader_offset_relative().(bigtiff, reader, 0)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
765
766 // In case of an error we set the type and endianess.
767 buf.assume_typerust-analyzer cargo tiff 0.11.3 tags/impl#[ValueBuffer]assume_type().(self.type_rust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#type_., 0, reader.byte_orderrust-analyzer cargo tiff 0.11.3 decoder/stream/EndianReader#byte_order.);
768 let target = &mut buf.raw_bytes_mutrust-analyzer cargo tiff 0.11.3 tags/impl#[ValueBuffer]raw_bytes_mut().()[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeTo#value_bytes]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().;
769 // FIXME: if the read fails we have already grown to full size, which is not great.
770 reader.innerrust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]inner().().read_exactrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Read#read_exact().(target)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
771 buf.assume_typerust-analyzer cargo tiff 0.11.3 tags/impl#[ValueBuffer]assume_type().(self.type_rust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#type_., self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count., reader.byte_orderrust-analyzer cargo tiff 0.11.3 decoder/stream/EndianReader#byte_order.);
772
773 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(())
774 }
775
776 pub(craterust-analyzer cargo tiff 0.11.3 crate/) fn raw_value_atrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]raw_value_at().<R: Readrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Read# + Seekrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Seek#>(
777 &self,
778 buf: &mut [u8],
779 bigtiff: bool,
780 reader: &mut EndianReaderrust-analyzer cargo tiff 0.11.3 decoder/stream/EndianReader#<R>,
781 at: u64,
782 ) -> TiffResultrust-analyzer cargo tiff 0.11.3 error/TiffResult#<usize> {
783 if self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialEq<Self>`]eq().0 {
784 return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(0);
785 }
786
787 // We have no limits to handle, we do not allocate.
788 let value_bytes = self.type_rust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#type_..value_bytesrust-analyzer cargo tiff 0.11.3 tags/impl#[Type]value_bytes().(self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#count.)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
789
790 // No bytes to fill into the buffer.
791 if at rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]ge().value_bytes {
792 return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(0);
793 }
794
795 // Case 1: the value fits in the offset field.
796 if value_bytes rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]le().<=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]le(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]le().4 || bigtiff && value_bytes rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]le().<=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]le(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]le().8 {
797 // `at < value_bytes` and `value_bytes <= 8` so casting is mathematical
798 let src = &self.offsetrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#offset.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeTo#value_bytes as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`Index<I>`]index().at as usize..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`Index<I>`]index().;
799 let len = src.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().().minrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ord#min().(buf.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().());
800 buf[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeTo#len]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut()..copy_from_slicerust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]copy_from_slice().(&src[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeTo#len]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().);
801 return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(value_bytes as usize);
802 }
803
804 // Case 2: the value is stored in the reader at an offset. We will find the offset
805 // encoded in the entry, apply the relative start position and seek there.
806 self.set_reader_offset_relativerust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]set_reader_offset_relative().(bigtiff, reader, at)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
807
808 let remainder = value_bytes rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Sub<Self>`]sub().at;
809 let len = usize::try_fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/ptr_try_from_impls/impl#[usize][`TryFrom<u64>`]try_from().(remainder)
810 .unwrap_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap_or().(usize::MAXrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[usize]MAX.)
811 .minrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ord#min().(buf.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().());
812
813 let target = &mut buf[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeTo#len]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().;
814 reader.innerrust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]inner().().read_exactrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Read#read_exact().(target)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
815
816 // Design note: in a previous draft we would consume the rest of the bytes of this value
817 // here (into a stack buffer if need be) to verify the stream itself. But in the end we
818 // have `Seek` so we better verify this by seeking over the rest of the bytes, finding if
819 // the stream continues that far. Even that is maybe bad if we wanted to provide a
820 // async-adaptor that `WouldBlock` errors to fill back a read window then the seek is
821 // poison to that, too.
822
823 // So a really simple choice: The caller is responsible for handling the fact that this did
824 // not verify the whole value. Attempt a 1-byte read at the end of the value instead?
825 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(len)
826 }
827
828 // Returns `Ok(bytes)` if our value's bytes through type and count fit into `usize` and are
829 // within the limits. Extends the buffer to that many bytes.
830 fn buffer_with_capacityrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]buffer_with_capacity().(
831 &self,
832 buf: &mut ValueBufferrust-analyzer cargo tiff 0.11.3 tags/ValueBuffer#,
833 limits: &superrust-analyzer cargo tiff 0.11.3 decoder/::Limitsrust-analyzer cargo tiff 0.11.3 decoder/Limits#,
834 ) -> TiffResultrust-analyzer cargo tiff 0.11.3 error/TiffResult#<usize> {
835 let bytes = self.type_rust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#type_..value_bytesrust-analyzer cargo tiff 0.11.3 tags/impl#[Type]value_bytes().(self.countrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]count().())?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
836
837 let allowed_length = usize::try_fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/ptr_try_from_impls/impl#[usize][`TryFrom<u64>`]try_from().(bytes)
838 .okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]ok().()
839 .filterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]filter().(|&n| n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le().<=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le().limits.decoding_buffer_sizerust-analyzer cargo tiff 0.11.3 decoder/Limits#decoding_buffer_size.)
840 .ok_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]ok_or().(TiffErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#::LimitsExceededrust-analyzer cargo tiff 0.11.3 error/TiffError#LimitsExceeded#)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
841
842 buf.prepare_lengthrust-analyzer cargo tiff 0.11.3 tags/impl#[ValueBuffer]prepare_length().(allowed_length);
843
844 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(allowed_length)
845 }
846
847 fn vec_with_capacityrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]vec_with_capacity().(
848 value_count: u64,
849 limits: &superrust-analyzer cargo tiff 0.11.3 decoder/::Limitsrust-analyzer cargo tiff 0.11.3 decoder/Limits#,
850 ) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Valuerust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#>, TiffErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#> {
851 let value_count = usize::try_fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/ptr_try_from_impls/impl#[usize][`TryFrom<u64>`]try_from().(value_count)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
852
853 if value_count rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().limits.decoding_buffer_sizerust-analyzer cargo tiff 0.11.3 decoder/Limits#decoding_buffer_size. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Div<Self>`]div().memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<Valuerust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#>() {
854 return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(TiffErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#::LimitsExceededrust-analyzer cargo tiff 0.11.3 error/TiffError#LimitsExceeded#);
855 }
856
857 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::with_capacityrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]with_capacity().(value_count))
858 }
859
860 /// Seek to an offset within a value stored in the offset defined by this entry.
861 fn set_reader_offset_relativerust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]set_reader_offset_relative().<R>(
862 &self,
863 bigtiff: bool,
864 reader: &mut EndianReaderrust-analyzer cargo tiff 0.11.3 decoder/stream/EndianReader#<R>,
865 at: u64,
866 ) -> TiffResultrust-analyzer cargo tiff 0.11.3 error/TiffResult#<()>
867 where
868 R: Readrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Read# + Seekrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Seek#,
869 {
870 let bo = reader.byte_orderrust-analyzer cargo tiff 0.11.3 decoder/stream/EndianReader#byte_order.;
871
872 let offset = if bigtiff {
873 self.offset_field_readerrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]offset_field_reader().(bo).read_u64rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_u64().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().
874 } else {
875 self.offset_field_readerrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]offset_field_reader().(bo).read_u32rust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]read_u32().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()
876 };
877
878 // FIXME: `at` should be within `self.type_.value_bytes(self.count)` and that itself should
879 // be within the bounds of the stream. But we do not check this eagerly so this below will
880 // fail sometimes differently for exotic streams, depending on the method by which we read
881 // (at once or through multiple raw into-byte-slice reads).
882 let offset = offset.checked_addrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u64]checked_add().(at).ok_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]ok_or().(TiffErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#::FormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#FormatError#(
883 TiffFormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#::InconsistentSizesEncounteredrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#InconsistentSizesEncountered#,
884 ))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
885
886 reader.goto_offsetrust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]goto_offset().(offset)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
887
888 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(())
889 }
890
891 #[inline]
892 fn decode_valuesrust-analyzer cargo tiff 0.11.3 decoder/ifd/impl#[Entry]decode_values().<R, F>(
893 &self,
894 value_count: u64,
895 type_: Typerust-analyzer cargo tiff 0.11.3 tags/Type#,
896 reader: &mut EndianReaderrust-analyzer cargo tiff 0.11.3 decoder/stream/EndianReader#<R>,
897 mut collect: F,
898 ) -> TiffResultrust-analyzer cargo tiff 0.11.3 error/TiffResult#<()>
899 where
900 R: Readrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Read# + Seekrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Seek#,
901 F: FnMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/function/FnMut#(&[u8]),
902 {
903 let mut total_bytes = type_.value_bytesrust-analyzer cargo tiff 0.11.3 tags/impl#[Type]value_bytes().(value_count)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
904 let mut buffer = [0u8; 512];
905
906 let buf_unit = usize::fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[usize][`From<u8>`]from().(type_.byte_lenrust-analyzer cargo tiff 0.11.3 tags/impl#[Type]byte_len().());
907 let mul_of_ty = buffer.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Div<Self>`]div().buf_unit rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().buf_unit;
908
909 let cls = type_.endian_bytesrust-analyzer cargo tiff 0.11.3 tags/impl#[Type]endian_bytes().();
910 let native = ByteOrderrust-analyzer cargo tiff 0.11.3 tags/ByteOrder#::nativerust-analyzer cargo tiff 0.11.3 tags/impl#[ByteOrder]native().();
911
912 while total_bytes rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().0 {
913 // `now <= mul_of_ty < 512` so casting is mathematical
914 let now = total_bytes.minrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ord#min().(mul_of_ty as u64);
915 total_bytes rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`SubAssign<Self>`]sub_assign().-=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`SubAssign<Self>`]sub_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`SubAssign<Self>`]sub_assign().now;
916
917 let buffer = &mut buffer[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeTo#now as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut().;
918 reader.innerrust-analyzer cargo tiff 0.11.3 decoder/stream/impl#[`EndianReader<R>`]inner().().read_exactrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Read#read_exact().(buffer)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
919
920 reader.byte_orderrust-analyzer cargo tiff 0.11.3 decoder/stream/EndianReader#byte_order..convert_endian_bytesrust-analyzer cargo tiff 0.11.3 tags/impl#[ByteOrder]convert_endian_bytes().(cls, buffer, native);
921 collect(buffer);
922 }
923
924 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(())
925 }
926 }
927
928 /// Extracts a list of BYTE tags stored in an offset
929 #[inline]
930 fn offset_to_bytesrust-analyzer cargo tiff 0.11.3 decoder/ifd/offset_to_bytes().(n: usize, entry: &Entryrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#) -> TiffResultrust-analyzer cargo tiff 0.11.3 error/TiffResult#<Valuerust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#> {
931 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Listrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#List#(
932 entry.offsetrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#offset.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#n]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().
933 .iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().()
934 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|&e| Unsignedrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Unsigned#(u32::fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[u32][`From<u8>`]from().(e)))
935 .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().(),
936 ))
937 }
938
939 /// Extracts a list of SBYTE tags stored in an offset
940 #[inline]
941 fn offset_to_sbytesrust-analyzer cargo tiff 0.11.3 decoder/ifd/offset_to_sbytes().(n: usize, entry: &Entryrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#) -> TiffResultrust-analyzer cargo tiff 0.11.3 error/TiffResult#<Valuerust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#> {
942 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Listrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#List#(
943 entry.offsetrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#offset.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#n]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().
944 .iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().()
945 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|&e| Signedrust-analyzer cargo tiff 0.11.3 decoder/ifd/Value#Signed#(i32::fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[i32][`From<i8>`]from().(e as i8)))
946 .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().(),
947 ))
948 }
949
950 /// Type representing an Image File Directory
951 #[doc(hidden)]
952 #[deprecated = "Use struct `tiff::Directory` instead which contains all fields relevant to an Image File Directory, including the offset to the next directory"]
953 pub type Directoryrust-analyzer cargo tiff 0.11.3 decoder/ifd/Directory# = HashMaprust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/HashMap#<Tagrust-analyzer cargo tiff 0.11.3 tags/Tag#, Entryrust-analyzer cargo tiff 0.11.3 decoder/ifd/Entry#>;