pub struct PullRequest {
pub id: String,
pub title: String,
pub author: String,
pub target_branch: String,
pub changed_lines: i64,
pub files_touched: Vec<String>,
pub labels: Vec<String>,
pub approvals: i64,
pub is_draft: bool,
pub has_tests: bool,
}Expand description
A pull request, as the application around this embedding holds one.
A plain Rust struct with no Cove in it. PullRequest::to_cove is the
one place it becomes a value the boundary can carry, and that conversion
is what cove-rules-measure counts the allocations of.
Fields§
§id: String§title: String§target_branch: String§changed_lines: i64§files_touched: Vec<String>§labels: Vec<String>§approvals: i64§is_draft: bool§has_tests: boolImplementations§
Source§impl PullRequest
impl PullRequest
Sourcepub fn to_cove(&self) -> Value
pub fn to_cove(&self) -> Value
This pull request as the struct value reviews.PullRequest names,
which is what the Host API boundary carries.
Sourcepub fn to_policy(&self) -> Value
pub fn to_policy(&self) -> Value
The same ten fields as the struct value rules.policy.PullRequest
names, which is what Session::evaluate hands the rules directly.
The two are different types and always were: one is a
cove_schema::TypeSchema this crate wrote in Rust and the other is a
struct the rule package declared, and a Host API schema has no way to
name the second. What is new is that a host may build the second —
which is what makes rules.embedded.pullRequest’s field-by-field
rebuild unnecessary on this path, and is where a chunk of what the
boundary cost went.
Trait Implementations§
Source§impl Clone for PullRequest
impl Clone for PullRequest
Source§fn clone(&self) -> PullRequest
fn clone(&self) -> PullRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PullRequest
impl Debug for PullRequest
impl Eq for PullRequest
Source§impl PartialEq for PullRequest
impl PartialEq for PullRequest
Source§fn eq(&self, other: &PullRequest) -> bool
fn eq(&self, other: &PullRequest) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PullRequest
Auto Trait Implementations§
impl Freeze for PullRequest
impl RefUnwindSafe for PullRequest
impl Send for PullRequest
impl Sync for PullRequest
impl Unpin for PullRequest
impl UnsafeUnpin for PullRequest
impl UnwindSafe for PullRequest
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.