pub struct OwnerBuilder { /* private fields */ }Expand description
在网络活动之前完成的类型化连接目录。
Implementations§
Source§impl OwnerBuilder
impl OwnerBuilder
Sourcepub fn limits(self, limits: Limits) -> Self
pub fn limits(self, limits: Limits) -> Self
业务作用:设置所有连接共享的有限资源预算。
参数说明:
limits:是实例、任务和并发容量。
返回:构造时统一校验的 builder。
Sourcepub fn default_connection(self, name: impl Into<String>) -> Self
pub fn default_connection(self, name: impl Into<String>) -> Self
业务作用:兼容使用显式默认引用的宿主;新目录可直接将默认连接命名为 primary。
参数说明:
name:必须引用已登记的连接,不影响显式 qualifier 的匹配。
返回:构造时校验引用的 builder;省略此入口时只采用 primary。
Sourcepub fn connection(self, spec: ConnectionSpec) -> Result<Self>
pub fn connection(self, spec: ConnectionSpec) -> Result<Self>
业务作用:登记一个独立 provider 实例并拒绝重复连接别名。
参数说明:
spec:包含名称、后端和冻结策略。
返回:合法连接加入目录;错误不触发网络访问。
Sourcepub fn build(self) -> Result<DiscoveryOwner>
pub fn build(self) -> Result<DiscoveryOwner>
业务作用:创建唯一控制 owner,使初始化取消后仍有资源清理权。
参数说明:无。
返回:无网络副作用的 owner;非法显式默认引用拒绝,无 primary 的目录只允许具名选择。
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for OwnerBuilder
impl !UnwindSafe for OwnerBuilder
impl Forget for OwnerBuilder
impl Freeze for OwnerBuilder
impl Move for OwnerBuilder
impl Send for OwnerBuilder
impl Sync for OwnerBuilder
impl Unpin for OwnerBuilder
impl UnsafeUnpin for OwnerBuilder
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