From 5b8a2832c3c56f3c8dde4104e122d0d21fea3ba2 Mon Sep 17 00:00:00 2001 From: "A. Molzer" <5550310+197g@users.noreply.github.com> Date: Tue, 31 Mar 2026 11:33:46 +0200 Subject: [PATCH] Add design note --- src/decoder/mod.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/decoder/mod.rs b/src/decoder/mod.rs index ea16145..32b478c 100644 --- a/src/decoder/mod.rs +++ b/src/decoder/mod.rs @@ -966,6 +966,14 @@ impl Decoder { /// Returns an error if the entry count exceeds the possible offset values or if the offset /// of the entry would overflow the offset in the underlying stream. Otherwise returns a reader /// that yields the bytes of the value. + /// + /// ## Design Notes + /// + /// This method does not appear on [`IfdDecoder`] as we assume the reader type may be important + /// to you. It also allows forward compatibility to additional trait implementations without + /// demanding them from all types as `dyn` would. There is also no `M×N` instantiation problem + /// with this method: you get one type per reader type and monomorphic methods from the traits + /// it implements. pub fn read_entry(&mut self, entry: ifd::Entry) -> TiffResult> { EntryBytesReader::from_entry(&mut self.value_reader, entry) }