pub struct ListRouter { /* private fields */ }Expand description
List 策略路由器
按枚举值(如地区、租户、类型)显式映射到 shard。 支持默认 shard(fallback)。
§适用场景
- 多租户:按 tenant_id 路由
- 多地区:按 region 路由
- 类型分库:按 type 字段路由
Implementations§
Source§impl ListRouter
impl ListRouter
Sourcepub fn with_default(self, shard: &str) -> Self
pub fn with_default(self, shard: &str) -> Self
设置默认 shard
Sourcepub fn has_default(&self) -> bool
pub fn has_default(&self) -> bool
是否有默认 shard
Trait Implementations§
Source§impl Debug for ListRouter
impl Debug for ListRouter
Auto Trait Implementations§
impl Freeze for ListRouter
impl RefUnwindSafe for ListRouter
impl Send for ListRouter
impl Sync for ListRouter
impl Unpin for ListRouter
impl UnsafeUnpin for ListRouter
impl UnwindSafe for ListRouter
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