pub struct PatchState {Show 15 fields
pub id: OpId,
pub repo_id: RepoId,
pub author: ActorId,
pub title: String,
pub description: String,
pub base_ref: String,
pub base_commit: String,
pub head_commit: String,
pub revisions: Vec<PatchRevision>,
pub status: PatchStatus,
pub review_comments: Vec<PatchReviewComment>,
pub verdicts_by_reviewer: BTreeMap<ActorId, PatchReviewVerdict>,
pub all_verdicts: Vec<PatchReviewVerdict>,
pub created_at: u64,
pub updated_at: u64,
}Expand description
Materialised patch / pull-request state with Strong Eventual Consistency.
Fields§
§id: OpId§repo_id: RepoId§title: String§description: String§base_ref: String§base_commit: String§head_commit: String§revisions: Vec<PatchRevision>§status: PatchStatus§review_comments: Vec<PatchReviewComment>§verdicts_by_reviewer: BTreeMap<ActorId, PatchReviewVerdict>§all_verdicts: Vec<PatchReviewVerdict>§created_at: u64§updated_at: u64Implementations§
Source§impl PatchState
impl PatchState
Sourcepub fn from_dag(dag: &Dag<PatchAction>) -> Result<Self, CobError>
pub fn from_dag(dag: &Dag<PatchAction>) -> Result<Self, CobError>
Resolves a patch DAG into a deterministic PatchState.
Sourcepub fn maintainer_approvals(&self, maintainers: &[ActorId]) -> Vec<ActorId>
pub fn maintainer_approvals(&self, maintainers: &[ActorId]) -> Vec<ActorId>
Returns maintainers whose latest verdict approves the current head_commit.
Sourcepub fn has_blocking_changes(&self, maintainers: &[ActorId]) -> bool
pub fn has_blocking_changes(&self, maintainers: &[ActorId]) -> bool
Returns true if any maintainer currently requests changes on the current head_commit.
Sourcepub fn meets_quorum(&self, quorum: u32, maintainers: &[ActorId]) -> bool
pub fn meets_quorum(&self, quorum: u32, maintainers: &[ActorId]) -> bool
Returns true when maintainer approvals meet quorum and no maintainer requests changes.
Trait Implementations§
Source§impl Clone for PatchState
impl Clone for PatchState
Source§impl Debug for PatchState
impl Debug for PatchState
Source§impl<'de> Deserialize<'de> for PatchState
impl<'de> Deserialize<'de> for PatchState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for PatchState
Source§impl PartialEq for PatchState
impl PartialEq for PatchState
Source§impl Serialize for PatchState
impl Serialize for PatchState
impl StructuralPartialEq for PatchState
Auto Trait Implementations§
impl Forget for PatchState
impl Freeze for PatchStatewhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<PatchRevision>: Freeze,
PhantomData<PatchReviewComment>: Freeze,
*const LeafNode<ActorId, PatchReviewVerdict> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(ActorId, PatchReviewVerdict)>>: Freeze,
PhantomData<PatchReviewVerdict>: Freeze,
impl Move for PatchState
impl RefUnwindSafe for PatchState
impl Send for PatchStatewhere
RawVecInner: Send,
NodeRef<Owned, ActorId, PatchReviewVerdict, LeafOrInternal>: Send,
BoxRaw<(ActorId, PatchReviewVerdict)>: Send,
impl Sync for PatchStatewhere
RawVecInner: Sync,
NodeRef<Owned, ActorId, PatchReviewVerdict, LeafOrInternal>: Sync,
BoxRaw<(ActorId, PatchReviewVerdict)>: Sync,
impl Unpin for PatchState
impl UnsafeUnpin for PatchStatewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<PatchRevision>: UnsafeUnpin,
PhantomData<PatchReviewComment>: UnsafeUnpin,
*const LeafNode<ActorId, PatchReviewVerdict> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(ActorId, PatchReviewVerdict)>>: UnsafeUnpin,
PhantomData<PatchReviewVerdict>: UnsafeUnpin,
impl UnwindSafe for PatchState
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