pub struct MilestonesClient { /* private fields */ }Expand description
Domain client for milestone lifecycle operations.
Obtained via InstallationClient::milestones(). Cheap to clone (Arc-backed).
Manages milestone definitions. To assign a milestone to a specific issue
use IssuesClient::set_milestone; for a PR use PullRequestsClient::set_milestone.
See docs/specs/interfaces/milestones-client.md
Implementations§
Source§impl MilestonesClient
impl MilestonesClient
Sourcepub async fn list(
&self,
owner: &str,
repo: &str,
query: Option<ListMilestonesQuery>,
) -> Result<Vec<Milestone>, ApiError>
pub async fn list( &self, owner: &str, repo: &str, query: Option<ListMilestonesQuery>, ) -> Result<Vec<Milestone>, ApiError>
List all milestones in a repository (auto-paginated).
§Errors
ApiError::NotFound— repository does not exist
Sourcepub async fn get(
&self,
owner: &str,
repo: &str,
milestone_number: u64,
) -> Result<Milestone, ApiError>
pub async fn get( &self, owner: &str, repo: &str, milestone_number: u64, ) -> Result<Milestone, ApiError>
Get a single milestone by its repository-scoped number.
§Errors
ApiError::NotFound— milestone does not exist
Sourcepub async fn create(
&self,
owner: &str,
repo: &str,
request: CreateMilestoneRequest,
) -> Result<Milestone, ApiError>
pub async fn create( &self, owner: &str, repo: &str, request: CreateMilestoneRequest, ) -> Result<Milestone, ApiError>
Create a new milestone.
§Errors
ApiError::InvalidRequest— title is emptyApiError::AuthorizationFailed— missingissues: write
Sourcepub async fn update(
&self,
owner: &str,
repo: &str,
milestone_number: u64,
request: UpdateMilestoneRequest,
) -> Result<Milestone, ApiError>
pub async fn update( &self, owner: &str, repo: &str, milestone_number: u64, request: UpdateMilestoneRequest, ) -> Result<Milestone, ApiError>
Update an existing milestone.
§Errors
ApiError::NotFound— milestone does not existApiError::AuthorizationFailed— missingissues: write
Sourcepub async fn delete(
&self,
owner: &str,
repo: &str,
milestone_number: u64,
) -> Result<(), ApiError>
pub async fn delete( &self, owner: &str, repo: &str, milestone_number: u64, ) -> Result<(), ApiError>
Delete a milestone.
Issues assigned to the deleted milestone are unlinked but otherwise unaffected.
§Errors
ApiError::NotFound— milestone does not existApiError::AuthorizationFailed— missingissues: write
Trait Implementations§
Source§impl Clone for MilestonesClient
impl Clone for MilestonesClient
Source§fn clone(&self) -> MilestonesClient
fn clone(&self) -> MilestonesClient
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for MilestonesClient
impl !UnwindSafe for MilestonesClient
impl Freeze for MilestonesClient
impl Send for MilestonesClient
impl Sync for MilestonesClient
impl Unpin for MilestonesClient
impl UnsafeUnpin for MilestonesClient
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