pub struct DraftStore<'a, R> { /* private fields */ }
Expand description
Stores draft collaborative objects.
Implementations§
Source§impl<'a, R> DraftStore<'a, R>
impl<'a, R> DraftStore<'a, R>
pub fn new(repo: &'a R, remote: PublicKey) -> DraftStore<'a, R>
Trait Implementations§
Source§impl<R> ReadRepository for DraftStore<'_, R>where
R: ReadRepository,
impl<R> ReadRepository for DraftStore<'_, R>where
R: ReadRepository,
Source§fn is_empty(&self) -> Result<bool, Error>
fn is_empty(&self) -> Result<bool, Error>
Returns
true
if there are no references in the repository.Source§fn head(&self) -> Result<(Qualified<'_>, Oid), RepositoryError>
fn head(&self) -> Result<(Qualified<'_>, Oid), RepositoryError>
Get the head of this repository. Read more
Source§fn canonical_head(&self) -> Result<(Qualified<'_>, Oid), RepositoryError>
fn canonical_head(&self) -> Result<(Qualified<'_>, Oid), RepositoryError>
Compute the canonical head of this repository. Read more
Source§fn revwalk(&self, head: Oid) -> Result<Revwalk<'_>, Error>
fn revwalk(&self, head: Oid) -> Result<Revwalk<'_>, Error>
Perform a revision walk of a commit history starting from the given head.
Source§fn contains(&self, oid: Oid) -> Result<bool, Error>
fn contains(&self, oid: Oid) -> Result<bool, Error>
Check if the underlying ODB contains the given
oid
.Source§fn is_ancestor_of(&self, ancestor: Oid, head: Oid) -> Result<bool, Error>
fn is_ancestor_of(&self, ancestor: Oid, head: Oid) -> Result<bool, Error>
Check whether the given commit is an ancestor of another commit.
Source§fn blob_at<P>(&self, oid: Oid, path: P) -> Result<Blob<'_>, Error>
fn blob_at<P>(&self, oid: Oid, path: P) -> Result<Blob<'_>, Error>
Get a blob in this repository at the given commit and path.
Source§fn blob(&self, oid: Oid) -> Result<Blob<'_>, Error>
fn blob(&self, oid: Oid) -> Result<Blob<'_>, Error>
Get a blob in this repository, given its id.
Source§fn reference(
&self,
remote: &PublicKey,
reference: &Qualified<'_>,
) -> Result<Reference<'_>, Error>
fn reference( &self, remote: &PublicKey, reference: &Qualified<'_>, ) -> Result<Reference<'_>, Error>
Source§fn reference_oid(
&self,
remote: &PublicKey,
reference: &Qualified<'_>,
) -> Result<Oid, Error>
fn reference_oid( &self, remote: &PublicKey, reference: &Qualified<'_>, ) -> Result<Oid, Error>
Get the object id of a reference under the given remote.
Source§fn references_of(&self, remote: &PublicKey) -> Result<Refs, Error>
fn references_of(&self, remote: &PublicKey) -> Result<Refs, Error>
Get all references of the given remote.
Source§fn references_glob(
&self,
pattern: &PatternStr,
) -> Result<Vec<(Qualified<'_>, Oid)>, Error>
fn references_glob( &self, pattern: &PatternStr, ) -> Result<Vec<(Qualified<'_>, Oid)>, Error>
Source§fn identity_doc(&self) -> Result<DocAt, RepositoryError>
fn identity_doc(&self) -> Result<DocAt, RepositoryError>
Get the repository’s identity document.
Source§fn identity_doc_at(&self, head: Oid) -> Result<DocAt, DocError>
fn identity_doc_at(&self, head: Oid) -> Result<DocAt, DocError>
Get the repository’s identity document at a specific commit.
Source§fn identity_head(&self) -> Result<Oid, RepositoryError>
fn identity_head(&self) -> Result<Oid, RepositoryError>
Get the head of the
rad/id
reference in this repository. Read moreSource§fn identity_head_of(&self, remote: &PublicKey) -> Result<Oid, Error>
fn identity_head_of(&self, remote: &PublicKey) -> Result<Oid, Error>
Get the identity head of a specific remote.
Source§fn identity_root(&self) -> Result<Oid, RepositoryError>
fn identity_root(&self) -> Result<Oid, RepositoryError>
Get the root commit of the canonical identity branch.
Source§fn identity_root_of(&self, remote: &PublicKey) -> Result<Oid, RepositoryError>
fn identity_root_of(&self, remote: &PublicKey) -> Result<Oid, RepositoryError>
Get the root commit of the identity branch of a sepcific remote.
Source§fn canonical_identity_head(&self) -> Result<Oid, RepositoryError>
fn canonical_identity_head(&self) -> Result<Oid, RepositoryError>
Compute the canonical
rad/id
of this repository. Read moreSource§fn merge_base(&self, left: &Oid, right: &Oid) -> Result<Oid, Error>
fn merge_base(&self, left: &Oid, right: &Oid) -> Result<Oid, Error>
Get the merge base of two commits.
Source§fn identity(&self) -> Result<Identity, RepositoryError>where
Self: Store,
fn identity(&self) -> Result<Identity, RepositoryError>where
Self: Store,
Load the identity history.
Source§fn canonical_identity_doc(&self) -> Result<DocAt, RepositoryError>
fn canonical_identity_doc(&self) -> Result<DocAt, RepositoryError>
Compute the canonical identity document.
Source§impl<R> RemoteRepository for DraftStore<'_, R>where
R: RemoteRepository,
impl<R> RemoteRepository for DraftStore<'_, R>where
R: RemoteRepository,
Source§impl<R> SignRepository for DraftStore<'_, R>where
R: ReadRepository,
impl<R> SignRepository for DraftStore<'_, R>where
R: ReadRepository,
Source§fn sign_refs<G>(
&self,
signer: &Device<G>,
) -> Result<SignedRefs<Verified>, RepositoryError>
fn sign_refs<G>( &self, signer: &Device<G>, ) -> Result<SignedRefs<Verified>, RepositoryError>
Sign the repository’s refs under the
refs/rad/sigrefs
branch.Source§impl<R> Storage for DraftStore<'_, R>where
R: WriteRepository,
impl<R> Storage for DraftStore<'_, R>where
R: WriteRepository,
type StoreError = <Repository as Storage>::StoreError
type LoadError = <Repository as Storage>::LoadError
type ObjectId = <Repository as Storage>::ObjectId
type Parent = <Repository as Storage>::Parent
type Signatures = <Repository as Storage>::Signatures
Source§fn store<Signer>(
&self,
authority: Option<<DraftStore<'_, R> as Storage>::Parent>,
parents: Vec<<DraftStore<'_, R> as Storage>::Parent>,
signer: &Signer,
spec: Template<<DraftStore<'_, R> as Storage>::ObjectId>,
) -> Result<Entry<Oid, Oid, ExtendedSignature>, <DraftStore<'_, R> as Storage>::StoreError>where
Signer: Signer<ExtendedSignature>,
fn store<Signer>(
&self,
authority: Option<<DraftStore<'_, R> as Storage>::Parent>,
parents: Vec<<DraftStore<'_, R> as Storage>::Parent>,
signer: &Signer,
spec: Template<<DraftStore<'_, R> as Storage>::ObjectId>,
) -> Result<Entry<Oid, Oid, ExtendedSignature>, <DraftStore<'_, R> as Storage>::StoreError>where
Signer: Signer<ExtendedSignature>,
Store a new change entry.
Source§fn load(
&self,
id: <DraftStore<'_, R> as Storage>::ObjectId,
) -> Result<Entry<Oid, Oid, ExtendedSignature>, <DraftStore<'_, R> as Storage>::LoadError>
fn load( &self, id: <DraftStore<'_, R> as Storage>::ObjectId, ) -> Result<Entry<Oid, Oid, ExtendedSignature>, <DraftStore<'_, R> as Storage>::LoadError>
Load a change entry.
Source§fn parents_of(
&self,
id: &Oid,
) -> Result<Vec<Oid>, <DraftStore<'_, R> as Storage>::LoadError>
fn parents_of( &self, id: &Oid, ) -> Result<Vec<Oid>, <DraftStore<'_, R> as Storage>::LoadError>
Returns the parents of the object with the specified ID.
Source§impl<R> Storage for DraftStore<'_, R>where
R: WriteRepository,
impl<R> Storage for DraftStore<'_, R>where
R: WriteRepository,
type ObjectsError = ObjectsError
type TypesError = Error
type UpdateError = Error
type RemoveError = Error
type Namespace = PublicKey
Source§fn objects(
&self,
typename: &TypeName,
object_id: &ObjectId,
) -> Result<Objects, <DraftStore<'_, R> as Storage>::ObjectsError>
fn objects( &self, typename: &TypeName, object_id: &ObjectId, ) -> Result<Objects, <DraftStore<'_, R> as Storage>::ObjectsError>
Get all references which point to a head of the change graph for a
particular object
Source§fn types(
&self,
_typename: &TypeName,
) -> Result<BTreeMap<ObjectId, Objects>, <DraftStore<'_, R> as Storage>::TypesError>
fn types( &self, _typename: &TypeName, ) -> Result<BTreeMap<ObjectId, Objects>, <DraftStore<'_, R> as Storage>::TypesError>
Get all references to objects of a given type within a particular
identity
Source§fn update(
&self,
namespace: &<DraftStore<'_, R> as Storage>::Namespace,
typename: &TypeName,
object_id: &ObjectId,
entry: &Oid,
) -> Result<(), <DraftStore<'_, R> as Storage>::UpdateError>
fn update( &self, namespace: &<DraftStore<'_, R> as Storage>::Namespace, typename: &TypeName, object_id: &ObjectId, entry: &Oid, ) -> Result<(), <DraftStore<'_, R> as Storage>::UpdateError>
Update a ref to a particular collaborative object
Source§fn remove(
&self,
namespace: &<DraftStore<'_, R> as Storage>::Namespace,
typename: &TypeName,
object_id: &ObjectId,
) -> Result<(), <DraftStore<'_, R> as Storage>::RemoveError>
fn remove( &self, namespace: &<DraftStore<'_, R> as Storage>::Namespace, typename: &TypeName, object_id: &ObjectId, ) -> Result<(), <DraftStore<'_, R> as Storage>::RemoveError>
Remove a ref to a particular collaborative object
Source§impl<R> ValidateRepository for DraftStore<'_, R>where
R: ValidateRepository,
impl<R> ValidateRepository for DraftStore<'_, R>where
R: ValidateRepository,
Source§fn validate_remote(&self, remote: &Remote) -> Result<Validations, Error>
fn validate_remote(&self, remote: &Remote) -> Result<Validations, Error>
Validates a remote’s signed refs and identity. Read more
Source§fn validate(&self) -> Result<Validations, Error>
fn validate(&self) -> Result<Validations, Error>
Validate all remotes with
ValidateRepository::validate_remote
.impl<R> Store for DraftStore<'_, R>where
R: WriteRepository,
Auto Trait Implementations§
impl<'a, R> Freeze for DraftStore<'a, R>
impl<'a, R> RefUnwindSafe for DraftStore<'a, R>where
R: RefUnwindSafe,
impl<'a, R> Send for DraftStore<'a, R>where
R: Sync,
impl<'a, R> Sync for DraftStore<'a, R>where
R: Sync,
impl<'a, R> Unpin for DraftStore<'a, R>
impl<'a, R> UnwindSafe for DraftStore<'a, R>where
R: RefUnwindSafe,
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more