pub struct ReleaseAsset {
pub id: AssetId,
pub release_id: ReleaseId,
pub name: String,
pub label: Option<String>,
pub content_type: String,
pub size: u64,
pub download_count: u64,
pub content_hash: String,
pub created_at: u64,
pub uploader: String,
}Expand description
An asset attached to a release.
Fields§
§id: AssetIdUnique asset ID.
release_id: ReleaseIdRelease this asset belongs to.
name: StringFilename.
label: Option<String>Optional label for display.
content_type: StringMIME content type.
size: u64Size in bytes.
download_count: u64Download count.
content_hash: StringSHA-256 hash of content.
created_at: u64When the asset was uploaded.
uploader: StringUsername of uploader.
Implementations§
Source§impl ReleaseAsset
impl ReleaseAsset
Sourcepub fn new(
id: AssetId,
release_id: ReleaseId,
name: String,
content_type: String,
size: u64,
content_hash: String,
uploader: String,
) -> Self
pub fn new( id: AssetId, release_id: ReleaseId, name: String, content_type: String, size: u64, content_hash: String, uploader: String, ) -> Self
Create a new asset.
Sourcepub fn increment_downloads(&mut self)
pub fn increment_downloads(&mut self)
Increment the download count.
Sourcepub fn to_response(&self) -> AssetResponse
pub fn to_response(&self) -> AssetResponse
Convert to API response.
Trait Implementations§
Source§impl Clone for ReleaseAsset
impl Clone for ReleaseAsset
Source§fn clone(&self) -> ReleaseAsset
fn clone(&self) -> ReleaseAsset
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ReleaseAsset
impl Debug for ReleaseAsset
Source§impl<'de> Deserialize<'de> for ReleaseAsset
impl<'de> Deserialize<'de> for ReleaseAsset
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 ReleaseAsset
impl RefUnwindSafe for ReleaseAsset
impl Send for ReleaseAsset
impl Sync for ReleaseAsset
impl Unpin for ReleaseAsset
impl UnsafeUnpin for ReleaseAsset
impl UnwindSafe for ReleaseAsset
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