pub struct ShardGroup {
pub group_id: String,
pub shards: Vec<String>,
}Expand description
一组分片(可用于主从、读写分离、地域分组)
一个 ShardGroup 包含一个组标识和多个 shard。
在 CompositeRouter 中作为二级分片单元使用。
Fields§
§group_id: String组标识(如地区、租户)
shards: Vec<String>组内 shard 列表
Implementations§
Trait Implementations§
Source§impl Clone for ShardGroup
impl Clone for ShardGroup
Source§fn clone(&self) -> ShardGroup
fn clone(&self) -> ShardGroup
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ShardGroup
impl RefUnwindSafe for ShardGroup
impl Send for ShardGroup
impl Sync for ShardGroup
impl Unpin for ShardGroup
impl UnsafeUnpin for ShardGroup
impl UnwindSafe for ShardGroup
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