pub struct ObjectWriteSession { /* private fields */ }Expand description
Read-write object access for one writing operation’s lifetime (RFC 111 §6.1). Holds the same kind
of in-memory index snapshot ObjectReadSnapshot does, but every write decision first calls
IndexSnapshot::ensure_current (see its own doc), and every successful write calls it again
afterward instead of computing what changed itself (Stage 1 review v1, B1) – ensure_current’s
own tail-decode is the only thing ever allowed to grow entries/known_length, whether what it
finds is this session’s own write, a concurrent one, or both.
Implementations§
Source§impl ObjectWriteSession
impl ObjectWriteSession
Sourcepub fn open(layout: &RepositoryLayout) -> Result<Self>
pub fn open(layout: &RepositoryLayout) -> Result<Self>
Open a read-write session over layout’s object index, decoding it exactly once.
Sourcepub fn contains_object(
&mut self,
object_type: ObjectType,
id: ObjectId,
) -> Result<bool>
pub fn contains_object( &mut self, object_type: ObjectType, id: ObjectId, ) -> Result<bool>
Return true if an object with this id and type is indexed, refreshing the snapshot first if something else has grown the index since it was last known-current.
Trait Implementations§
Source§impl ObjectReader for ObjectWriteSession
impl ObjectReader for ObjectWriteSession
Source§fn read_object(&self, id: ObjectId) -> Result<Option<ObjectEnvelope>>
fn read_object(&self, id: ObjectId) -> Result<Option<ObjectEnvelope>>
Source§fn read_typed(
&self,
id: ObjectId,
object_type: ObjectType,
) -> Result<Option<ObjectEnvelope>>
fn read_typed( &self, id: ObjectId, object_type: ObjectType, ) -> Result<Option<ObjectEnvelope>>
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.