pub struct ServiceInstance {
pub id: String,
pub name: String,
pub address: String,
pub port: u16,
pub healthy: bool,
pub weight: u32,
pub tags: Vec<String>,
pub metadata: HashMap<String, String>,
}Expand description
A single instance of a service available for discovery.
Fields§
§id: StringUnique instance identifier (e.g. UUID).
name: StringLogical service name (e.g. "payment-service").
address: StringHost or IP address.
port: u16Port the service is listening on.
healthy: boolWhether the instance is currently healthy.
weight: u32Relative load-balancing weight. Zero is treated as one by weighted balancers.
Freeform tags for filtering (e.g. ["canary", "us-east-1"]).
metadata: HashMap<String, String>Arbitrary key-value metadata.
Implementations§
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 (const: unstable) · 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