pub struct ServiceFilter {
pub service_types: Option<Vec<ServiceType>>,
pub protocols: Option<Vec<ProtocolType>>,
pub name_contains: Option<String>,
pub local_only: bool,
pub discovered_only: bool,
pub max_age: Option<Duration>,
}Expand description
Filter for querying services from the registry
Fields§
§service_types: Option<Vec<ServiceType>>Filter by service types
protocols: Option<Vec<ProtocolType>>Filter by protocols
name_contains: Option<String>Filter by service name (contains)
local_only: boolInclude only local services
discovered_only: boolInclude only discovered services
max_age: Option<Duration>Maximum age of services to include
Implementations§
Source§impl ServiceFilter
impl ServiceFilter
Sourcepub fn with_service_types(self, types: Vec<ServiceType>) -> Self
pub fn with_service_types(self, types: Vec<ServiceType>) -> Self
Filter by service types
Sourcepub fn with_protocols(self, protocols: Vec<ProtocolType>) -> Self
pub fn with_protocols(self, protocols: Vec<ProtocolType>) -> Self
Filter by protocols
Sourcepub fn with_name_contains(self, name: String) -> Self
pub fn with_name_contains(self, name: String) -> Self
Filter by service name
Sourcepub fn local_only(self) -> Self
pub fn local_only(self) -> Self
Include only local services
Sourcepub fn discovered_only(self) -> Self
pub fn discovered_only(self) -> Self
Include only discovered services
Sourcepub fn with_max_age(self, max_age: Duration) -> Self
pub fn with_max_age(self, max_age: Duration) -> Self
Set maximum age of services
Sourcepub fn matches(&self, entry: &ServiceEntry) -> bool
pub fn matches(&self, entry: &ServiceEntry) -> bool
Check if a service entry matches this filter
Trait Implementations§
Source§impl Clone for ServiceFilter
impl Clone for ServiceFilter
Source§fn clone(&self) -> ServiceFilter
fn clone(&self) -> ServiceFilter
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 ServiceFilter
impl Debug for ServiceFilter
Source§impl Default for ServiceFilter
impl Default for ServiceFilter
Source§fn default() -> ServiceFilter
fn default() -> ServiceFilter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ServiceFilter
impl RefUnwindSafe for ServiceFilter
impl Send for ServiceFilter
impl Sync for ServiceFilter
impl Unpin for ServiceFilter
impl UnwindSafe for ServiceFilter
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