pub struct ClawStore { /* private fields */ }Implementations§
Source§impl ClawStore
impl ClawStore
pub fn init(root: &Path) -> Result<Self, StoreError>
pub fn open(root: &Path) -> Result<Self, StoreError>
pub fn root(&self) -> &Path
pub fn layout(&self) -> &RepoLayout
pub fn store_object(&self, obj: &Object) -> Result<ObjectId, StoreError>
pub fn load_object(&self, id: &ObjectId) -> Result<Object, StoreError>
Sourcepub fn load_cof_bytes(&self, id: &ObjectId) -> Result<Vec<u8>, StoreError>
pub fn load_cof_bytes(&self, id: &ObjectId) -> Result<Vec<u8>, StoreError>
Read the raw COF-encoded bytes for an object without decoding.
This avoids the decode → re-encode cycle when the COF bytes will be sent over the wire unmodified (e.g., pack uploads, inline batch uploads).
pub fn has_object(&self, id: &ObjectId) -> bool
pub fn set_ref(&self, name: &str, target: &ObjectId) -> Result<(), StoreError>
pub fn get_ref(&self, name: &str) -> Result<Option<ObjectId>, StoreError>
pub fn list_refs( &self, prefix: &str, ) -> Result<Vec<(String, ObjectId)>, StoreError>
pub fn delete_ref(&self, name: &str) -> Result<(), StoreError>
pub fn read_head(&self) -> Result<HeadState, StoreError>
pub fn write_head(&self, state: &HeadState) -> Result<(), StoreError>
pub fn resolve_head(&self) -> Result<Option<ObjectId>, StoreError>
pub fn update_ref_cas( &self, name: &str, expected_old: Option<&ObjectId>, new_target: &ObjectId, author: &str, message: &str, ) -> Result<(), StoreError>
pub fn list_object_ids(&self) -> Result<Vec<ObjectId>, StoreError>
Auto Trait Implementations§
impl Freeze for ClawStore
impl RefUnwindSafe for ClawStore
impl Send for ClawStore
impl Sync for ClawStore
impl Unpin for ClawStore
impl UnsafeUnpin for ClawStore
impl UnwindSafe for ClawStore
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