pub struct ServiceInfo {
pub service_id: String,
pub name: String,
pub address: String,
pub capabilities: Vec<String>,
pub metadata: HashMap<String, String>,
pub last_seen: SystemTime,
pub version: String,
}Expand description
Discovered service information
Fields§
§service_id: StringUnique service ID
name: StringService name
address: StringService address (URL)
capabilities: Vec<String>Service capabilities
metadata: HashMap<String, String>Service metadata
last_seen: SystemTimeLast seen timestamp
version: StringService version
Implementations§
Source§impl ServiceInfo
impl ServiceInfo
Sourcepub fn add_capability(&mut self, capability: String)
pub fn add_capability(&mut self, capability: String)
Add capability
Sourcepub fn add_metadata(&mut self, key: String, value: String)
pub fn add_metadata(&mut self, key: String, value: String)
Add metadata
Sourcepub fn has_capability(&self, capability: &str) -> bool
pub fn has_capability(&self, capability: &str) -> bool
Check if service has capability
Sourcepub fn get_metadata(&self, key: &str) -> Option<&String>
pub fn get_metadata(&self, key: &str) -> Option<&String>
Get metadata value
Sourcepub fn update_last_seen(&mut self)
pub fn update_last_seen(&mut self)
Update last seen timestamp
Trait Implementations§
Source§impl Clone for ServiceInfo
impl Clone for ServiceInfo
Source§fn clone(&self) -> ServiceInfo
fn clone(&self) -> ServiceInfo
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 ServiceInfo
impl Debug for ServiceInfo
Source§impl From<ServiceInfo> for BackendEndpoint
impl From<ServiceInfo> for BackendEndpoint
Source§fn from(service: ServiceInfo) -> Self
fn from(service: ServiceInfo) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ServiceInfo
impl RefUnwindSafe for ServiceInfo
impl Send for ServiceInfo
impl Sync for ServiceInfo
impl Unpin for ServiceInfo
impl UnwindSafe for ServiceInfo
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