pub struct DistroEntry {
pub name: &'static str,
pub description: &'static str,
pub version: &'static str,
pub url: &'static str,
pub mirrors: &'static [&'static str],
pub size_bytes: u64,
pub filename: &'static str,
pub sha256: Option<&'static str>,
pub category: DistroCategory,
pub arch: &'static str,
pub is_live: bool,
}Expand description
A downloadable distribution entry
Fields§
§name: &'static strDisplay name
description: &'static strShort description
version: &'static strVersion string
url: &'static strPrimary download URL
mirrors: &'static [&'static str]Mirror URLs (fallbacks)
size_bytes: u64Expected file size in bytes (approximate)
filename: &'static strFilename to save as
sha256: Option<&'static str>SHA256 checksum (hex string, if known)
category: DistroCategoryCategory
arch: &'static strArchitecture (x86_64, aarch64, etc.)
is_live: boolWhether this is a live ISO
Implementations§
Source§impl DistroEntry
impl DistroEntry
Sourcepub const fn new(
name: &'static str,
description: &'static str,
version: &'static str,
url: &'static str,
size_bytes: u64,
filename: &'static str,
category: DistroCategory,
) -> Self
pub const fn new( name: &'static str, description: &'static str, version: &'static str, url: &'static str, size_bytes: u64, filename: &'static str, category: DistroCategory, ) -> Self
Create a new distro entry with defaults
Sourcepub const fn with_mirrors(self, mirrors: &'static [&'static str]) -> Self
pub const fn with_mirrors(self, mirrors: &'static [&'static str]) -> Self
Add mirror URLs
Sourcepub const fn with_sha256(self, sha256: &'static str) -> Self
pub const fn with_sha256(self, sha256: &'static str) -> Self
Add SHA256 checksum
Sourcepub fn is_valid_url(&self) -> bool
pub fn is_valid_url(&self) -> bool
Check if URL is valid (basic check)
Sourcepub fn is_valid_filename(&self) -> bool
pub fn is_valid_filename(&self) -> bool
Check if filename is valid
Trait Implementations§
Source§impl Clone for DistroEntry
impl Clone for DistroEntry
Source§fn clone(&self) -> DistroEntry
fn clone(&self) -> DistroEntry
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DistroEntry
impl RefUnwindSafe for DistroEntry
impl Send for DistroEntry
impl Sync for DistroEntry
impl Unpin for DistroEntry
impl UnwindSafe for DistroEntry
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