Skip to main content

ForgeRelease

Trait ForgeRelease 

Source
pub trait ForgeRelease {
    type Error: StdError + Send + Sync + 'static;

    // Required methods
    async fn asset_bytes(
        &self,
        asset: &RemoteAsset,
    ) -> Result<Vec<u8>, Self::Error>;
    async fn assets(
        &self,
        release_id: u64,
    ) -> Result<Vec<RemoteAsset>, Self::Error>;
    async fn create_draft(
        &self,
        tag: &str,
        target_commit: &str,
        title: &str,
        notes: &str,
    ) -> Result<u64, Self::Error>;
    async fn delete_asset(
        &self,
        release_id: u64,
        asset_id: u64,
    ) -> Result<(), Self::Error>;
    async fn publish(&self, release_id: u64) -> Result<(), Self::Error>;
    async fn release_by_tag(
        &self,
        tag: &str,
    ) -> Result<Option<RemoteRelease>, Self::Error>;
    async fn upload(
        &self,
        release_id: u64,
        filename: &str,
        bytes: &[u8],
    ) -> Result<(), Self::Error>;
}
Expand description

Forge-hosted releases and release assets.

Required Associated Types§

Source

type Error: StdError + Send + Sync + 'static

The failure of a forge release call.

Required Methods§

Source

async fn asset_bytes(&self, asset: &RemoteAsset) -> Result<Vec<u8>, Self::Error>

Download an attached asset for verification.

Source

async fn assets(&self, release_id: u64) -> Result<Vec<RemoteAsset>, Self::Error>

Assets already attached to the release.

Source

async fn create_draft( &self, tag: &str, target_commit: &str, title: &str, notes: &str, ) -> Result<u64, Self::Error>

Create a hidden release on tag and return its identifier.

Source

async fn delete_asset( &self, release_id: u64, asset_id: u64, ) -> Result<(), Self::Error>

Remove one asset from a draft release.

Source

async fn publish(&self, release_id: u64) -> Result<(), Self::Error>

Make the draft visible.

Source

async fn release_by_tag( &self, tag: &str, ) -> Result<Option<RemoteRelease>, Self::Error>

The release for tag, draft or published, if one exists.

Source

async fn upload( &self, release_id: u64, filename: &str, bytes: &[u8], ) -> Result<(), Self::Error>

Attach one file to the release.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§