Trait git_next_git::ForgeLike

source ·
pub trait ForgeLike: Debug + Send + Sync {
    // Required methods
    fn duplicate(&self) -> Box<dyn ForgeLike>;
    fn name(&self) -> String;
    fn is_message_authorised(
        &self,
        message: &ForgeNotification,
        expected: &WebhookAuth,
    ) -> bool;
    fn parse_webhook_body(&self, body: &Body) -> Result<Push>;
    fn commit_status<'life0, 'life1, 'async_trait>(
        &'life0 self,
        commit: &'life1 Commit,
    ) -> Pin<Box<dyn Future<Output = Status> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_webhooks<'life0, 'life1, 'async_trait>(
        &'life0 self,
        url: &'life1 WebhookUrl,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<WebhookId>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn unregister_webhook<'life0, 'life1, 'async_trait>(
        &'life0 self,
        webhook: &'life1 WebhookId,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn register_webhook<'life0, 'life1, 'async_trait>(
        &'life0 self,
        webhook_url: &'life1 WebhookUrl,
    ) -> Pin<Box<dyn Future<Output = Result<RegisteredWebhook>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn should_ignore_message(&self, _message: &ForgeNotification) -> bool { ... }
}

Required Methods§

source

fn duplicate(&self) -> Box<dyn ForgeLike>

source

fn name(&self) -> String

source

fn is_message_authorised( &self, message: &ForgeNotification, expected: &WebhookAuth, ) -> bool

Checks that the message has a valid authorisation.

source

fn parse_webhook_body(&self, body: &Body) -> Result<Push>

Parses the webhook body into Some(Push) struct if appropriate, or None if not.

source

fn commit_status<'life0, 'life1, 'async_trait>( &'life0 self, commit: &'life1 Commit, ) -> Pin<Box<dyn Future<Output = Status> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Checks the results of any (e.g. CI) status checks for the commit.

source

fn list_webhooks<'life0, 'life1, 'async_trait>( &'life0 self, url: &'life1 WebhookUrl, ) -> Pin<Box<dyn Future<Output = Result<Vec<WebhookId>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source

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

source

fn register_webhook<'life0, 'life1, 'async_trait>( &'life0 self, webhook_url: &'life1 WebhookUrl, ) -> Pin<Box<dyn Future<Output = Result<RegisteredWebhook>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Provided Methods§

source

fn should_ignore_message(&self, _message: &ForgeNotification) -> bool

Checks if the message should be ignored.

Default implementation says that no messages should be ignored.

Implementors§