pub trait ShardingViewProvider:
Send
+ Sync
+ 'static {
// Required methods
fn allocate_shard(
&self,
request: ShardAllocationRequest,
timeout: Duration,
) -> ClusterViewFuture<'_, ShardAllocation>;
fn remember_shard_allocations(
&self,
request: RememberShardAllocations,
) -> ClusterViewFuture<'_, ()>;
fn get_shard_allocations(
&self,
type_name: String,
timeout: Duration,
) -> ClusterViewFuture<'_, ShardAllocationTable>;
fn forward_shard_envelopes(
&self,
request: ForwardShardEnvelopes,
timeout: Duration,
) -> ClusterViewFuture<'_, ShardEnvelopeBatchResult>;
fn complete_sharding_ask(
&self,
request: CompleteShardingAsk,
) -> ClusterViewFuture<'_, ()>;
}Expand description
Provider installed by cluster sharding to serve shard allocation, region forwarding, and remote ask replies over the existing node-to-node DCP sessions.
Required Methods§
Sourcefn allocate_shard(
&self,
request: ShardAllocationRequest,
timeout: Duration,
) -> ClusterViewFuture<'_, ShardAllocation>
fn allocate_shard( &self, request: ShardAllocationRequest, timeout: Duration, ) -> ClusterViewFuture<'_, ShardAllocation>
Allocate or return the cached owner for one shard. Only the deterministic coordinator should accept this request.
Sourcefn remember_shard_allocations(
&self,
request: RememberShardAllocations,
) -> ClusterViewFuture<'_, ()>
fn remember_shard_allocations( &self, request: RememberShardAllocations, ) -> ClusterViewFuture<'_, ()>
Remember allocation-table rows replicated by the active coordinator.
Sourcefn get_shard_allocations(
&self,
type_name: String,
timeout: Duration,
) -> ClusterViewFuture<'_, ShardAllocationTable>
fn get_shard_allocations( &self, type_name: String, timeout: Duration, ) -> ClusterViewFuture<'_, ShardAllocationTable>
Return this region’s cached allocation table for coordinator takeover.
Sourcefn forward_shard_envelopes(
&self,
request: ForwardShardEnvelopes,
timeout: Duration,
) -> ClusterViewFuture<'_, ShardEnvelopeBatchResult>
fn forward_shard_envelopes( &self, request: ForwardShardEnvelopes, timeout: Duration, ) -> ClusterViewFuture<'_, ShardEnvelopeBatchResult>
Enqueue a batch of serialized envelopes at this region.
Sourcefn complete_sharding_ask(
&self,
request: CompleteShardingAsk,
) -> ClusterViewFuture<'_, ()>
fn complete_sharding_ask( &self, request: CompleteShardingAsk, ) -> ClusterViewFuture<'_, ()>
Complete an ask whose reply port originated on this region.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".