pub struct WorkspaceStores { /* private fields */ }Expand description
Each workspace’s content store under one directory, by the workspace’s id.
Implementations§
Source§impl WorkspaceStores
impl WorkspaceStores
Sourcepub fn in_dir(dir: impl Into<PathBuf>, limits: ContentLimits) -> Self
pub fn in_dir(dir: impl Into<PathBuf>, limits: ContentLimits) -> Self
The stores under dir, each bounded by limits.
Sourcepub fn get(&self, workspace: &str) -> Result<ContentStore, String>
pub fn get(&self, workspace: &str) -> Result<ContentStore, String>
The content store of workspace: one store per workspace, however
often it is asked for, so its limits hold across everyone who keeps
content there.
§Errors
workspace is not a workspace’s id (a UUID).
Sourcepub fn written_before(
&self,
workspace: &str,
hash: &str,
before: SystemTime,
) -> bool
pub fn written_before( &self, workspace: &str, hash: &str, before: SystemTime, ) -> bool
Whether a stored item was last written before the given time.
Sourcepub fn collect(
&self,
workspace: &str,
live: &BTreeSet<String>,
before: SystemTime,
) -> Result<Collected, String>
pub fn collect( &self, workspace: &str, live: &BTreeSet<String>, before: SystemTime, ) -> Result<Collected, String>
Remove from workspace’s store what nothing in live names and was
last written before before: content the workspace no longer
references, once whoever wrote it had time to reference it.
§Errors
workspace is not a workspace’s id, or its store could not be read or
changed.
Sourcepub fn remove(&self, workspace: &str) -> Result<(), String>
pub fn remove(&self, workspace: &str) -> Result<(), String>
Remove everything workspace keeps here, deleted: its store and its
directory. A store asked for afterwards starts empty.
§Errors
workspace is not a workspace’s id, or its directory could not be
removed.
pub fn workspaces(&self) -> Vec<String>
Sourcepub const fn limits(&self) -> ContentLimits
pub const fn limits(&self) -> ContentLimits
The limits every workspace’s store is bounded by.