pub struct DiscoveryOwner { /* private fields */ }Expand description
非 Clone 的控制对象;查询句柄和等待凭据不继承关闭权。
Implementations§
Source§impl DiscoveryOwner
impl DiscoveryOwner
Sourcepub async fn prepare(&self, deadline: Instant) -> Result<()>
pub async fn prepare(&self, deadline: Instant) -> Result<()>
业务作用:启动独立连接监督并等待必需连接达到所需作用域的访问条件。
参数说明:
deadline:是宿主原启动截止点,取消等待不会丢失后台资源归属。
返回:必需连接准备成功;关闭或期限耗尽返回错误。
Sourcepub fn client(&self, qualifier: Option<&str>) -> Result<DiscoveryHandle>
pub fn client(&self, qualifier: Option<&str>) -> Result<DiscoveryHandle>
业务作用:取得精确连接或默认 primary,不跨环境回退。
参数说明:
qualifier:为空时采用 primary;兼容宿主显式设置的默认引用优先。
返回:只有查询权的句柄;不存在或已关闭时失败。
Sourcepub fn freeze_registrations(&self, specs: Vec<RegistrationSpec>) -> Result<()>
pub fn freeze_registrations(&self, specs: Vec<RegistrationSpec>) -> Result<()>
业务作用:一次性校验并冻结全部最终注册计划,避免部分发布后才发现引用非法。
参数说明:
specs:已解析实际 listener、对外端点和本地资格来源。
返回:全部计划合法时原子登记,任何错误均不发出注册请求。
Sourcepub async fn publish(&self, deadline: Instant) -> Result<()>
pub async fn publish(&self, deadline: Instant) -> Result<()>
业务作用:在宿主监听器可接流后启动注册监督,等待启动必需目标的真实确认。
参数说明:
deadline:延续原启动期限,不为注册重新计时。
返回:全部启动必需注册确认后进入 Serving;失败由宿主发起有界清理。
Sourcepub fn begin_quiesce(&self, deadline: Instant) -> QuiesceTicket
pub fn begin_quiesce(&self, deadline: Instant) -> QuiesceTicket
业务作用:同步撤销所有新注册和健康上报许可,保留出站发现供业务排空。
参数说明:
deadline:是摘流、业务排空与最终关闭共享的停机截止点。
返回:重复调用等待同一摘流结果;出站资源保留到 begin_close。
Sourcepub fn begin_close(&self, deadline: Instant) -> CloseTicket
pub fn begin_close(&self, deadline: Instant) -> CloseTicket
业务作用:发起唯一有界清理并同步撤销后续出站发送,等待取消不终止清理。
参数说明:
deadline:是宿主停机总截止点,首次调用后不能延长。
返回:可复制的只读关闭等待凭据。
Sourcepub fn phase(&self) -> OwnerPhase
pub fn phase(&self) -> OwnerPhase
业务作用:读取当前 owner 阶段。
参数说明:无。
返回:单调推进的生命周期阶段。
Sourcepub fn registrations(&self) -> Vec<RegistrationStatus>
pub fn registrations(&self) -> Vec<RegistrationStatus>
业务作用:读取注册监督事实,供宿主映射就绪贡献和运维状态。
参数说明:无。
返回:按当前连接身份代次及本地资格裁决的状态;已撤权的注册不得继续贡献就绪,不输出凭据或 metadata。
Sourcepub fn changes(&self) -> Receiver<u64>
pub fn changes(&self) -> Receiver<u64>
业务作用:提供状态变化通知,允许宿主按同一事实监督而不复制后端轮询。
参数说明:无。
返回:只读通知流,收到通知后重新读取完整状态。
Sourcepub fn observer(&self) -> RuntimeObserver
pub fn observer(&self) -> RuntimeObserver
业务作用:向监控与运维代码提供没有关闭权的有界状态入口。
参数说明:无。
返回:观察器不延长 owner 的生命周期,也不创建后端任务。
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for DiscoveryOwner
impl !UnwindSafe for DiscoveryOwner
impl Forget for DiscoveryOwner
impl Freeze for DiscoveryOwner
impl Move for DiscoveryOwner
impl Send for DiscoveryOwner
impl Sync for DiscoveryOwner
impl Unpin for DiscoveryOwner
impl UnsafeUnpin for DiscoveryOwner
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