Skip to main content

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,
        include_pinned_nodes: bool,
        cancel_rx: Receiver<()>,
    ) -> 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, include_pinned_nodes: bool, cancel_rx: Receiver<()>, ) -> 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 op_count operations. If include_pinned_nodes is true, the result will include the pinned MMR nodes at start_loc.

The corresponding cancel_tx is dropped when the engine no longer needs this request (e.g. due to a target update), causing cancel_rx.await to return Err. Implementations may select! on it to abort in-flight work early.

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<AsyncRwLock<Option<Db<Family, E, K, V, H, T>>>>
where E: Context, 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<Family, Update<K, FixedEncoding<V>>>

Source§

type Error = Error<Family>

Source§

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

Source§

impl<E, K, V, H, T> Resolver for Arc<AsyncRwLock<Option<Db<Family, E, K, V, H, T>>>>
where E: Context, 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<Family, Update<K, VariableEncoding<V>>>

Source§

type Error = Error<Family>

Source§

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

Source§

impl<E, K, V, H, T> Resolver for Arc<AsyncRwLock<Option<Db<Family, E, K, V, H, T>>>>
where E: Context, 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<Family, Update<K, FixedEncoding<V>>>

Source§

type Error = Error<Family>

Source§

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

Source§

impl<E, K, V, H, T> Resolver for Arc<AsyncRwLock<Option<Db<Family, E, K, V, H, T>>>>
where E: Context, 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<Family, Update<K, VariableEncoding<V>>>

Source§

type Error = Error<Family>

Source§

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

Source§

impl<E, K, V, H, T> Resolver for Arc<AsyncRwLock<Option<Db<Family, E, K, V, H, T>>>>
where E: Context, 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>>

Source§

type Error = Error<Family>

Source§

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

Source§

impl<E, K, V, H, T> Resolver for Arc<AsyncRwLock<Option<Db<Family, E, K, V, H, T>>>>
where E: Context, K: Key, 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, VariableEncoding<V>>

Source§

type Error = Error<Family>

Source§

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

Source§

impl<E, K, V, H, T> Resolver for Arc<AsyncRwLock<Db<Family, E, K, V, H, T>>>
where E: Context, 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<Family, Update<K, FixedEncoding<V>>>

Source§

type Error = Error<Family>

Source§

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

Source§

impl<E, K, V, H, T> Resolver for Arc<AsyncRwLock<Db<Family, E, K, V, H, T>>>
where E: Context, 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<Family, Update<K, VariableEncoding<V>>>

Source§

type Error = Error<Family>

Source§

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

Source§

impl<E, K, V, H, T> Resolver for Arc<AsyncRwLock<Db<Family, E, K, V, H, T>>>
where E: Context, 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<Family, Update<K, FixedEncoding<V>>>

Source§

type Error = Error<Family>

Source§

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

Source§

impl<E, K, V, H, T> Resolver for Arc<AsyncRwLock<Db<Family, E, K, V, H, T>>>
where E: Context, 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<Family, Update<K, VariableEncoding<V>>>

Source§

type Error = Error<Family>

Source§

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

Source§

impl<E, K, V, H, T> Resolver for Arc<AsyncRwLock<Db<Family, E, K, V, H, T>>>
where E: Context, 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>>

Source§

type Error = Error<Family>

Source§

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

Source§

impl<E, K, V, H, T> Resolver for Arc<AsyncRwLock<Db<Family, E, K, V, H, T>>>
where E: Context, K: Key, 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, VariableEncoding<V>>

Source§

type Error = Error<Family>

Source§

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

Source§

impl<E, K, V, H, T> Resolver for Arc<Db<Family, E, K, V, H, T>>
where E: Context, 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<Family, Update<K, FixedEncoding<V>>>

Source§

type Error = Error<Family>

Source§

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

Source§

impl<E, K, V, H, T> Resolver for Arc<Db<Family, E, K, V, H, T>>
where E: Context, 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<Family, Update<K, VariableEncoding<V>>>

Source§

type Error = Error<Family>

Source§

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

Source§

impl<E, K, V, H, T> Resolver for Arc<Db<Family, E, K, V, H, T>>
where E: Context, 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<Family, Update<K, FixedEncoding<V>>>

Source§

type Error = Error<Family>

Source§

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

Source§

impl<E, K, V, H, T> Resolver for Arc<Db<Family, E, K, V, H, T>>
where E: Context, 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<Family, Update<K, VariableEncoding<V>>>

Source§

type Error = Error<Family>

Source§

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

Source§

impl<E, K, V, H, T> Resolver for Arc<Db<Family, E, K, V, H, T>>
where E: Context, 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>>

Source§

type Error = Error<Family>

Source§

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

Source§

impl<E, K, V, H, T> Resolver for Arc<Db<Family, E, K, V, H, T>>
where E: Context, K: Key, 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, VariableEncoding<V>>

Source§

type Error = Error<Family>

Source§

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

Source§

impl<E, K, V, H, T, const N: usize> Resolver for Arc<AsyncRwLock<Option<Db<Family, E, K, V, H, T, N>>>>
where E: Context, 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<Family, Update<K, FixedEncoding<V>>>

Source§

type Error = Error<Family>

Source§

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

Source§

impl<E, K, V, H, T, const N: usize> Resolver for Arc<AsyncRwLock<Option<Db<Family, E, K, V, H, T, N>>>>
where E: Context, K: Key, V: VariableValue + Send + Sync + 'static, H: Hasher, T: Translator + Send + Sync + 'static, T::Key: Send + Sync, Operation<Family, K, V>: CodecShared,

Source§

type Digest = <H as Hasher>::Digest

Source§

type Op = Operation<Family, Update<K, VariableEncoding<V>>>

Source§

type Error = Error<Family>

Source§

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

Source§

impl<E, K, V, H, T, const N: usize> Resolver for Arc<AsyncRwLock<Option<Db<Family, E, K, V, H, T, N>>>>
where E: Context, 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<Family, Update<K, FixedEncoding<V>>>

Source§

type Error = Error<Family>

Source§

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

Source§

impl<E, K, V, H, T, const N: usize> Resolver for Arc<AsyncRwLock<Option<Db<Family, E, K, V, H, T, N>>>>
where E: Context, K: Key, V: VariableValue + Send + Sync + 'static, H: Hasher, T: Translator + Send + Sync + 'static, T::Key: Send + Sync, Operation<Family, K, V>: CodecShared,

Source§

type Digest = <H as Hasher>::Digest

Source§

type Op = Operation<Family, Update<K, VariableEncoding<V>>>

Source§

type Error = Error<Family>

Source§

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

Source§

impl<E, K, V, H, T, const N: usize> Resolver for Arc<AsyncRwLock<Db<Family, E, K, V, H, T, N>>>
where E: Context, 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<Family, Update<K, FixedEncoding<V>>>

Source§

type Error = Error<Family>

Source§

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

Source§

impl<E, K, V, H, T, const N: usize> Resolver for Arc<AsyncRwLock<Db<Family, E, K, V, H, T, N>>>
where E: Context, K: Key, V: VariableValue + Send + Sync + 'static, H: Hasher, T: Translator + Send + Sync + 'static, T::Key: Send + Sync, Operation<Family, K, V>: CodecShared,

Source§

type Digest = <H as Hasher>::Digest

Source§

type Op = Operation<Family, Update<K, VariableEncoding<V>>>

Source§

type Error = Error<Family>

Source§

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

Source§

impl<E, K, V, H, T, const N: usize> Resolver for Arc<AsyncRwLock<Db<Family, E, K, V, H, T, N>>>
where E: Context, 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<Family, Update<K, FixedEncoding<V>>>

Source§

type Error = Error<Family>

Source§

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

Source§

impl<E, K, V, H, T, const N: usize> Resolver for Arc<AsyncRwLock<Db<Family, E, K, V, H, T, N>>>
where E: Context, K: Key, V: VariableValue + Send + Sync + 'static, H: Hasher, T: Translator + Send + Sync + 'static, T::Key: Send + Sync, Operation<Family, K, V>: CodecShared,

Source§

type Digest = <H as Hasher>::Digest

Source§

type Op = Operation<Family, Update<K, VariableEncoding<V>>>

Source§

type Error = Error<Family>

Source§

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

Source§

impl<E, K, V, H, T, const N: usize> Resolver for Arc<Db<Family, E, K, V, H, T, N>>
where E: Context, 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<Family, Update<K, FixedEncoding<V>>>

Source§

type Error = Error<Family>

Source§

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

Source§

impl<E, K, V, H, T, const N: usize> Resolver for Arc<Db<Family, E, K, V, H, T, N>>
where E: Context, K: Key, V: VariableValue + Send + Sync + 'static, H: Hasher, T: Translator + Send + Sync + 'static, T::Key: Send + Sync, Operation<Family, K, V>: CodecShared,

Source§

type Digest = <H as Hasher>::Digest

Source§

type Op = Operation<Family, Update<K, VariableEncoding<V>>>

Source§

type Error = Error<Family>

Source§

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

Source§

impl<E, K, V, H, T, const N: usize> Resolver for Arc<Db<Family, E, K, V, H, T, N>>
where E: Context, 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<Family, Update<K, FixedEncoding<V>>>

Source§

type Error = Error<Family>

Source§

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

Source§

impl<E, K, V, H, T, const N: usize> Resolver for Arc<Db<Family, E, K, V, H, T, N>>
where E: Context, K: Key, V: VariableValue + Send + Sync + 'static, H: Hasher, T: Translator + Send + Sync + 'static, T::Key: Send + Sync, Operation<Family, K, V>: CodecShared,

Source§

type Digest = <H as Hasher>::Digest

Source§

type Op = Operation<Family, Update<K, VariableEncoding<V>>>

Source§

type Error = Error<Family>

Source§

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

Implementors§