pub struct ShardingApi;Expand description
ShardingApi
Implementations§
Source§impl ShardingApi
impl ShardingApi
Sourcepub fn lookup_partition_key(
pool: &str,
partition_key: &str,
) -> Option<Principal>
pub fn lookup_partition_key( pool: &str, partition_key: &str, ) -> Option<Principal>
Lookup the shard assigned to a partition_key in a pool, if any.
Sourcepub fn resolve_shard_for_key(
pool: &str,
partition_key: impl AsRef<str>,
) -> Result<Principal, Error>
pub fn resolve_shard_for_key( pool: &str, partition_key: impl AsRef<str>, ) -> Result<Principal, Error>
Return the shard for a partition_key, or an Error if unassigned.
Sourcepub fn registry() -> ShardingRegistryResponse
pub fn registry() -> ShardingRegistryResponse
Return a view of the full sharding registry.
Sourcepub fn partition_keys(
pool: &str,
shard: Principal,
) -> ShardingPartitionKeysResponse
pub fn partition_keys( pool: &str, shard: Principal, ) -> ShardingPartitionKeysResponse
Return all partition_keys currently assigned to a shard.
Sourcepub async fn assign_to_pool(
pool: &str,
partition_key: impl AsRef<str>,
) -> Result<Principal, Error>
pub async fn assign_to_pool( pool: &str, partition_key: impl AsRef<str>, ) -> Result<Principal, Error>
Assign a partition_key to a shard in the given pool.
Sourcepub fn plan_assign_to_pool(
pool: &str,
partition_key: impl AsRef<str>,
) -> Result<ShardingPlanStateResponse, Error>
pub fn plan_assign_to_pool( pool: &str, partition_key: impl AsRef<str>, ) -> Result<ShardingPlanStateResponse, Error>
Perform a dry-run shard assignment and return the resulting plan.
Auto Trait Implementations§
impl Freeze for ShardingApi
impl RefUnwindSafe for ShardingApi
impl Send for ShardingApi
impl Sync for ShardingApi
impl Unpin for ShardingApi
impl UnsafeUnpin for ShardingApi
impl UnwindSafe for ShardingApi
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more