pub struct PullRequest {Show 16 fields
pub id: u64,
pub repo_key: String,
pub number: u32,
pub title: String,
pub description: String,
pub author: String,
pub state: PullRequestState,
pub source_branch: String,
pub target_branch: String,
pub source_commit: ObjectId,
pub target_commit: ObjectId,
pub labels: Vec<Label>,
pub created_at: u64,
pub updated_at: u64,
pub merged_at: Option<u64>,
pub merged_by: Option<String>,
}Expand description
A pull request for proposing changes to a repository.
Fields§
§id: u64Unique identifier within the store.
repo_key: StringRepository key (owner/repo).
number: u32Pull request number within the repository (#1, #2, etc.).
title: StringTitle of the pull request.
description: StringDescription/body of the pull request (Markdown).
Author’s public key (hex encoded).
state: PullRequestStateCurrent state of the pull request.
source_branch: StringSource branch name.
target_branch: StringTarget branch name (usually “main” or “master”).
source_commit: ObjectIdHead commit of the source branch.
target_commit: ObjectIdHead commit of the target branch at PR creation.
labels: Vec<Label>Labels applied to this pull request.
created_at: u64Unix timestamp when the PR was created.
updated_at: u64Unix timestamp when the PR was last updated.
merged_at: Option<u64>Unix timestamp when the PR was merged (if merged).
merged_by: Option<String>Public key of the user who merged the PR (if merged).
Implementations§
Source§impl PullRequest
impl PullRequest
Sourcepub fn new(
id: u64,
repo_key: impl Into<String>,
number: u32,
title: impl Into<String>,
description: impl Into<String>,
author: impl Into<String>,
source_branch: impl Into<String>,
target_branch: impl Into<String>,
source_commit: ObjectId,
target_commit: ObjectId,
) -> Self
pub fn new( id: u64, repo_key: impl Into<String>, number: u32, title: impl Into<String>, description: impl Into<String>, author: impl Into<String>, source_branch: impl Into<String>, target_branch: impl Into<String>, source_commit: ObjectId, target_commit: ObjectId, ) -> Self
Creates a new pull request.
Sourcepub fn update_title(&mut self, title: impl Into<String>)
pub fn update_title(&mut self, title: impl Into<String>)
Updates the title.
Sourcepub fn update_description(&mut self, description: impl Into<String>)
pub fn update_description(&mut self, description: impl Into<String>)
Updates the description.
Sourcepub fn remove_label(&mut self, name: &str)
pub fn remove_label(&mut self, name: &str)
Removes a label by name.
Sourcepub fn update_source_commit(&mut self, commit: ObjectId)
pub fn update_source_commit(&mut self, commit: ObjectId)
Updates the source commit (when new commits are pushed).
Trait Implementations§
Source§impl Clone for PullRequest
impl Clone for PullRequest
Source§fn clone(&self) -> PullRequest
fn clone(&self) -> PullRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more