Skip to main content

MilestoneProvider

Trait MilestoneProvider 

Source
pub trait MilestoneProvider:
    Debug
    + Send
    + Sync {
    // Required methods
    fn create<'life0, 'async_trait>(
        &'life0 self,
        args: CreateMilestoneArgs,
    ) -> Pin<Box<dyn Future<Output = Result<MilestoneData>> + 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<MilestoneData>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn edit<'life0, 'async_trait>(
        &'life0 self,
        number: u64,
        args: CreateMilestoneArgs,
    ) -> Pin<Box<dyn Future<Output = Result<MilestoneData>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn close<'life0, 'async_trait>(
        &'life0 self,
        number: u64,
    ) -> Pin<Box<dyn Future<Output = Result<MilestoneData>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn reopen<'life0, 'async_trait>(
        &'life0 self,
        number: u64,
    ) -> Pin<Box<dyn Future<Output = Result<MilestoneData>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Platform abstraction for milestone management.

All platform implementations (GitHub/GitLab/GitCode) must implement this trait to provide unified milestone lifecycle 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: CreateMilestoneArgs, ) -> Pin<Box<dyn Future<Output = Result<MilestoneData>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create a new milestone.

§Errors

Returns an error if the platform API call fails or the parameters are invalid.

Source

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

List all milestones in the repository.

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

§Errors

Returns an error if the platform API call fails.

Source

fn edit<'life0, 'async_trait>( &'life0 self, number: u64, args: CreateMilestoneArgs, ) -> Pin<Box<dyn Future<Output = Result<MilestoneData>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Edit an existing milestone by number.

§Errors

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

Source

fn close<'life0, 'async_trait>( &'life0 self, number: u64, ) -> Pin<Box<dyn Future<Output = Result<MilestoneData>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Close a milestone by number.

§Errors

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

Source

fn reopen<'life0, 'async_trait>( &'life0 self, number: u64, ) -> Pin<Box<dyn Future<Output = Result<MilestoneData>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Reopen a closed milestone by number.

§Errors

Returns an error if the milestone 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§