pub struct Instance {Show 14 fields
pub instance_id: String,
pub ip: String,
pub port: i32,
pub weight: f64,
pub healthy: bool,
pub enabled: bool,
pub ephemeral: bool,
pub cluster_name: String,
pub service_name: String,
pub metadata: HashMap<String, String>,
pub instance_heart_beat_interval: i64,
pub instance_heart_beat_time_out: i64,
pub ip_delete_timeout: i64,
pub instance_id_generator: String,
}Expand description
Service instance information
Fields§
§instance_id: String§ip: String§port: i32§weight: f64§healthy: bool§enabled: bool§ephemeral: bool§cluster_name: String§service_name: String§metadata: HashMap<String, String>§instance_heart_beat_interval: i64§instance_heart_beat_time_out: i64§ip_delete_timeout: i64§instance_id_generator: StringImplementations§
Source§impl Instance
impl Instance
pub fn new(ip: &str, port: i32) -> Self
pub fn with_weight(self, weight: f64) -> Self
pub fn with_cluster(self, cluster: &str) -> Self
pub fn with_metadata(self, key: &str, value: &str) -> Self
pub fn with_ephemeral(self, ephemeral: bool) -> Self
pub fn with_enabled(self, enabled: bool) -> Self
Sourcepub fn generate_instance_id(&mut self)
pub fn generate_instance_id(&mut self)
Generate instance ID if not set
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
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§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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> 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