pub struct ObjectStore { /* private fields */ }Expand description
Handle to a repository’s object store.
Implementations§
Source§impl ObjectStore
impl ObjectStore
Sourcepub fn open(gpp_dir: &Path) -> Self
pub fn open(gpp_dir: &Path) -> Self
Open the store rooted at <gpp_dir>/objects (does not create it).
Sourcepub fn write<T: Object>(&self, object: &T) -> Result<Hash>
pub fn write<T: Object>(&self, object: &T) -> Result<Hash>
Store an object, returning its content address. Idempotent.
Sourcepub fn read_raw(&self, id: &Hash) -> Result<Vec<u8>>
pub fn read_raw(&self, id: &Hash) -> Result<Vec<u8>>
Raw stored frame bytes for an object (for sync transfer). The object is not decoded — callers move opaque, content-addressed frames.
Trait Implementations§
Source§impl Clone for ObjectStore
impl Clone for ObjectStore
Source§fn clone(&self) -> ObjectStore
fn clone(&self) -> ObjectStore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ObjectStore
impl RefUnwindSafe for ObjectStore
impl Send for ObjectStore
impl Sync for ObjectStore
impl Unpin for ObjectStore
impl UnsafeUnpin for ObjectStore
impl UnwindSafe for ObjectStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more