Skip to main content

Snapshot

Struct Snapshot 

Source
pub struct Snapshot {
    pub owner_id: String,
    pub connection: String,
    pub service: String,
    pub epoch: u64,
    pub sequence: u64,
    pub observed_at: Instant,
    pub valid_until: Option<Instant>,
    /* private fields */
}
Expand description

保留受管数据的只读凭据;数据用于诊断或选址,提交请求仍需再次检查 Observation。

Fields§

§owner_id: String

产生证据的 owner 标识,用于区分独立运行时。

§connection: String

证据所属连接的 qualifier。

§service: String

证据对应的逻辑服务名。

§epoch: u64

后端身份代次;失权前的证据不能跨代继续使用。

§sequence: u64

同一观察中的快照序号,用于区分实例集合变化。

§observed_at: Instant

当前证据被确认的本地单调时刻。

§valid_until: Option<Instant>

当前证据的有效截止时刻;不替代提交请求时的复验。

Implementations§

Source§

impl Snapshot

Source

pub fn instances(&self) -> &[Instance]

业务作用:读取后端完整实例事实,包括不承载流量的实例。 参数说明:无。 返回:共享只读列表;该切片本身不构成持续发送许可。

Source

pub fn identities(&self) -> &[String]

业务作用:提供与完整实例列表逐项绑定的后端身份,供诊断和自定义协议保留所有权边界。 参数说明:无。 返回:当前连接及服务作用域内的稳定键,不能用作无界指标标签。

Source

pub fn evidence(&self) -> EvidenceKind

业务作用:区分地址解析、静态配置与后端健康证据。 参数说明:无。 返回:该快照真实采用的证据等级。

Trait Implementations§

Source§

impl Clone for Snapshot

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.