Skip to main content

OwnerBuilder

Struct OwnerBuilder 

Source
pub struct OwnerBuilder { /* private fields */ }
Expand description

在网络活动之前完成的类型化连接目录。

Implementations§

Source§

impl OwnerBuilder

Source

pub fn limits(self, limits: Limits) -> Self

业务作用:设置所有连接共享的有限资源预算。 参数说明:limits 是实例、任务和并发容量。 返回:构造时统一校验的 builder。

Source

pub fn default_connection(self, name: impl Into<String>) -> Self

业务作用:兼容使用显式默认引用的宿主;新目录可直接将默认连接命名为 primary。 参数说明:name 必须引用已登记的连接,不影响显式 qualifier 的匹配。 返回:构造时校验引用的 builder;省略此入口时只采用 primary。

Source

pub fn connection(self, spec: ConnectionSpec) -> Result<Self>

业务作用:登记一个独立 provider 实例并拒绝重复连接别名。 参数说明:spec 包含名称、后端和冻结策略。 返回:合法连接加入目录;错误不触发网络访问。

Source

pub fn build(self) -> Result<DiscoveryOwner>

业务作用:创建唯一控制 owner,使初始化取消后仍有资源清理权。 参数说明:无。 返回:无网络副作用的 owner;非法显式默认引用拒绝,无 primary 的目录只允许具名选择。

Trait Implementations§

Source§

impl Default for OwnerBuilder

Source§

fn default() -> Self

业务作用:建立不连接任何后端的空目录。 参数说明:无。 返回:显式添加连接后才产生网络活动。

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.