pub struct Store { /* private fields */ }Expand description
The content-addressed store rooted at $VANTA_HOME.
Implementations§
Source§impl Store
impl Store
Sourcepub fn open(home: impl AsRef<Path>) -> VtaResult<Store>
pub fn open(home: impl AsRef<Path>) -> VtaResult<Store>
Open (creating the directory skeleton if needed) a store at home.
pub fn store_dir(&self) -> PathBuf
pub fn downloads_dir(&self) -> PathBuf
pub fn envs_dir(&self) -> PathBuf
Sourcepub fn entry_path(&self, key: &StoreKey) -> PathBuf
pub fn entry_path(&self, key: &StoreKey) -> PathBuf
The directory a store key occupies.
Sourcepub fn new_staging(&self) -> VtaResult<PathBuf>
pub fn new_staging(&self) -> VtaResult<PathBuf>
Create a fresh, unique staging directory under the store. The installer
unpacks into it, then calls Store::publish_tree.
Sourcepub fn publish_tree(&self, staged: &Path) -> VtaResult<StoreKey>
pub fn publish_tree(&self, staged: &Path) -> VtaResult<StoreKey>
Publish a staged tree into the store, content-addressed and atomically. If an identical entry already exists, the staged copy is discarded (dedup) and the existing key returned.
Sourcepub fn verify_entry(&self, key: &StoreKey) -> VtaResult<bool>
pub fn verify_entry(&self, key: &StoreKey) -> VtaResult<bool>
Re-hash an entry and confirm it still matches its key (integrity check).
Sourcepub fn cache_put_blob(&self, bytes: &[u8]) -> VtaResult<String>
pub fn cache_put_blob(&self, bytes: &[u8]) -> VtaResult<String>
Store a downloaded blob in the content-addressed download cache, returning
its blake3-<hex> cache key. Idempotent.
Sourcepub fn cache_get_path(&self, cache_key: &str) -> Option<PathBuf>
pub fn cache_get_path(&self, cache_key: &str) -> Option<PathBuf>
The path of a cached blob, if present.
Auto Trait Implementations§
impl Freeze for Store
impl RefUnwindSafe for Store
impl Send for Store
impl Sync for Store
impl Unpin for Store
impl UnsafeUnpin for Store
impl UnwindSafe for Store
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