Skip to main content

RepoProvider

Trait RepoProvider 

Source
pub trait RepoProvider:
    TufRepositoryProvider<Pouf1>
    + Debug
    + Send
    + Sync {
    // Required methods
    fn aliases(&self) -> &BTreeSet<String>;
    fn fetch_metadata_range<'a>(
        &'a self,
        path: &str,
        range: Range,
    ) -> BoxFuture<'a, Result<Resource, Error>>;
    fn fetch_blob_range<'a>(
        &'a self,
        path: &str,
        range: Range,
    ) -> BoxFuture<'a, Result<Resource, Error>>;
    fn blob_modification_time<'a>(
        &'a self,
        path: &str,
    ) -> BoxFuture<'a, Result<Option<SystemTime>>>;

    // Provided methods
    fn supports_watch(&self) -> bool { ... }
    fn watch(&self) -> Result<BoxStream<'static, ()>> { ... }
    fn blob_type(&self) -> DeliveryBlobType { ... }
}

Required Methods§

Source

fn aliases(&self) -> &BTreeSet<String>

Get the repository aliases.

Source

fn fetch_metadata_range<'a>( &'a self, path: &str, range: Range, ) -> BoxFuture<'a, Result<Resource, Error>>

Fetch a metadata Resource from this repository.

Source

fn fetch_blob_range<'a>( &'a self, path: &str, range: Range, ) -> BoxFuture<'a, Result<Resource, Error>>

Fetch a blob Resource from this repository.

Source

fn blob_modification_time<'a>( &'a self, path: &str, ) -> BoxFuture<'a, Result<Option<SystemTime>>>

Get the modification time of a blob in this repository if available.

Provided Methods§

Source

fn supports_watch(&self) -> bool

Whether or not the backend supports watching for file changes.

Source

fn watch(&self) -> Result<BoxStream<'static, ()>>

Returns a stream which sends a unit value every time the given path is modified.

Source

fn blob_type(&self) -> DeliveryBlobType

Get the type of delivery blobs in this repository.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T: RepoProvider + ?Sized> RepoProvider for &T

Source§

fn supports_watch(&self) -> bool

Whether or not the backend supports watching for file changes.

Source§

fn watch(&self) -> Result<BoxStream<'static, ()>>

Returns a stream which sends a unit value every time the given path is modified.

Source§

fn blob_modification_time<'a>( &'a self, path: &str, ) -> BoxFuture<'a, Result<Option<SystemTime>>>

Get the modification time of a blob in this repository if available.

Source§

fn blob_type(&self) -> DeliveryBlobType

Get the type of delivery blobs in this repository.

Source§

fn aliases(&self) -> &BTreeSet<String>

Source§

fn fetch_metadata_range<'a>( &'a self, path: &str, range: Range, ) -> BoxFuture<'a, Result<Resource, Error>>

Source§

fn fetch_blob_range<'a>( &'a self, path: &str, range: Range, ) -> BoxFuture<'a, Result<Resource, Error>>

Source§

impl<T: RepoProvider + ?Sized> RepoProvider for &mut T

Source§

fn supports_watch(&self) -> bool

Whether or not the backend supports watching for file changes.

Source§

fn watch(&self) -> Result<BoxStream<'static, ()>>

Returns a stream which sends a unit value every time the given path is modified.

Source§

fn blob_modification_time<'a>( &'a self, path: &str, ) -> BoxFuture<'a, Result<Option<SystemTime>>>

Get the modification time of a blob in this repository if available.

Source§

fn blob_type(&self) -> DeliveryBlobType

Get the type of delivery blobs in this repository.

Source§

fn aliases(&self) -> &BTreeSet<String>

Source§

fn fetch_metadata_range<'a>( &'a self, path: &str, range: Range, ) -> BoxFuture<'a, Result<Resource, Error>>

Source§

fn fetch_blob_range<'a>( &'a self, path: &str, range: Range, ) -> BoxFuture<'a, Result<Resource, Error>>

Source§

impl<T: RepoProvider + ?Sized> RepoProvider for Arc<T>

Source§

fn supports_watch(&self) -> bool

Whether or not the backend supports watching for file changes.

Source§

fn watch(&self) -> Result<BoxStream<'static, ()>>

Returns a stream which sends a unit value every time the given path is modified.

Source§

fn blob_modification_time<'a>( &'a self, path: &str, ) -> BoxFuture<'a, Result<Option<SystemTime>>>

Get the modification time of a blob in this repository if available.

Source§

fn blob_type(&self) -> DeliveryBlobType

Get the type of delivery blobs in this repository.

Source§

fn aliases(&self) -> &BTreeSet<String>

Source§

fn fetch_metadata_range<'a>( &'a self, path: &str, range: Range, ) -> BoxFuture<'a, Result<Resource, Error>>

Source§

fn fetch_blob_range<'a>( &'a self, path: &str, range: Range, ) -> BoxFuture<'a, Result<Resource, Error>>

Source§

impl<T: RepoProvider + ?Sized> RepoProvider for Box<T>

Source§

fn supports_watch(&self) -> bool

Whether or not the backend supports watching for file changes.

Source§

fn watch(&self) -> Result<BoxStream<'static, ()>>

Returns a stream which sends a unit value every time the given path is modified.

Source§

fn blob_modification_time<'a>( &'a self, path: &str, ) -> BoxFuture<'a, Result<Option<SystemTime>>>

Get the modification time of a blob in this repository if available.

Source§

fn blob_type(&self) -> DeliveryBlobType

Get the type of delivery blobs in this repository.

Source§

fn aliases(&self) -> &BTreeSet<String>

Source§

fn fetch_metadata_range<'a>( &'a self, path: &str, range: Range, ) -> BoxFuture<'a, Result<Resource, Error>>

Source§

fn fetch_blob_range<'a>( &'a self, path: &str, range: Range, ) -> BoxFuture<'a, Result<Resource, Error>>

Implementors§