Skip to main content

LabelProvider

Trait LabelProvider 

Source
pub trait LabelProvider:
    Debug
    + Send
    + Sync {
    // Required methods
    fn create<'life0, 'async_trait>(
        &'life0 self,
        args: CreateLabelArgs,
    ) -> Pin<Box<dyn Future<Output = Result<LabelData>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn list<'life0, 'async_trait>(
        &'life0 self,
        limit: Option<u32>,
    ) -> Pin<Box<dyn Future<Output = Result<Paged<LabelData>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn edit<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
        args: CreateLabelArgs,
    ) -> Pin<Box<dyn Future<Output = Result<LabelData>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn delete<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Platform abstraction for label management.

All platform implementations (GitHub/GitLab/GitCode) must implement this trait to provide unified label CRUD operations.

§Errors

All methods return CoreError on platform API failure, deserialization errors, or authentication failures.

Required Methods§

Source

fn create<'life0, 'async_trait>( &'life0 self, args: CreateLabelArgs, ) -> Pin<Box<dyn Future<Output = Result<LabelData>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create a new label in the repository.

§Errors

Returns an error if the platform API call fails, the label name already exists, or the parameters are invalid.

Source

fn list<'life0, 'async_trait>( &'life0 self, limit: Option<u32>, ) -> Pin<Box<dyn Future<Output = Result<Paged<LabelData>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List all labels in the repository.

limit 为 None 时取至 crate::paging::DEFAULT_LIST_LIMIT。

§Errors

Returns an error if the platform API call fails.

Source

fn edit<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, args: CreateLabelArgs, ) -> Pin<Box<dyn Future<Output = Result<LabelData>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Edit an existing label by name.

§Errors

Returns an error if the label does not exist or the platform API call fails.

Source

fn delete<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete a label by name.

§Errors

Returns an error if the label does not exist or the platform API call fails.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§