pub trait Resolve {
// Required method
fn fetch(&self, r: ObjRef) -> Result<Arc<Object>, Error>;
}Expand description
A store that can produce the object behind a reference.
Resolution is one hop: a reference to a reference is absent. A typed
accessor that takes a &impl Resolve follows at most one n g R; if
what it finds there is itself a reference, the value reads as missing
rather than being chased further (Resolved::as_direct).
Implementations must look up by object number alone and ignore the
generation: a 12 3 R in a real file resolves to whatever object 12 the
cross-reference table delivers, whatever generation it carries.
Unresolvable references — free entries, missing objects, cycles — return
Error::UnresolvedRef or Error::RefLoop, which every typed accessor
then reads as absence.
Required Methods§
Sourcefn fetch(&self, r: ObjRef) -> Result<Arc<Object>, Error>
fn fetch(&self, r: ObjRef) -> Result<Arc<Object>, Error>
The object stored under r, or why it could not be produced.
§Errors
Error::UnresolvedRef when the store has no such object, and
Error::RefLoop when the fetch re-entered one already in progress.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".