pub struct Local { /* private fields */ }Expand description
A store kept in a directory.
Implementations§
Trait Implementations§
Source§impl Store for Local
impl Store for Local
Source§fn put(&self, bytes: &[u8]) -> Result<Digest, StoreError>
fn put(&self, bytes: &[u8]) -> Result<Digest, StoreError>
Saves these bytes. Saving the same ones twice is the same as saving them
once — that is what content addressing is for.
Source§fn get(&self, digest: &Digest) -> Result<Option<Vec<u8>>, StoreError>
fn get(&self, digest: &Digest) -> Result<Option<Vec<u8>>, StoreError>
The bytes, if they are here.
Source§fn bind(
&self,
name: &str,
digest: &Digest,
meta: Meta,
) -> Result<(), StoreError>
fn bind( &self, name: &str, digest: &Digest, meta: Meta, ) -> Result<(), StoreError>
Points a name at some bytes, with what you want to remember about it. Read more
Source§fn claim(
&self,
name: &str,
digest: &Digest,
meta: Meta,
) -> Result<bool, StoreError>
fn claim( &self, name: &str, digest: &Digest, meta: Meta, ) -> Result<bool, StoreError>
Points a name at some bytes only if nobody has, and says whether it
did. This is how work gets handed out. Read more
Source§fn resolve(&self, name: &str) -> Result<Option<Bound>, StoreError>
fn resolve(&self, name: &str) -> Result<Option<Bound>, StoreError>
What that name points at, if anything.
Source§fn bound(&self) -> Result<Vec<Bound>, StoreError>
fn bound(&self) -> Result<Vec<Bound>, StoreError>
Everything bound here. A scan, and that is the point: the records are the
truth, and an index that answers faster is built from them and thrown
away.
Source§fn resolve_many(&self, names: &[&str]) -> Result<Vec<Option<Bound>>, StoreError>
fn resolve_many(&self, names: &[&str]) -> Result<Vec<Option<Bound>>, StoreError>
The same for many at once, in the order they were asked. In the trait
from the first day: a cache that works item by item asks thousands at a
time, which against a remote store is thousands of round trips unless it
is one call. The default is the loop.
Auto Trait Implementations§
impl Freeze for Local
impl RefUnwindSafe for Local
impl Send for Local
impl Sync for Local
impl Unpin for Local
impl UnsafeUnpin for Local
impl UnwindSafe for Local
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