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 = Result<Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn list_webhooks<'life0, 'life1, 'async_trait>(
&'life0 self,
repo_listen_url: &'life1 RepoListenUrl,
) -> 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,
repo_listen_url: &'life1 RepoListenUrl,
) -> 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§
fn duplicate(&self) -> Box<dyn ForgeLike>
fn name(&self) -> String
Checks that the message has a valid authorisation.
Sourcefn parse_webhook_body(&self, body: &Body) -> Result<Push>
fn parse_webhook_body(&self, body: &Body) -> Result<Push>
Parses the webhook body into Some(Push) struct if appropriate, or None if not.
§Errors
Will return an Err
if the body is not a message in the expected format.
Sourcefn commit_status<'life0, 'life1, 'async_trait>(
&'life0 self,
commit: &'life1 Commit,
) -> Pin<Box<dyn Future<Output = Result<Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn commit_status<'life0, 'life1, 'async_trait>(
&'life0 self,
commit: &'life1 Commit,
) -> Pin<Box<dyn Future<Output = Result<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.
fn list_webhooks<'life0, 'life1, 'async_trait>(
&'life0 self,
repo_listen_url: &'life1 RepoListenUrl,
) -> 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,
repo_listen_url: &'life1 RepoListenUrl,
) -> Pin<Box<dyn Future<Output = Result<RegisteredWebhook>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Provided Methods§
Sourcefn should_ignore_message(&self, message: &ForgeNotification) -> bool
fn should_ignore_message(&self, message: &ForgeNotification) -> bool
Checks if the message should be ignored.
Default implementation says that no messages should be ignored.