Skip to main content

RepositoryFile

Trait RepositoryFile 

Source
pub trait RepositoryFile {
    type Id: Clone;

    // Required methods
    fn file_id(&self) -> Option<Self::Id>;
    fn file_name(&self) -> &str;
    fn size_bytes(&self) -> Option<u64>;

    // Provided methods
    fn checksum(&self) -> Option<&str> { ... }
    fn download_url(&self) -> Option<&Url> { ... }
}
Expand description

Shared inspection surface for remote file entries.

Required Associated Types§

Source

type Id: Clone

Service-specific file identifier type.

Required Methods§

Source

fn file_id(&self) -> Option<Self::Id>

Returns the file identifier when the service exposes one.

Source

fn file_name(&self) -> &str

Returns the remote filename or key.

Source

fn size_bytes(&self) -> Option<u64>

Returns the file size in bytes when known.

Provided Methods§

Source

fn checksum(&self) -> Option<&str>

Returns a checksum string when the service reports one.

Source

fn download_url(&self) -> Option<&Url>

Returns the best direct download URL when one is already present on the payload.

Implementors§