pub struct SurfaceStore { /* private fields */ }Expand description
Where surface blobs live. One file per distinct surface, named by its hash.
Implementations§
Source§impl SurfaceStore
impl SurfaceStore
pub fn default_root() -> Result<PathBuf>
pub fn open(root: impl Into<PathBuf>) -> Result<Self>
Sourcepub fn open_default() -> Option<Self>
pub fn open_default() -> Option<Self>
Open the default store, or None if it cannot be reached.
Best-effort by design: recording a surface is bookkeeping beside a run,
and a full disk must not stop the run itself. A session that could not
record its surface carries no hash and reads back as
Fidelity::Unknown, which is exactly true.
Sourcepub fn record(&self, specs: &[ToolSpec]) -> Result<String>
pub fn record(&self, specs: &[ToolSpec]) -> Result<String>
Record a surface and return its hash. A surface already on disk costs
one exists and no write.
Sourcepub fn load(&self, hash: &str) -> Option<Vec<ToolSpec>>
pub fn load(&self, hash: &str) -> Option<Vec<ToolSpec>>
The specs behind a hash, or None when the blob is not here.
Absent is not empty: a missing blob means the surface cannot be rebuilt, never that the run had no tools.
pub fn root(&self) -> &Path
Auto Trait Implementations§
impl Freeze for SurfaceStore
impl RefUnwindSafe for SurfaceStore
impl Send for SurfaceStore
impl Sync for SurfaceStore
impl Unpin for SurfaceStore
impl UnsafeUnpin for SurfaceStore
impl UnwindSafe for SurfaceStore
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