pub struct PatchMut<'a, 'g, R, C> {
pub id: ObjectId,
/* private fields */
}Fields§
§id: ObjectIdImplementations§
Source§impl<'a, 'g, R, C> PatchMut<'a, 'g, R, C>
impl<'a, 'g, R, C> PatchMut<'a, 'g, R, C>
pub fn new( id: ObjectId, patch: Patch, cache: &'g mut Cache<Patches<'a, R>, C>, ) -> Self
pub fn id(&self) -> &ObjectId
pub fn transaction<G, F>( &mut self, message: &str, signer: &Device<G>, operations: F, ) -> Result<EntryId, Error>
Sourcepub fn edit<G, S>(
&mut self,
title: Title,
target: MergeTarget,
signer: &Device<G>,
) -> Result<EntryId, Error>
pub fn edit<G, S>( &mut self, title: Title, target: MergeTarget, signer: &Device<G>, ) -> Result<EntryId, Error>
Edit patch metadata.
Sourcepub fn edit_revision<G, S>(
&mut self,
revision: RevisionId,
description: S,
embeds: impl IntoIterator<Item = Embed<Uri>>,
signer: &Device<G>,
) -> Result<EntryId, Error>
pub fn edit_revision<G, S>( &mut self, revision: RevisionId, description: S, embeds: impl IntoIterator<Item = Embed<Uri>>, signer: &Device<G>, ) -> Result<EntryId, Error>
Edit revision metadata.
Sourcepub fn redact<G>(
&mut self,
revision: RevisionId,
signer: &Device<G>,
) -> Result<EntryId, Error>
pub fn redact<G>( &mut self, revision: RevisionId, signer: &Device<G>, ) -> Result<EntryId, Error>
Redact a revision.
Sourcepub fn thread<G, S>(
&mut self,
revision: RevisionId,
body: S,
signer: &Device<G>,
) -> Result<CommentId, Error>
pub fn thread<G, S>( &mut self, revision: RevisionId, body: S, signer: &Device<G>, ) -> Result<CommentId, Error>
Create a thread on a patch revision.
Sourcepub fn comment<G, S>(
&mut self,
revision: RevisionId,
body: S,
reply_to: Option<CommentId>,
location: Option<CodeLocation>,
embeds: impl IntoIterator<Item = Embed<Uri>>,
signer: &Device<G>,
) -> Result<EntryId, Error>
pub fn comment<G, S>( &mut self, revision: RevisionId, body: S, reply_to: Option<CommentId>, location: Option<CodeLocation>, embeds: impl IntoIterator<Item = Embed<Uri>>, signer: &Device<G>, ) -> Result<EntryId, Error>
Comment on a patch revision.
Sourcepub fn react<G>(
&mut self,
revision: RevisionId,
reaction: Reaction,
location: Option<CodeLocation>,
active: bool,
signer: &Device<G>,
) -> Result<EntryId, Error>
pub fn react<G>( &mut self, revision: RevisionId, reaction: Reaction, location: Option<CodeLocation>, active: bool, signer: &Device<G>, ) -> Result<EntryId, Error>
React on a patch revision.
Sourcepub fn comment_edit<G, S>(
&mut self,
revision: RevisionId,
comment: CommentId,
body: S,
embeds: impl IntoIterator<Item = Embed<Uri>>,
signer: &Device<G>,
) -> Result<EntryId, Error>
pub fn comment_edit<G, S>( &mut self, revision: RevisionId, comment: CommentId, body: S, embeds: impl IntoIterator<Item = Embed<Uri>>, signer: &Device<G>, ) -> Result<EntryId, Error>
Edit a comment on a patch revision.
Sourcepub fn comment_react<G>(
&mut self,
revision: RevisionId,
comment: CommentId,
reaction: Reaction,
active: bool,
signer: &Device<G>,
) -> Result<EntryId, Error>
pub fn comment_react<G>( &mut self, revision: RevisionId, comment: CommentId, reaction: Reaction, active: bool, signer: &Device<G>, ) -> Result<EntryId, Error>
React to a comment on a patch revision.
Sourcepub fn comment_redact<G>(
&mut self,
revision: RevisionId,
comment: CommentId,
signer: &Device<G>,
) -> Result<EntryId, Error>
pub fn comment_redact<G>( &mut self, revision: RevisionId, comment: CommentId, signer: &Device<G>, ) -> Result<EntryId, Error>
Redact a comment on a patch revision.
Sourcepub fn review_comment<G, S>(
&mut self,
review: ReviewId,
body: S,
location: Option<CodeLocation>,
reply_to: Option<CommentId>,
embeds: impl IntoIterator<Item = Embed<Uri>>,
signer: &Device<G>,
) -> Result<EntryId, Error>
pub fn review_comment<G, S>( &mut self, review: ReviewId, body: S, location: Option<CodeLocation>, reply_to: Option<CommentId>, embeds: impl IntoIterator<Item = Embed<Uri>>, signer: &Device<G>, ) -> Result<EntryId, Error>
Comment on a line of code as part of a review.
Sourcepub fn edit_review_comment<G, S>(
&mut self,
review: ReviewId,
comment: EntryId,
body: S,
embeds: impl IntoIterator<Item = Embed<Uri>>,
signer: &Device<G>,
) -> Result<EntryId, Error>
pub fn edit_review_comment<G, S>( &mut self, review: ReviewId, comment: EntryId, body: S, embeds: impl IntoIterator<Item = Embed<Uri>>, signer: &Device<G>, ) -> Result<EntryId, Error>
Edit review comment.
Sourcepub fn react_review_comment<G>(
&mut self,
review: ReviewId,
comment: EntryId,
reaction: Reaction,
active: bool,
signer: &Device<G>,
) -> Result<EntryId, Error>
pub fn react_review_comment<G>( &mut self, review: ReviewId, comment: EntryId, reaction: Reaction, active: bool, signer: &Device<G>, ) -> Result<EntryId, Error>
React to a review comment.
Sourcepub fn redact_review_comment<G>(
&mut self,
review: ReviewId,
comment: EntryId,
signer: &Device<G>,
) -> Result<EntryId, Error>
pub fn redact_review_comment<G>( &mut self, review: ReviewId, comment: EntryId, signer: &Device<G>, ) -> Result<EntryId, Error>
React to a review comment.
Sourcepub fn review<G>(
&mut self,
revision: RevisionId,
verdict: Option<Verdict>,
summary: Option<String>,
labels: Vec<Label>,
signer: &Device<G>,
) -> Result<ReviewId, Error>
pub fn review<G>( &mut self, revision: RevisionId, verdict: Option<Verdict>, summary: Option<String>, labels: Vec<Label>, signer: &Device<G>, ) -> Result<ReviewId, Error>
Review a patch revision.
Sourcepub fn review_edit<G>(
&mut self,
review: ReviewId,
verdict: Option<Verdict>,
summary: String,
labels: Vec<Label>,
embeds: impl IntoIterator<Item = Embed<Uri>>,
signer: &Device<G>,
) -> Result<EntryId, Error>
pub fn review_edit<G>( &mut self, review: ReviewId, verdict: Option<Verdict>, summary: String, labels: Vec<Label>, embeds: impl IntoIterator<Item = Embed<Uri>>, signer: &Device<G>, ) -> Result<EntryId, Error>
Edit a review.
Sourcepub fn review_react<G>(
&mut self,
review: ReviewId,
reaction: Reaction,
active: bool,
signer: &Device<G>,
) -> Result<EntryId, Error>
pub fn review_react<G>( &mut self, review: ReviewId, reaction: Reaction, active: bool, signer: &Device<G>, ) -> Result<EntryId, Error>
React to a review.
Sourcepub fn redact_review<G>(
&mut self,
review: ReviewId,
signer: &Device<G>,
) -> Result<EntryId, Error>
pub fn redact_review<G>( &mut self, review: ReviewId, signer: &Device<G>, ) -> Result<EntryId, Error>
Redact a patch review.
Sourcepub fn resolve_review_comment<G>(
&mut self,
review: ReviewId,
comment: CommentId,
signer: &Device<G>,
) -> Result<EntryId, Error>
pub fn resolve_review_comment<G>( &mut self, review: ReviewId, comment: CommentId, signer: &Device<G>, ) -> Result<EntryId, Error>
Resolve a patch review comment.
Sourcepub fn unresolve_review_comment<G>(
&mut self,
review: ReviewId,
comment: CommentId,
signer: &Device<G>,
) -> Result<EntryId, Error>
pub fn unresolve_review_comment<G>( &mut self, review: ReviewId, comment: CommentId, signer: &Device<G>, ) -> Result<EntryId, Error>
Unresolve a patch review comment.
Sourcepub fn merge<G>(
&mut self,
revision: RevisionId,
commit: Oid,
signer: &Device<G>,
) -> Result<Merged<'_, R>, Error>
pub fn merge<G>( &mut self, revision: RevisionId, commit: Oid, signer: &Device<G>, ) -> Result<Merged<'_, R>, Error>
Merge a patch revision.
Sourcepub fn update<G>(
&mut self,
description: impl ToString,
base: impl Into<Oid>,
oid: impl Into<Oid>,
signer: &Device<G>,
) -> Result<RevisionId, Error>
pub fn update<G>( &mut self, description: impl ToString, base: impl Into<Oid>, oid: impl Into<Oid>, signer: &Device<G>, ) -> Result<RevisionId, Error>
Update a patch with a new revision.
Sourcepub fn lifecycle<G>(
&mut self,
state: Lifecycle,
signer: &Device<G>,
) -> Result<EntryId, Error>
pub fn lifecycle<G>( &mut self, state: Lifecycle, signer: &Device<G>, ) -> Result<EntryId, Error>
Lifecycle a patch.
Sourcepub fn assign<G>(
&mut self,
assignees: BTreeSet<Did>,
signer: &Device<G>,
) -> Result<EntryId, Error>
pub fn assign<G>( &mut self, assignees: BTreeSet<Did>, signer: &Device<G>, ) -> Result<EntryId, Error>
Assign a patch.
Sourcepub fn unarchive<G>(&mut self, signer: &Device<G>) -> Result<bool, Error>
pub fn unarchive<G>(&mut self, signer: &Device<G>) -> Result<bool, Error>
Mark an archived patch as ready to be reviewed again.
Returns false if the patch was not archived.
Sourcepub fn ready<G>(&mut self, signer: &Device<G>) -> Result<bool, Error>
pub fn ready<G>(&mut self, signer: &Device<G>) -> Result<bool, Error>
Mark a patch as ready to be reviewed.
Returns false if the patch was not a draft.
Methods from Deref<Target = Patch>§
Sourcepub fn target(&self) -> MergeTarget
pub fn target(&self) -> MergeTarget
Target this patch is meant to be merged in.
Sourcepub fn description(&self) -> &str
pub fn description(&self) -> &str
Patch description.
Author of the first revision of the patch.
All revision authors.
Sourcepub fn revision(&self, id: &RevisionId) -> Option<&Revision>
pub fn revision(&self, id: &RevisionId) -> Option<&Revision>
Get the Revision by its RevisionId.
None is returned if the Revision has been redacted (deleted).
Sourcepub fn updates(
&self,
) -> impl DoubleEndedIterator<Item = (RevisionId, &Revision)>
pub fn updates( &self, ) -> impl DoubleEndedIterator<Item = (RevisionId, &Revision)>
List of patch revisions by the patch author. The initial changeset is part of the first revision.
Sourcepub fn revisions(
&self,
) -> impl DoubleEndedIterator<Item = (RevisionId, &Revision)>
pub fn revisions( &self, ) -> impl DoubleEndedIterator<Item = (RevisionId, &Revision)>
List of all patch revisions by all authors.
Sourcepub fn revisions_by<'a>(
&'a self,
author: &'a PublicKey,
) -> impl DoubleEndedIterator<Item = (RevisionId, &'a Revision)>
pub fn revisions_by<'a>( &'a self, author: &'a PublicKey, ) -> impl DoubleEndedIterator<Item = (RevisionId, &'a Revision)>
List of patch revisions by the given author.
Sourcepub fn reviews_of(
&self,
rev: RevisionId,
) -> impl Iterator<Item = (&ReviewId, &Review)>
pub fn reviews_of( &self, rev: RevisionId, ) -> impl Iterator<Item = (&ReviewId, &Review)>
List of patch reviews of the given revision.
Sourcepub fn head(&self) -> &Oid
pub fn head(&self) -> &Oid
Reference to the Git object containing the code on the latest revision.
Sourcepub fn base(&self) -> &Oid
pub fn base(&self) -> &Oid
Get the commit of the target branch on which this patch is based. This can change via a patch update.
Sourcepub fn merge_base<R: ReadRepository>(&self, repo: &R) -> Result<Oid, Error>
pub fn merge_base<R: ReadRepository>(&self, repo: &R) -> Result<Oid, Error>
Get the merge base of this patch.
Sourcepub fn version(&self) -> RevisionIx
pub fn version(&self) -> RevisionIx
Index of latest revision in the revisions list.
Sourcepub fn root(&self) -> (RevisionId, &Revision)
pub fn root(&self) -> (RevisionId, &Revision)
Root revision.
This is the revision that was created with the patch.
Sourcepub fn latest(&self) -> (RevisionId, &Revision)
pub fn latest(&self) -> (RevisionId, &Revision)
Latest revision by the patch author.
Sourcepub fn latest_by<'a>(
&'a self,
author: &'a PublicKey,
) -> Option<(RevisionId, &'a Revision)>
pub fn latest_by<'a>( &'a self, author: &'a PublicKey, ) -> Option<(RevisionId, &'a Revision)>
Latest revision by the given author.
Sourcepub fn updated_at(&self) -> Timestamp
pub fn updated_at(&self) -> Timestamp
Time of last update.
Sourcepub fn is_archived(&self) -> bool
pub fn is_archived(&self) -> bool
Check if the patch is archived.
Apply authorization rules on patch actions.