Resolver

Trait Resolver 

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

    // Required method
    fn get_operations<'a>(
        &'a self,
        op_count: Location,
        start_loc: Location,
        max_ops: NonZeroU64,
    ) -> impl Future<Output = Result<FetchResult<Self::Op, Self::Digest>, Self::Error>> + Send + 'a;
}
Expand description

Trait for network communication with the sync server

Required Associated Types§

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_operations<'a>( &'a self, op_count: Location, start_loc: Location, max_ops: NonZeroU64, ) -> impl Future<Output = Result<FetchResult<Self::Op, Self::Digest>, Self::Error>> + Send + 'a

Get the operations starting at start_loc in the database, up to max_ops operations. Returns the operations and a proof that they were present in the database when it had size operations.

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.

Implementations on Foreign Types§

Source§

impl<E, K, V, H, T> Resolver for Arc<Immutable<E, K, V, H, T>>
where E: Storage + Clock + Metrics, K: Array, V: VariableValue + Send + Sync + 'static, H: Hasher, T: Translator + Send + Sync + 'static, T::Key: Send + Sync,

Source§

type Digest = <H as Hasher>::Digest

Source§

type Op = Operation<K, V>

Source§

type Error = Error

Source§

async fn get_operations( &self, op_count: Location, start_loc: Location, max_ops: NonZeroU64, ) -> Result<FetchResult<Self::Op, Self::Digest>, Self::Error>

Source§

impl<E, K, V, H, T> Resolver for Arc<RwLock<Immutable<E, K, V, H, T>>>
where E: Storage + Clock + Metrics, K: Array, V: VariableValue + Send + Sync + 'static, H: Hasher, T: Translator + Send + Sync + 'static, T::Key: Send + Sync,

Implement Resolver directly for Arc<RwLock<Immutable>> to eliminate the need for wrapper types while allowing direct database access.

Source§

type Digest = <H as Hasher>::Digest

Source§

type Op = Operation<K, V>

Source§

type Error = Error

Source§

async fn get_operations( &self, op_count: Location, start_loc: Location, max_ops: NonZeroU64, ) -> Result<FetchResult<Self::Op, Self::Digest>, Self::Error>

Source§

impl<E, K, V, H, T> Resolver for Arc<RwLock<Db<E, K, V, H, T>>>
where E: Storage + Clock + Metrics, K: Array, V: FixedValue + Send + Sync + 'static, H: Hasher, T: Translator + Send + Sync + 'static, T::Key: Send + Sync,

Implement Resolver directly for Arc<RwLock<Db>> to eliminate the need for wrapper types while allowing direct database access.

Source§

type Digest = <H as Hasher>::Digest

Source§

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

Source§

type Error = Error

Source§

async fn get_operations( &self, op_count: Location, start_loc: Location, max_ops: NonZeroU64, ) -> Result<FetchResult<Self::Op, Self::Digest>, Error>

Source§

impl<E, K, V, H, T> Resolver for Arc<Db<E, K, V, H, T>>
where E: Storage + Clock + Metrics, K: Array, V: FixedValue + Send + Sync + 'static, H: Hasher, T: Translator + Send + Sync + 'static, T::Key: Send + Sync,

Source§

type Digest = <H as Hasher>::Digest

Source§

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

Source§

type Error = Error

Source§

async fn get_operations( &self, op_count: Location, start_loc: Location, max_ops: NonZeroU64, ) -> Result<FetchResult<Self::Op, Self::Digest>, Self::Error>

Implementors§