pub struct Release {
pub id: ReleaseId,
pub repo_key: String,
pub tag_name: String,
pub target_commitish: String,
pub name: Option<String>,
pub body: Option<String>,
pub draft: bool,
pub prerelease: bool,
pub author: String,
pub assets: Vec<ReleaseAsset>,
pub created_at: u64,
pub published_at: Option<u64>,
}Expand description
A release (tagged version) in a repository.
Fields§
§id: ReleaseIdUnique release ID.
repo_key: StringRepository key (owner/name).
tag_name: StringTag name (e.g., “v1.0.0”).
target_commitish: StringTarget branch or commit SHA.
name: Option<String>Release title (optional).
body: Option<String>Markdown body (changelog, notes).
draft: boolWhether this is a draft release.
prerelease: boolWhether this is a prerelease.
Username of the author.
assets: Vec<ReleaseAsset>Attached assets.
created_at: u64When the release was created.
published_at: Option<u64>When the release was published (None if draft).
Implementations§
Source§impl Release
impl Release
Sourcepub fn new(
id: ReleaseId,
repo_key: String,
tag_name: String,
target_commitish: String,
author: String,
) -> Self
pub fn new( id: ReleaseId, repo_key: String, tag_name: String, target_commitish: String, author: String, ) -> Self
Create a new release.
Sourcepub fn is_publishable(&self) -> bool
pub fn is_publishable(&self) -> bool
Check if this is the latest non-prerelease, non-draft release.
Sourcepub fn add_asset(&mut self, asset: ReleaseAsset)
pub fn add_asset(&mut self, asset: ReleaseAsset)
Add an asset to this release.
Sourcepub fn remove_asset(&mut self, asset_id: AssetId) -> Option<ReleaseAsset>
pub fn remove_asset(&mut self, asset_id: AssetId) -> Option<ReleaseAsset>
Remove an asset by ID.
Sourcepub fn to_response(&self) -> ReleaseResponse
pub fn to_response(&self) -> ReleaseResponse
Convert to API response.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Release
impl<'de> Deserialize<'de> for Release
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Release
impl RefUnwindSafe for Release
impl Send for Release
impl Sync for Release
impl Unpin for Release
impl UnsafeUnpin for Release
impl UnwindSafe for Release
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more