Skip to main content

UpdateProvider

Trait UpdateProvider 

Source
pub trait UpdateProvider: Send + Sync {
    // Required methods
    fn latest(
        &self,
        request: &UpdateRequest,
    ) -> UpdateResult<Option<ArtifactDescriptor>>;
    fn fetch(
        &self,
        artifact: &ArtifactDescriptor,
        max_bytes: usize,
    ) -> UpdateResult<Vec<u8>>;
}
Expand description

Provider contract for listing and fetching opaque application artifacts.

Required Methods§

Source

fn latest( &self, request: &UpdateRequest, ) -> UpdateResult<Option<ArtifactDescriptor>>

Returns the newest eligible artifact, or None when no update exists.

Source

fn fetch( &self, artifact: &ArtifactDescriptor, max_bytes: usize, ) -> UpdateResult<Vec<u8>>

Fetches complete artifact bytes while respecting max_bytes.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§