Struct DraftStore

Source
pub struct DraftStore<'a, R> { /* private fields */ }
Expand description

Stores draft collaborative objects.

Implementations§

Source§

impl<'a, R> DraftStore<'a, R>

Source

pub fn new(repo: &'a R, remote: PublicKey) -> DraftStore<'a, R>

Trait Implementations§

Source§

impl<R> ReadRepository for DraftStore<'_, R>
where R: ReadRepository,

Source§

fn id(&self) -> RepoId

Return the repository id.
Source§

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>

Get the head of this repository. Read more
Source§

fn canonical_head(&self) -> Result<(Qualified<'_>, Oid), RepositoryError>

Compute the canonical head of this repository. Read more
Source§

fn path(&self) -> &Path

The Path to the git repository.
Source§

fn commit(&self, oid: Oid) -> Result<Commit<'_>, Error>

Get the git2::Commit found using its oid. Read more
Source§

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>

Check if the underlying ODB contains the given oid.
Source§

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>
where P: AsRef<Path>,

Get a blob in this repository at the given commit and path.
Source§

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>

Get the reference for the given remote. Read more
Source§

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>

Get all references of the given remote.
Source§

fn references_glob( &self, pattern: &PatternStr, ) -> Result<Vec<(Qualified<'_>, Oid)>, Error>

Get all references following a pattern. Skips references with names that are not parseable into Qualified. Read more
Source§

fn identity_doc(&self) -> Result<DocAt, RepositoryError>

Get the repository’s identity document.
Source§

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>

Get the head of the rad/id reference in this repository. Read more
Source§

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>

Get the root commit of the canonical identity branch.
Source§

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>

Compute the canonical rad/id of this repository. Read more
Source§

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,

Load the identity history.
Source§

fn canonical_identity_doc(&self) -> Result<DocAt, RepositoryError>

Compute the canonical identity document.
Source§

fn delegates(&self) -> Result<NonEmpty<Did>, RepositoryError>

Get repository delegates.
Source§

impl<R> RemoteRepository for DraftStore<'_, R>

Source§

fn remote(&self, id: &PublicKey) -> Result<Remote, Error>

Get the given remote.
Source§

fn remotes(&self) -> Result<Remotes<Verified>, Error>

Get all remotes.
Source§

fn remote_refs_at(&self) -> Result<Vec<RefsAt>, Error>

Get RefsAt of all remotes.
Source§

impl<R> SignRepository for DraftStore<'_, R>
where R: ReadRepository,

Source§

fn sign_refs<G>( &self, signer: &Device<G>, ) -> Result<SignedRefs<Verified>, RepositoryError>
where G: Signer<Signature>,

Sign the repository’s refs under the refs/rad/sigrefs branch.
Source§

impl<R> Storage for DraftStore<'_, R>
where R: WriteRepository,

Source§

type StoreError = <Repository as Storage>::StoreError

Source§

type LoadError = <Repository as Storage>::LoadError

Source§

type ObjectId = <Repository as Storage>::ObjectId

Source§

type Parent = <Repository as Storage>::Parent

Source§

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>,

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>

Load a change entry.
Source§

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,

Source§

type ObjectsError = ObjectsError

Source§

type TypesError = Error

Source§

type UpdateError = Error

Source§

type RemoveError = Error

Source§

type Namespace = PublicKey

Source§

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>

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>

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>

Remove a ref to a particular collaborative object
Source§

impl<R> ValidateRepository for DraftStore<'_, R>

Source§

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>

Validate all remotes with ValidateRepository::validate_remote.
Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> HasRepoId for T
where T: ReadRepository,

Source§

fn rid(&self) -> RepoId

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> IntoInit<ZeroInit> for T

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,