Action

Enum Action 

Source
pub enum Action {
Show 23 variants Edit { title: Title, target: MergeTarget, }, Label { labels: BTreeSet<Label>, }, Lifecycle { state: Lifecycle, }, Assign { assignees: BTreeSet<Did>, }, Merge { revision: RevisionId, commit: Oid, }, Review { revision: RevisionId, summary: Option<String>, verdict: Option<Verdict>, labels: Vec<Label>, }, ReviewRedact { review: ReviewId, }, ReviewComment { review: ReviewId, body: String, location: Option<CodeLocation>, reply_to: Option<CommentId>, embeds: Vec<Embed<Uri>>, }, ReviewCommentEdit { review: ReviewId, comment: EntryId, body: String, embeds: Vec<Embed<Uri>>, }, ReviewCommentRedact { review: ReviewId, comment: EntryId, }, ReviewCommentReact { review: ReviewId, comment: EntryId, reaction: Reaction, active: bool, }, ReviewCommentResolve { review: ReviewId, comment: EntryId, }, ReviewCommentUnresolve { review: ReviewId, comment: EntryId, }, ReviewReact { review: ReviewId, reaction: Reaction, active: bool, }, Revision { description: String, base: Oid, oid: Oid, resolves: BTreeSet<(EntryId, CommentId)>, }, RevisionEdit { revision: RevisionId, description: String, embeds: Vec<Embed<Uri>>, }, RevisionReact { revision: RevisionId, location: Option<CodeLocation>, reaction: Reaction, active: bool, }, RevisionRedact { revision: RevisionId, }, RevisionComment { revision: RevisionId, location: Option<CodeLocation>, body: String, reply_to: Option<CommentId>, embeds: Vec<Embed<Uri>>, }, RevisionCommentEdit { revision: RevisionId, comment: CommentId, body: String, embeds: Vec<Embed<Uri>>, }, RevisionCommentRedact { revision: RevisionId, comment: CommentId, }, RevisionCommentReact { revision: RevisionId, comment: CommentId, reaction: Reaction, active: bool, }, ReviewEdit(ReviewEdit),
}
Expand description

Patch operation.

Variants§

§

Edit

Fields

§title: Title
§

Label

Fields

§labels: BTreeSet<Label>
§

Lifecycle

Fields

§

Assign

Fields

§assignees: BTreeSet<Did>
§

Merge

Fields

§revision: RevisionId
§commit: Oid
§

Review

Fields

§revision: RevisionId
§summary: Option<String>
§verdict: Option<Verdict>
§labels: Vec<Label>
§

ReviewRedact

Fields

§review: ReviewId
§

ReviewComment

Fields

§review: ReviewId
§body: String
§reply_to: Option<CommentId>

Comment this is a reply to. Should be None if it’s the first comment. Should be Some otherwise.

§embeds: Vec<Embed<Uri>>

Embeded content.

§

ReviewCommentEdit

Fields

§review: ReviewId
§comment: EntryId
§body: String
§embeds: Vec<Embed<Uri>>
§

ReviewCommentRedact

Fields

§review: ReviewId
§comment: EntryId
§

ReviewCommentReact

Fields

§review: ReviewId
§comment: EntryId
§reaction: Reaction
§active: bool
§

ReviewCommentResolve

Fields

§review: ReviewId
§comment: EntryId
§

ReviewCommentUnresolve

Fields

§review: ReviewId
§comment: EntryId
§

ReviewReact

React to the review.

Fields

§review: ReviewId
§reaction: Reaction
§active: bool
§

Revision

Fields

§description: String
§base: Oid
§oid: Oid
§resolves: BTreeSet<(EntryId, CommentId)>

Review comments resolved by this revision.

§

RevisionEdit

Fields

§revision: RevisionId
§description: String
§embeds: Vec<Embed<Uri>>

Embeded content.

§

RevisionReact

React to the revision.

Fields

§revision: RevisionId
§reaction: Reaction
§active: bool
§

RevisionRedact

Fields

§revision: RevisionId
§

RevisionComment

Fields

§revision: RevisionId

The revision to comment on.

§location: Option<CodeLocation>

For comments on the revision code.

§body: String

Comment body.

§reply_to: Option<CommentId>

Comment this is a reply to. Should be None if it’s the top-level comment. Should be the root CommentId if it’s a top-level comment.

§embeds: Vec<Embed<Uri>>

Embeded content.

§

RevisionCommentEdit

Edit a revision comment.

Fields

§revision: RevisionId
§comment: CommentId
§body: String
§embeds: Vec<Embed<Uri>>
§

RevisionCommentRedact

Redact a revision comment.

Fields

§revision: RevisionId
§comment: CommentId
§

RevisionCommentReact

React to a revision comment.

Fields

§revision: RevisionId
§comment: CommentId
§reaction: Reaction
§active: bool
§

ReviewEdit(ReviewEdit)

Edit a review’s summary, verdict, labels, and embeds.

Trait Implementations§

Source§

impl Clone for Action

Source§

fn clone(&self) -> Action

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl CobAction for Action

Source§

fn parents(&self) -> Vec<Oid>

Parent objects this action depends on. For example, patch revisions have the commit objects as their parent.
Source§

fn produces_identifier(&self) -> bool

The outcome of some actions are to be referred later. For example, one action may create a comment, followed by another action that may create a reply to the comment, referring to it. Since actions are stored as part of crate::cob::op::Op, and operations are the smallest identifiable units, this may lead to ambiguity. It would not be possible to to, say, address one particular comment out of two, if the corresponding actions of creations were part of the same operation. To help avoid this, implementations signal whether specific actions require “their own” identifier. This allows checking for multiple such actions before creating an operation.
Source§

impl Debug for Action

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Action

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Action

Source§

fn eq(&self, other: &Action) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Action

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for Action

Source§

impl StructuralPartialEq for Action

Auto Trait Implementations§

§

impl Freeze for Action

§

impl RefUnwindSafe for Action

§

impl Send for Action

§

impl Sync for Action

§

impl Unpin for Action

§

impl UnwindSafe for Action

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

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