mz_storage_operators::oneshot_source

Trait OneshotSource

Source
pub trait OneshotSource:
    Clone
    + Send
    + Unpin {
    type Object: OneshotObject + Debug + Clone + Send + Unpin + Serialize + DeserializeOwned + 'static;
    type Checksum: Debug + Clone + Send + Unpin + Serialize + DeserializeOwned + 'static;

    // Required methods
    fn list<'a>(
        &'a self,
    ) -> impl Future<Output = Result<Vec<(Self::Object, Self::Checksum)>, StorageErrorX>> + Send;
    fn get<'s>(
        &'s self,
        object: Self::Object,
        checksum: Self::Checksum,
        range: Option<RangeInclusive<usize>>,
    ) -> BoxStream<'s, Result<Bytes, StorageErrorX>>;
}
Expand description

Defines a remote system that we can fetch data from for a “one time” ingestion.

Required Associated Types§

Source

type Object: OneshotObject + Debug + Clone + Send + Unpin + Serialize + DeserializeOwned + 'static

An individual unit within the source, e.g. a file.

Source

type Checksum: Debug + Clone + Send + Unpin + Serialize + DeserializeOwned + 'static

Checksum for a Self::Object.

Required Methods§

Source

fn list<'a>( &'a self, ) -> impl Future<Output = Result<Vec<(Self::Object, Self::Checksum)>, StorageErrorX>> + Send

Returns all of the objects for this source.

Source

fn get<'s>( &'s self, object: Self::Object, checksum: Self::Checksum, range: Option<RangeInclusive<usize>>, ) -> BoxStream<'s, Result<Bytes, StorageErrorX>>

Resturns a stream of the data for a specific object.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§