Skip to main content

PfStore

Struct PfStore 

Source
pub struct PfStore { /* private fields */ }
Expand description

A PfStore is the local-filesystem entry point. It owns one BlobStore (default FsBlobStore) plus an images/ directory of one symlink per manifest digest, kept for fast pf log traversal.

Implementations§

Source§

impl PfStore

Source

pub fn open(root: impl AsRef<Path>) -> Result<Self>

Open the default on-disk store rooted at root.

Creates root/blobs/sha256/ and root/images/ if missing.

Source

pub fn with_blobstore( root: impl AsRef<Path>, blobs: Arc<dyn BlobStore>, ) -> Result<Self>

Open with a caller-supplied blob store (useful for in-memory tests).

Source

pub fn blobs(&self) -> &dyn BlobStore

Borrow the underlying blob store.

Source

pub fn blobs_arc(&self) -> Arc<dyn BlobStore>

Borrow the underlying blob store as an Arc (for cloning into capture pipelines).

Source

pub fn root(&self) -> &Path

Root directory of the store.

Source

pub fn put_manifest(&self, m: &Manifest) -> Result<Digest256>

Persist a Manifest and return its content-id (the digest of its canonical JSON serialization).

Also drops a marker file at images/<cid>.json so pf log can walk without scanning every blob.

Source

pub fn get_manifest(&self, cid: &Digest256) -> Result<Manifest>

Load a manifest by content-id.

Source

pub fn iter_manifests( &self, ) -> Result<impl Iterator<Item = (Digest256, Manifest)> + '_>

Iterate every manifest known to this store. Order is unspecified.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.