Skip to main content

MetadataSource

Trait MetadataSource 

Source
pub trait MetadataSource: Send + Sync {
    // Required methods
    fn id(&self) -> &str;
    fn name(&self) -> &str;
    fn is_available(&self) -> Result<bool>;
    fn fetch_all(
        &self,
        progress: &mut dyn ProgressIndicator,
    ) -> Result<Vec<JdkMetadata>>;
    fn fetch_distribution(
        &self,
        distribution: &str,
        progress: &mut dyn ProgressIndicator,
    ) -> Result<Vec<JdkMetadata>>;
    fn fetch_package_details(
        &self,
        package_id: &str,
        progress: &mut dyn ProgressIndicator,
    ) -> Result<PackageDetails>;
    fn last_updated(&self) -> Result<Option<DateTime<Utc>>>;
}
Expand description

Trait for metadata sources (synchronous)

Required Methods§

Source

fn id(&self) -> &str

Get a unique identifier for this source

Source

fn name(&self) -> &str

Get a human-readable name for this source

Source

fn is_available(&self) -> Result<bool>

Check if the source is available and can be accessed

Source

fn fetch_all( &self, progress: &mut dyn ProgressIndicator, ) -> Result<Vec<JdkMetadata>>

Fetch all available metadata from this source For foojay: returns metadata with is_complete=false For local/GitHub: returns metadata with is_complete=true

Source

fn fetch_distribution( &self, distribution: &str, progress: &mut dyn ProgressIndicator, ) -> Result<Vec<JdkMetadata>>

Fetch metadata for a specific distribution

Source

fn fetch_package_details( &self, package_id: &str, progress: &mut dyn ProgressIndicator, ) -> Result<PackageDetails>

Fetch complete details for a specific package (used by MetadataProvider) Only needed for sources that return incomplete metadata

Source

fn last_updated(&self) -> Result<Option<DateTime<Utc>>>

Get the last update time of the source (if applicable)

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§