pub struct LabelsClient { /* private fields */ }Expand description
Domain client for repository-level label catalogue operations.
Obtained via InstallationClient::labels(). Cheap to clone (Arc-backed).
Manages label definitions. To apply labels to a specific issue use
IssuesClient; to a PR use PullRequestsClient.
See docs/specs/interfaces/labels-client.md
Implementations§
Source§impl LabelsClient
impl LabelsClient
Sourcepub async fn list(
&self,
owner: &str,
repo: &str,
) -> Result<Vec<Label>, ApiError>
pub async fn list( &self, owner: &str, repo: &str, ) -> Result<Vec<Label>, ApiError>
List all label definitions in a repository (auto-paginated).
§Errors
ApiError::NotFound— repository does not exist
Sourcepub async fn create(
&self,
owner: &str,
repo: &str,
request: CreateLabelRequest,
) -> Result<Label, ApiError>
pub async fn create( &self, owner: &str, repo: &str, request: CreateLabelRequest, ) -> Result<Label, ApiError>
Create a new label definition.
§Errors
ApiError::InvalidRequest— name already exists (422)ApiError::AuthorizationFailed— missingissues: write
Sourcepub async fn update(
&self,
owner: &str,
repo: &str,
name: &str,
request: UpdateLabelRequest,
) -> Result<Label, ApiError>
pub async fn update( &self, owner: &str, repo: &str, name: &str, request: UpdateLabelRequest, ) -> Result<Label, ApiError>
Update an existing label definition.
Renaming via new_name updates all existing issue/PR references.
§Errors
ApiError::NotFound— label does not existApiError::AuthorizationFailed— missingissues: write
Trait Implementations§
Source§impl Clone for LabelsClient
impl Clone for LabelsClient
Source§fn clone(&self) -> LabelsClient
fn clone(&self) -> LabelsClient
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 LabelsClient
impl !UnwindSafe for LabelsClient
impl Freeze for LabelsClient
impl Send for LabelsClient
impl Sync for LabelsClient
impl Unpin for LabelsClient
impl UnsafeUnpin for LabelsClient
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