Skip to main content

Source

Trait Source 

Source
pub trait Source: Send + Sync {
    type Family: Family;
    type Digest: Digest;
    type Op;
    type Error: Error + Send + 'static;

    // Required method
    fn serve(
        &self,
        request: Request<Self::Family>,
    ) -> impl Future<Output = Result<Self>> + Send;
}
Expand description

A source for proofs and operations.

Required Associated Types§

Source

type Family: Family

The merkle family backing this source’s proofs.

Source

type Digest: Digest

The digest type used in this source’s proofs.

Source

type Op

The type of operations this source yields.

Source

type Error: Error + Send + 'static

Why this source could not answer.

Required Methods§

Source

fn serve( &self, request: Request<Self::Family>, ) -> impl Future<Output = Result<Self>> + Send

Serves a response with optional Feedback for reporting its validity.

Dropping the future or feedback cancels the request without judging the response.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T> Source for Arc<T>
where T: Source + ?Sized,

Source§

type Family = <T as Source>::Family

Source§

type Digest = <T as Source>::Digest

Source§

type Op = <T as Source>::Op

Source§

type Error = <T as Source>::Error

Source§

fn serve( &self, request: Request<Self::Family>, ) -> impl Future<Output = Result<Self>> + Send

Source§

impl<T> Source for AsyncRwLock<T>
where T: Source,

Source§

type Family = <T as Source>::Family

Source§

type Digest = <T as Source>::Digest

Source§

type Op = <T as Source>::Op

Source§

type Error = <T as Source>::Error

Source§

async fn serve(&self, request: Request<Self::Family>) -> Result<Self>

Source§

impl<T> Source for Option<T>
where T: Source, ServeError<T::Family>: From<T::Error>,

Source§

type Family = <T as Source>::Family

Source§

type Digest = <T as Source>::Digest

Source§

type Op = <T as Source>::Op

Source§

type Error = ServeError<<T as Source>::Family>

Source§

async fn serve(&self, request: Request<Self::Family>) -> Result<Self>

Source§

impl<T> Source for TracedAsyncRwLock<T>
where T: Source,

Source§

type Family = <T as Source>::Family

Source§

type Digest = <T as Source>::Digest

Source§

type Op = <T as Source>::Op

Source§

type Error = <T as Source>::Error

Source§

async fn serve(&self, request: Request<Self::Family>) -> Result<Self>

Implementors§

Source§

impl<F, E, C, H, S> Source for Journal<F, E, C, H, S>
where F: Family, E: Context, C: Contiguous<Item: EncodeShared + Floored<F>>, H: Hasher, S: Strategy,

Source§

impl<F, E, C, I, H, U, const N: usize, S> Source for commonware_storage::qmdb::any::db::Db<F, E, C, I, H, U, N, S>
where F: Family, E: Context, C: Mutable<Item = Operation<F, U>>, I: Unordered<Value = Location<F>>, H: Hasher, U: Update, S: Strategy, Operation<F, U>: Codec,

Source§

impl<F, E, C, I, H, U, const N: usize, S> Source for commonware_storage::qmdb::current::db::Db<F, E, C, I, H, U, N, S>
where F: Graftable, E: Context, C: Mutable<Item = Operation<F, U>>, I: UnorderedIndex<Value = Location<F>>, H: Hasher, U: Update, S: Strategy, Operation<F, U>: Codec,

A current database serves proofs from the any database it wraps. The sync engine operates on the ops root, which is any’s root.

Source§

impl<F, E, K, V, C, H, T, S> Source for Immutable<F, E, K, V, C, H, T, S>
where F: Family, E: Context, K: Key, V: ValueEncoding, C: Mutable<Item = Operation<F, K, V>>, Operation<F, K, V>: EncodeShared, H: Hasher, T: Translator, S: Strategy,

Source§

type Family = F

Source§

type Digest = <H as Hasher>::Digest

Source§

type Op = Operation<F, K, V>

Source§

type Error = Error<F>

Source§

impl<F, E, K, V, H, S> Source for commonware_storage::qmdb::immutable::CompactDb<F, E, K, V, H, S>
where F: Family, E: Context, K: Key, V: ValueEncoding, H: Hasher, Operation<F, K, V>: EncodeShared + Read, S: Strategy,

Source§

type Family = F

Source§

type Digest = <H as Hasher>::Digest

Source§

type Op = Operation<F, K, V>

Source§

type Error = Error<F>

Source§

impl<F, E, V, C, H, S> Source for Keyless<F, E, V, C, H, S>
where F: Family, E: Context, V: ValueEncoding, C: Mutable<Item = Operation<F, V>>, H: Hasher, S: Strategy, Operation<F, V>: EncodeShared,

Source§

impl<F, E, V, H, S> Source for commonware_storage::qmdb::keyless::CompactDb<F, E, V, H, S>