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§
Sourcefn is_available(&self) -> Result<bool>
fn is_available(&self) -> Result<bool>
Check if the source is available and can be accessed
Sourcefn fetch_all(
&self,
progress: &mut dyn ProgressIndicator,
) -> Result<Vec<JdkMetadata>>
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
Sourcefn fetch_distribution(
&self,
distribution: &str,
progress: &mut dyn ProgressIndicator,
) -> Result<Vec<JdkMetadata>>
fn fetch_distribution( &self, distribution: &str, progress: &mut dyn ProgressIndicator, ) -> Result<Vec<JdkMetadata>>
Fetch metadata for a specific distribution
Sourcefn fetch_package_details(
&self,
package_id: &str,
progress: &mut dyn ProgressIndicator,
) -> Result<PackageDetails>
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
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".