pub struct ServiceInstance {
pub id: String,
pub name: String,
pub addr: SocketAddr,
pub metadata: HashMap<String, String>,
pub tags: Vec<String>,
pub registered_at: DateTime<Utc>,
pub last_heartbeat: DateTime<Utc>,
pub weight: u32,
pub status: ServiceStatus,
}Expand description
服务实例信息
Fields§
§id: String服务唯一标识
name: String服务名称
addr: SocketAddr服务地址
metadata: HashMap<String, String>服务元数据
服务标签
registered_at: DateTime<Utc>注册时间
last_heartbeat: DateTime<Utc>最后心跳时间
weight: u32服务权重 (用于负载均衡)
status: ServiceStatus服务状态
Trait Implementations§
Source§impl Clone for ServiceInstance
impl Clone for ServiceInstance
Source§fn clone(&self) -> ServiceInstance
fn clone(&self) -> ServiceInstance
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ServiceInstance
impl Debug for ServiceInstance
Source§impl<'de> Deserialize<'de> for ServiceInstance
impl<'de> Deserialize<'de> for ServiceInstance
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
Auto Trait Implementations§
impl Freeze for ServiceInstance
impl RefUnwindSafe for ServiceInstance
impl Send for ServiceInstance
impl Sync for ServiceInstance
impl Unpin for ServiceInstance
impl UnsafeUnpin for ServiceInstance
impl UnwindSafe for ServiceInstance
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