pub struct ObjectStore { /* private fields */ }Expand description
Object storage - handles reading/writing objects to disk with optional encryption
Implementations§
Source§impl ObjectStore
impl ObjectStore
Sourcepub fn new_with_encryption(
repo_path: &Path,
passphrase: Option<&str>,
) -> Result<Self, String>
pub fn new_with_encryption( repo_path: &Path, passphrase: Option<&str>, ) -> Result<Self, String>
Create object store with encryption passphrase
Sourcepub fn with_encryption_manager(
repo_path: &Path,
manager: EncryptionManager,
) -> Self
pub fn with_encryption_manager( repo_path: &Path, manager: EncryptionManager, ) -> Self
Create an object store that uses a manager the caller already built.
rotate-key needs to write objects under a key that is not the one the
key file describes yet, which no passphrase-based constructor can
express.
Sourcepub fn exists(&self, hash: &ObjectHash) -> bool
pub fn exists(&self, hash: &ObjectHash) -> bool
Check if an object exists
Sourcepub fn encryption(&self) -> Arc<Mutex<EncryptionManager>> ⓘ
pub fn encryption(&self) -> Arc<Mutex<EncryptionManager>> ⓘ
The encryption manager this store reads and writes through.
gc needs it so that packed objects get exactly the treatment the loose
ones had, rather than landing on disk in the clear.
Auto 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