pub struct CreatedSet {
home: PathBuf,
}Fields§
§home: PathBufImplementations§
Source§impl CreatedSet
impl CreatedSet
pub fn new(home: PathBuf) -> Self
fn data_path(&self, key: &str) -> PathBuf
fn lock_path(&self, key: &str) -> PathBuf
fn open_lock(&self, key: &str) -> Result<File>
Sourcefn mutate(&self, key: &str, f: impl FnOnce(&mut Vec<Entry>)) -> Result<()>
fn mutate(&self, key: &str, f: impl FnOnce(&mut Vec<Entry>)) -> Result<()>
Read-merge-write one key’s file under its lock.
pub fn append(&self, directory: &Path, id: &str) -> Result<()>
Sourcefn data_files(&self) -> Vec<(String, PathBuf)>
fn data_files(&self) -> Vec<(String, PathBuf)>
Every created.<key>.json in the home, as (key, path).
pub fn prune(&self, id: &str) -> Result<()>
Sourcepub fn contains(&self, id: &str) -> Result<Option<PathBuf>>
pub fn contains(&self, id: &str) -> Result<Option<PathBuf>>
The directory recorded for id, scanning every file without locking.
Sourcepub fn ids_for(&self, directory: &Path) -> Vec<String>
pub fn ids_for(&self, directory: &Path) -> Vec<String>
The ids stored for directory’s key, in stored order.
pub fn ids(&self) -> Vec<String>
Trait Implementations§
Source§impl Clone for CreatedSet
impl Clone for CreatedSet
Source§fn clone(&self) -> CreatedSet
fn clone(&self) -> CreatedSet
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CreatedSet
impl RefUnwindSafe for CreatedSet
impl Send for CreatedSet
impl Sync for CreatedSet
impl Unpin for CreatedSet
impl UnsafeUnpin for CreatedSet
impl UnwindSafe for CreatedSet
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