Skip to main content

CollaborationStore

Struct CollaborationStore 

Source
pub struct CollaborationStore { /* private fields */ }
Expand description

In-memory store for collaboration data.

Thread-safe storage for pull requests, issues, comments, and reviews.

Implementations§

Source§

impl CollaborationStore

Source

pub fn new() -> Self

Creates a new empty store.

Source

pub fn create_pull_request(&self, pr: PullRequest) -> Result<PullRequest>

Creates a new pull request.

Source

pub fn get_pull_request( &self, repo_key: &str, number: u32, ) -> Result<PullRequest>

Gets a pull request by repository and number.

Source

pub fn list_pull_requests( &self, repo_key: &str, state: Option<PullRequestState>, ) -> Vec<PullRequest>

Lists pull requests for a repository.

Source

pub fn update_pull_request<F>( &self, repo_key: &str, number: u32, f: F, ) -> Result<PullRequest>
where F: FnOnce(&mut PullRequest) -> Result<()>,

Updates a pull request.

Source

pub fn close_pull_request( &self, repo_key: &str, number: u32, ) -> Result<PullRequest>

Closes a pull request.

Source

pub fn reopen_pull_request( &self, repo_key: &str, number: u32, ) -> Result<PullRequest>

Reopens a pull request.

Source

pub fn merge_pull_request( &self, repo_key: &str, number: u32, merged_by: &str, ) -> Result<PullRequest>

Merges a pull request.

Source

pub fn create_issue(&self, issue: Issue) -> Result<Issue>

Creates a new issue.

Source

pub fn get_issue(&self, repo_key: &str, number: u32) -> Result<Issue>

Gets an issue by repository and number.

Source

pub fn list_issues( &self, repo_key: &str, state: Option<IssueState>, ) -> Vec<Issue>

Lists issues for a repository.

Source

pub fn update_issue<F>( &self, repo_key: &str, number: u32, f: F, ) -> Result<Issue>
where F: FnOnce(&mut Issue) -> Result<()>,

Updates an issue.

Source

pub fn close_issue( &self, repo_key: &str, number: u32, closed_by: &str, ) -> Result<Issue>

Closes an issue.

Source

pub fn reopen_issue(&self, repo_key: &str, number: u32) -> Result<Issue>

Reopens an issue.

Source

pub fn create_comment(&self, comment: Comment) -> Result<Comment>

Creates a new comment.

Source

pub fn get_comment(&self, id: u64) -> Result<Comment>

Gets a comment by ID.

Source

pub fn list_pr_comments(&self, repo_key: &str, number: u32) -> Vec<Comment>

Lists comments for a pull request.

Source

pub fn list_issue_comments(&self, repo_key: &str, number: u32) -> Vec<Comment>

Lists comments for an issue.

Source

pub fn update_comment(&self, id: u64, body: &str) -> Result<Comment>

Updates a comment.

Source

pub fn delete_comment(&self, id: u64) -> Result<()>

Deletes a comment.

Source

pub fn create_review(&self, review: Review) -> Result<Review>

Creates a new review.

Source

pub fn get_review(&self, id: u64) -> Result<Review>

Gets a review by ID.

Source

pub fn list_reviews(&self, repo_key: &str, pr_number: u32) -> Vec<Review>

Lists reviews for a pull request.

Source

pub fn dismiss_review(&self, id: u64) -> Result<Review>

Dismisses a review.

Source

pub fn all_pull_requests(&self) -> Vec<PullRequest>

Gets all pull requests.

Source

pub fn all_issues(&self) -> Vec<Issue>

Gets all issues.

Source

pub fn all_comments(&self) -> Vec<Comment>

Gets all comments.

Source

pub fn all_reviews(&self) -> Vec<Review>

Gets all reviews.

Source

pub fn import_pull_request(&self, pr: PullRequest) -> Result<()>

Imports a pull request (for P2P sync).

Source

pub fn import_issue(&self, issue: Issue) -> Result<()>

Imports an issue (for P2P sync).

Source

pub fn import_comment(&self, comment: Comment) -> Result<()>

Imports a comment (for P2P sync).

Source

pub fn import_review(&self, review: Review) -> Result<()>

Imports a review (for P2P sync).

Trait Implementations§

Source§

impl Default for CollaborationStore

Source§

fn default() -> CollaborationStore

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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> 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, 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.