pub trait ObjectReader {
// Required method
fn read_object(&self, id: ObjectId) -> Result<Option<ObjectEnvelope>>;
// Provided method
fn read_typed(
&self,
id: ObjectId,
object_type: ObjectType,
) -> Result<Option<ObjectEnvelope>> { ... }
}Expand description
Read-only object access boundary.
Required Methods§
Sourcefn read_object(&self, id: ObjectId) -> Result<Option<ObjectEnvelope>>
fn read_object(&self, id: ObjectId) -> Result<Option<ObjectEnvelope>>
Read an object by ID.
Provided Methods§
Sourcefn read_typed(
&self,
id: ObjectId,
object_type: ObjectType,
) -> Result<Option<ObjectEnvelope>>
fn read_typed( &self, id: ObjectId, object_type: ObjectType, ) -> Result<Option<ObjectEnvelope>>
Read and require a specific object type. Default-implemented in terms of read_object alone
(RFC 111 §6.1: every implementor – FileObjectStore, ObjectReadSnapshot,
ObjectWriteSession, MemoryObjectStore – gets this for free, and any function generic over
impl ObjectReader can call it without depending on a concrete type). One body, not one per
implementor (Stage 1 review v1 §3): every concrete type’s own read_typed delegates here too.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".