Skip to main content

Resolver

Trait Resolver 

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

    // Required method
    fn get_compact_state<'a>(
        &'a self,
        target: Target<Self::Family, Self::Digest>,
    ) -> impl Future<Output = Result<FetchResult<Self::Family, Self::Op, Self::Digest>, Self::Error>> + Send + 'a;
}
Expand description

Trait for compact sync fetches from a source database.

Required Associated Types§

Source

type Family: Family

The merkle family backing the resolver’s proofs.

Source

type Digest: Digest

The digest type used in proofs returned by the resolver.

Source

type Op

The type of operations returned by the resolver.

Source

type Error: Error + Send + 'static

The error type returned by the resolver.

Required Methods§

Source

fn get_compact_state<'a>( &'a self, target: Target<Self::Family, Self::Digest>, ) -> impl Future<Output = Result<FetchResult<Self::Family, Self::Op, Self::Digest>, Self::Error>> + Send + 'a

Fetch the authenticated state for target.

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<F, E, K, V, H, C, S> Resolver for Arc<CompactDb<F, E, K, V, H, C, S>>
where F: Family, E: Context, K: Key, V: ValueEncoding + Send + Sync + 'static, H: Hasher, Operation<F, K, V>: Encode + Read<Cfg = C>, C: Clone + Send + Sync + 'static, S: Strategy,

Source§

type Family = F

Source§

type Digest = <H as Hasher>::Digest

Source§

type Op = Operation<F, K, V>

Source§

type Error = ServeError<F, <H as Hasher>::Digest>

Source§

async fn get_compact_state( &self, target: Target<Self::Family, Self::Digest>, ) -> Result<FetchResult<Self::Family, Self::Op, Self::Digest>, Self::Error>

Source§

impl<F, E, K, V, H, C, S> Resolver for Arc<AsyncRwLock<Option<CompactDb<F, E, K, V, H, C, S>>>>
where F: Family, E: Context, K: Key, V: ValueEncoding + Send + Sync + 'static, H: Hasher, Operation<F, K, V>: Encode + Read<Cfg = C>, C: Clone + Send + Sync + 'static, S: Strategy,

Source§

type Family = F

Source§

type Digest = <H as Hasher>::Digest

Source§

type Op = Operation<F, K, V>

Source§

type Error = ServeError<F, <H as Hasher>::Digest>

Source§

async fn get_compact_state( &self, target: Target<Self::Family, Self::Digest>, ) -> Result<FetchResult<Self::Family, Self::Op, Self::Digest>, Self::Error>

Source§

impl<F, E, K, V, H, C, S> Resolver for Arc<AsyncRwLock<CompactDb<F, E, K, V, H, C, S>>>
where F: Family, E: Context, K: Key, V: ValueEncoding + Send + Sync + 'static, H: Hasher, Operation<F, K, V>: Encode + Read<Cfg = C>, C: Clone + Send + Sync + 'static, S: Strategy,

Source§

type Family = F

Source§

type Digest = <H as Hasher>::Digest

Source§

type Op = Operation<F, K, V>

Source§

type Error = ServeError<F, <H as Hasher>::Digest>

Source§

async fn get_compact_state( &self, target: Target<Self::Family, Self::Digest>, ) -> Result<FetchResult<Self::Family, Self::Op, Self::Digest>, Self::Error>

Source§

impl<F, E, K, V, H, T, S> Resolver for Arc<AsyncRwLock<Option<Db<F, E, K, V, H, T, S>>>>
where F: Family, E: Context, K: Array, V: FixedValue + Send + Sync + 'static, H: Hasher, T: Translator + Send + Sync + 'static, T::Key: Send + Sync, S: Strategy,

Source§

type Family = F

Source§

type Digest = <H as Hasher>::Digest

Source§

type Op = Operation<F, K, FixedEncoding<V>>

Source§

type Error = ServeError<F, <H as Hasher>::Digest>

Source§

async fn get_compact_state( &self, target: Target<Self::Family, Self::Digest>, ) -> Result<FetchResult<Self::Family, Self::Op, Self::Digest>, Self::Error>

Source§

impl<F, E, K, V, H, T, S> Resolver for Arc<AsyncRwLock<Option<Db<F, E, K, V, H, T, S>>>>
where F: Family, E: Context, K: Key, V: VariableValue + Send + Sync + 'static, H: Hasher, T: Translator + Send + Sync + 'static, T::Key: Send + Sync, S: Strategy,

Source§

type Family = F

Source§

type Digest = <H as Hasher>::Digest

Source§

type Op = Operation<F, K, VariableEncoding<V>>

Source§

type Error = ServeError<F, <H as Hasher>::Digest>

Source§

async fn get_compact_state( &self, target: Target<Self::Family, Self::Digest>, ) -> Result<FetchResult<Self::Family, Self::Op, Self::Digest>, Self::Error>

Source§

impl<F, E, K, V, H, T, S> Resolver for Arc<AsyncRwLock<Db<F, E, K, V, H, T, S>>>
where F: Family, E: Context, K: Array, V: FixedValue + Send + Sync + 'static, H: Hasher, T: Translator + Send + Sync + 'static, T::Key: Send + Sync, S: Strategy,

Source§

type Family = F

Source§

type Digest = <H as Hasher>::Digest

Source§

type Op = Operation<F, K, FixedEncoding<V>>

Source§

type Error = ServeError<F, <H as Hasher>::Digest>

Source§

async fn get_compact_state( &self, target: Target<Self::Family, Self::Digest>, ) -> Result<FetchResult<Self::Family, Self::Op, Self::Digest>, Self::Error>

Source§

impl<F, E, K, V, H, T, S> Resolver for Arc<AsyncRwLock<Db<F, E, K, V, H, T, S>>>
where F: Family, E: Context, K: Key, V: VariableValue + Send + Sync + 'static, H: Hasher, T: Translator + Send + Sync + 'static, T::Key: Send + Sync, S: Strategy,

Source§

type Family = F

Source§

type Digest = <H as Hasher>::Digest

Source§

type Op = Operation<F, K, VariableEncoding<V>>

Source§

type Error = ServeError<F, <H as Hasher>::Digest>

Source§

async fn get_compact_state( &self, target: Target<Self::Family, Self::Digest>, ) -> Result<FetchResult<Self::Family, Self::Op, Self::Digest>, Self::Error>

Source§

impl<F, E, K, V, H, T, S> Resolver for Arc<Db<F, E, K, V, H, T, S>>
where F: Family, E: Context, K: Array, V: FixedValue + Send + Sync + 'static, H: Hasher, T: Translator + Send + Sync + 'static, T::Key: Send + Sync, S: Strategy,

Source§

type Family = F

Source§

type Digest = <H as Hasher>::Digest

Source§

type Op = Operation<F, K, FixedEncoding<V>>

Source§

type Error = ServeError<F, <H as Hasher>::Digest>

Source§

async fn get_compact_state( &self, target: Target<Self::Family, Self::Digest>, ) -> Result<FetchResult<Self::Family, Self::Op, Self::Digest>, Self::Error>

Source§

impl<F, E, K, V, H, T, S> Resolver for Arc<Db<F, E, K, V, H, T, S>>
where F: Family, E: Context, K: Key, V: VariableValue + Send + Sync + 'static, H: Hasher, T: Translator + Send + Sync + 'static, T::Key: Send + Sync, S: Strategy,

Source§

type Family = F

Source§

type Digest = <H as Hasher>::Digest

Source§

type Op = Operation<F, K, VariableEncoding<V>>

Source§

type Error = ServeError<F, <H as Hasher>::Digest>

Source§

async fn get_compact_state( &self, target: Target<Self::Family, Self::Digest>, ) -> Result<FetchResult<Self::Family, Self::Op, Self::Digest>, Self::Error>

Source§

impl<F, E, V, H, C, S> Resolver for Arc<CompactDb<F, E, V, H, C, S>>
where F: Family, E: Context, V: ValueEncoding + Send + Sync + 'static, H: Hasher, Operation<F, V>: Encode + Read<Cfg = C>, C: Clone + Send + Sync + 'static, S: Strategy,

Source§

type Family = F

Source§

type Digest = <H as Hasher>::Digest

Source§

type Op = Operation<F, V>

Source§

type Error = ServeError<F, <H as Hasher>::Digest>

Source§

async fn get_compact_state( &self, target: Target<Self::Family, Self::Digest>, ) -> Result<FetchResult<Self::Family, Self::Op, Self::Digest>, Self::Error>

Source§

impl<F, E, V, H, C, S> Resolver for Arc<AsyncRwLock<Option<CompactDb<F, E, V, H, C, S>>>>
where F: Family, E: Context, V: ValueEncoding + Send + Sync + 'static, H: Hasher, Operation<F, V>: Encode + Read<Cfg = C>, C: Clone + Send + Sync + 'static, S: Strategy,

Source§

type Family = F

Source§

type Digest = <H as Hasher>::Digest

Source§

type Op = Operation<F, V>

Source§

type Error = ServeError<F, <H as Hasher>::Digest>

Source§

async fn get_compact_state( &self, target: Target<Self::Family, Self::Digest>, ) -> Result<FetchResult<Self::Family, Self::Op, Self::Digest>, Self::Error>

Source§

impl<F, E, V, H, C, S> Resolver for Arc<AsyncRwLock<CompactDb<F, E, V, H, C, S>>>
where F: Family, E: Context, V: ValueEncoding + Send + Sync + 'static, H: Hasher, Operation<F, V>: Encode + Read<Cfg = C>, C: Clone + Send + Sync + 'static, S: Strategy,

Source§

type Family = F

Source§

type Digest = <H as Hasher>::Digest

Source§

type Op = Operation<F, V>

Source§

type Error = ServeError<F, <H as Hasher>::Digest>

Source§

async fn get_compact_state( &self, target: Target<Self::Family, Self::Digest>, ) -> Result<FetchResult<Self::Family, Self::Op, Self::Digest>, Self::Error>

Source§

impl<F, E, V, H, S> Resolver for Arc<AsyncRwLock<Option<Db<F, E, V, H, S>>>>
where F: Family, E: Context, V: FixedValue + Send + Sync + 'static, H: Hasher, S: Strategy,

Source§

type Family = F

Source§

type Digest = <H as Hasher>::Digest

Source§

type Op = Operation<F, FixedEncoding<V>>

Source§

type Error = ServeError<F, <H as Hasher>::Digest>

Source§

async fn get_compact_state( &self, target: Target<Self::Family, Self::Digest>, ) -> Result<FetchResult<Self::Family, Self::Op, Self::Digest>, Self::Error>

Source§

impl<F, E, V, H, S> Resolver for Arc<AsyncRwLock<Option<Db<F, E, V, H, S>>>>
where F: Family, E: Context, V: VariableValue + Send + Sync + 'static, H: Hasher, S: Strategy,

Source§

type Family = F

Source§

type Digest = <H as Hasher>::Digest

Source§

type Op = Operation<F, VariableEncoding<V>>

Source§

type Error = ServeError<F, <H as Hasher>::Digest>

Source§

async fn get_compact_state( &self, target: Target<Self::Family, Self::Digest>, ) -> Result<FetchResult<Self::Family, Self::Op, Self::Digest>, Self::Error>

Source§

impl<F, E, V, H, S> Resolver for Arc<AsyncRwLock<Db<F, E, V, H, S>>>
where F: Family, E: Context, V: FixedValue + Send + Sync + 'static, H: Hasher, S: Strategy,

Source§

type Family = F

Source§

type Digest = <H as Hasher>::Digest

Source§

type Op = Operation<F, FixedEncoding<V>>

Source§

type Error = ServeError<F, <H as Hasher>::Digest>

Source§

async fn get_compact_state( &self, target: Target<Self::Family, Self::Digest>, ) -> Result<FetchResult<Self::Family, Self::Op, Self::Digest>, Self::Error>

Source§

impl<F, E, V, H, S> Resolver for Arc<AsyncRwLock<Db<F, E, V, H, S>>>
where F: Family, E: Context, V: VariableValue + Send + Sync + 'static, H: Hasher, S: Strategy,

Source§

type Family = F

Source§

type Digest = <H as Hasher>::Digest

Source§

type Op = Operation<F, VariableEncoding<V>>

Source§

type Error = ServeError<F, <H as Hasher>::Digest>

Source§

async fn get_compact_state( &self, target: Target<Self::Family, Self::Digest>, ) -> Result<FetchResult<Self::Family, Self::Op, Self::Digest>, Self::Error>

Source§

impl<F, E, V, H, S> Resolver for Arc<Db<F, E, V, H, S>>
where F: Family, E: Context, V: FixedValue + Send + Sync + 'static, H: Hasher, S: Strategy,

Source§

type Family = F

Source§

type Digest = <H as Hasher>::Digest

Source§

type Op = Operation<F, FixedEncoding<V>>

Source§

type Error = ServeError<F, <H as Hasher>::Digest>

Source§

async fn get_compact_state( &self, target: Target<Self::Family, Self::Digest>, ) -> Result<FetchResult<Self::Family, Self::Op, Self::Digest>, Self::Error>

Source§

impl<F, E, V, H, S> Resolver for Arc<Db<F, E, V, H, S>>
where F: Family, E: Context, V: VariableValue + Send + Sync + 'static, H: Hasher, S: Strategy,

Source§

type Family = F

Source§

type Digest = <H as Hasher>::Digest

Source§

type Op = Operation<F, VariableEncoding<V>>

Source§

type Error = ServeError<F, <H as Hasher>::Digest>

Source§

async fn get_compact_state( &self, target: Target<Self::Family, Self::Digest>, ) -> Result<FetchResult<Self::Family, Self::Op, Self::Digest>, Self::Error>

Implementors§