pub struct ServiceEntry {
pub service: ServiceInfo,
pub timestamp: Instant,
pub is_local: bool,
pub ttl: Option<Duration>,
pub protocol: ProtocolType,
}Expand description
Entry in the service registry with metadata
Fields§
§service: ServiceInfoThe service information
timestamp: InstantWhen the service was registered/discovered
is_local: boolWhether this is a locally registered service
ttl: Option<Duration>Time-to-live for the service entry
protocol: ProtocolTypeThe protocol that discovered/registered this service
Implementations§
Source§impl ServiceEntry
impl ServiceEntry
Sourcepub fn new_local(service: ServiceInfo, protocol: ProtocolType) -> Self
pub fn new_local(service: ServiceInfo, protocol: ProtocolType) -> Self
Create a new service entry for a locally registered service
Sourcepub fn new_discovered(
service: ServiceInfo,
protocol: ProtocolType,
ttl: Option<Duration>,
) -> Self
pub fn new_discovered( service: ServiceInfo, protocol: ProtocolType, ttl: Option<Duration>, ) -> Self
Create a new service entry for a discovered service
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if this service entry has expired
Sourcepub fn service_id(&self) -> String
pub fn service_id(&self) -> String
Get the service ID for indexing
Trait Implementations§
Source§impl Clone for ServiceEntry
impl Clone for ServiceEntry
Source§fn clone(&self) -> ServiceEntry
fn clone(&self) -> ServiceEntry
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 moreAuto Trait Implementations§
impl Freeze for ServiceEntry
impl RefUnwindSafe for ServiceEntry
impl Send for ServiceEntry
impl Sync for ServiceEntry
impl Unpin for ServiceEntry
impl UnwindSafe for ServiceEntry
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