pub trait Store {
// Required methods
fn set(
&mut self,
repo: &RepoId,
namespace: &PublicKey,
refname: &Qualified<'_>,
oid: Oid,
timestamp: LocalTime,
) -> Result<bool, Error>;
fn get(
&self,
repo: &RepoId,
namespace: &PublicKey,
refname: &Qualified<'_>,
) -> Result<Option<(Oid, LocalTime)>, Error>;
fn delete(
&mut self,
repo: &RepoId,
namespace: &PublicKey,
refname: &Qualified<'_>,
) -> Result<bool, Error>;
fn populate<S>(&mut self, storage: &S) -> Result<(), Error>
where S: ReadStorage;
fn count(&self) -> Result<usize, Error>;
// Provided method
fn is_empty(&self) -> Result<bool, Error> { ... }
}
Expand description
Refs store.
Used to cache git references.
Required Methods§
Sourcefn set(
&mut self,
repo: &RepoId,
namespace: &PublicKey,
refname: &Qualified<'_>,
oid: Oid,
timestamp: LocalTime,
) -> Result<bool, Error>
fn set( &mut self, repo: &RepoId, namespace: &PublicKey, refname: &Qualified<'_>, oid: Oid, timestamp: LocalTime, ) -> Result<bool, Error>
Set a reference under a remote namespace to the given Oid
.
Sourcefn get(
&self,
repo: &RepoId,
namespace: &PublicKey,
refname: &Qualified<'_>,
) -> Result<Option<(Oid, LocalTime)>, Error>
fn get( &self, repo: &RepoId, namespace: &PublicKey, refname: &Qualified<'_>, ) -> Result<Option<(Oid, LocalTime)>, Error>
Get a reference’s Oid
and timestamp.
Sourcefn delete(
&mut self,
repo: &RepoId,
namespace: &PublicKey,
refname: &Qualified<'_>,
) -> Result<bool, Error>
fn delete( &mut self, repo: &RepoId, namespace: &PublicKey, refname: &Qualified<'_>, ) -> Result<bool, Error>
Delete a reference.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.