pub struct Instance {Show 19 fields
pub id: Arc<String>,
pub ip: Arc<String>,
pub port: u32,
pub weight: f32,
pub enabled: bool,
pub healthy: bool,
pub ephemeral: bool,
pub cluster_name: String,
pub service_name: Arc<String>,
pub group_name: Arc<String>,
pub group_service: Arc<String>,
pub metadata: Arc<HashMap<String, String>>,
pub last_modified_millis: i64,
pub register_time: i64,
pub namespace_id: Arc<String>,
pub app_name: String,
pub from_grpc: bool,
pub from_cluster: u64,
pub client_id: Arc<String>,
}Fields§
§id: Arc<String>§ip: Arc<String>§port: u32§weight: f32§enabled: bool§healthy: bool§ephemeral: bool§cluster_name: String§service_name: Arc<String>§group_name: Arc<String>§group_service: Arc<String>§metadata: Arc<HashMap<String, String>>§last_modified_millis: i64§register_time: i64§namespace_id: Arc<String>§app_name: String§from_grpc: bool§from_cluster: u64§client_id: Arc<String>Implementations§
Source§impl Instance
impl Instance
pub fn new(ip: String, port: u32) -> Self
pub fn is_from_cluster(&self) -> bool
pub fn is_enable_timeout(&self) -> bool
pub fn generate_key(&mut self)
pub fn init(&mut self)
pub fn check_valid(&self) -> bool
pub fn update_info(&self, o: &Self, _tag: Option<InstanceUpdateTag>) -> bool
pub fn get_service_key(&self) -> ServiceKey
pub fn get_short_key(&self) -> InstanceShortKey
pub fn get_instance_key(&self) -> InstanceKey
pub fn get_id_string(&self) -> String
Sourcepub fn to_do(&self) -> InstanceDo<'static>
pub fn to_do(&self) -> InstanceDo<'static>
转换为 InstanceDo 用于 protobuf 序列化
Sourcepub fn from_do(instance_do: InstanceDo<'_>) -> Self
pub fn from_do(instance_do: InstanceDo<'_>) -> Self
从 InstanceDo 创建 Instance
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Instance
impl<'de> Deserialize<'de> for Instance
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 From<&Instance> for InstanceRegisterParam
impl From<&Instance> for InstanceRegisterParam
Source§impl From<InstanceRegisterParam> for Instance
impl From<InstanceRegisterParam> for Instance
Source§fn from(param: InstanceRegisterParam) -> Self
fn from(param: InstanceRegisterParam) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Instance
impl RefUnwindSafe for Instance
impl Send for Instance
impl Sync for Instance
impl Unpin for Instance
impl UnwindSafe for Instance
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request