Skip to main content

RegistrationConfig

Struct RegistrationConfig 

Source
pub struct RegistrationConfig {
Show 14 fields pub connection_ref: String, pub service_name: String, pub ip: Option<String>, pub port: Option<u16>, pub listener_ref: Option<String>, pub eligibility_ref: Option<String>, pub metadata: HashMap<String, String>, pub startup_required: bool, pub readiness_critical: bool, pub monitor_interval_ms: u64, pub observation_grace_ms: u64, pub deregister_timeout_ms: u64, pub nacos: Option<NacosRegistration>, pub consul: Option<Value>,
}
Expand description

单个服务发布目标及其启动、健康回查和摘流策略。

Fields§

§connection_ref: String

发布目标的 qualifier;Rust 字段保留兼容名称,配置序列化使用 qualifier。

§service_name: String

发布到目标后端的服务名称,必须存在对应服务绑定。

§ip: Option<String>

对外可达地址;注册配置可显式覆盖宿主监听地址。

§port: Option<u16>

目标监听端口;注册配置省略时由 listener_ref 解析。

§listener_ref: Option<String>

宿主已绑定监听器的引用,用于解析未显式指定的地址与端口。

§eligibility_ref: Option<String>

宿主本地业务资格引用,控制是否允许发布实例。

§metadata: HashMap<String, String>

随注册写入的实例属性,不得携带凭据。

§startup_required: bool

是否要求启动阶段确认成功;失败时阻止宿主完成启动。

§readiness_critical: bool

远端注册失去有效健康证据时是否影响宿主整体就绪。

§monitor_interval_ms: u64

注册健康回查间隔,单位为毫秒。

§observation_grace_ms: u64

注册健康证据的有效窗口,单位为毫秒。

§deregister_timeout_ms: u64

单项注销预算,单位为毫秒,仍受宿主关闭总期限限制。

§nacos: Option<NacosRegistration>

Nacos 专用配置,只有 Nacos 后端可以使用。

§consul: Option<Value>

Consul 专用配置,只有 Consul 后端可以使用。

Implementations§

Source§

impl RegistrationConfig

Source

pub fn policy(&self) -> RegistrationPolicy

业务作用:将配置中的启动与运行期要求转换成公共注册策略。

参数说明:无。

返回:两个必需性维度保持独立。

Trait Implementations§

Source§

impl Clone for RegistrationConfig

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
Source§

impl Default for RegistrationConfig

Source§

fn default() -> Self

业务作用:注册目标省略 qualifier 时使用 primary,默认要求首次注册确认。

参数说明:无。

返回:服务与地址待显式配置或宿主解析的注册项;兼容默认连接覆盖不改变此处的 primary。

Source§

impl<'de> Deserialize<'de> for RegistrationConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for RegistrationConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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.