pub struct DiscoveryClient { /* private fields */ }Expand description
Discovery client for finding providers
Implementations§
Source§impl DiscoveryClient
impl DiscoveryClient
Sourcepub async fn new_with_key(
relays: Vec<String>,
private_key: String,
) -> Result<Self>
pub async fn new_with_key( relays: Vec<String>, private_key: String, ) -> Result<Self>
Create with a private key (for sending spawn requests)
Sourcepub async fn list_providers(
&self,
filter: Option<ProviderFilter>,
) -> Result<Vec<ProviderInfo>>
pub async fn list_providers( &self, filter: Option<ProviderFilter>, ) -> Result<Vec<ProviderInfo>>
List all available providers
Sourcepub async fn get_provider(&self, npub: &str) -> Result<Option<ProviderInfo>>
pub async fn get_provider(&self, npub: &str) -> Result<Option<ProviderInfo>>
Get details of a specific provider (supports exact match or prefix of at least 8 chars) Accepts both hex pubkeys and bech32 npub format.
Sourcepub async fn is_provider_online(&self, npub: &str) -> bool
pub async fn is_provider_online(&self, npub: &str) -> bool
Check if a provider is online
Sourcepub async fn get_uptime(&self, npub: &str, days: u32) -> Result<f32>
pub async fn get_uptime(&self, npub: &str, days: u32) -> Result<f32>
Get uptime percentage for a provider
Sourcepub fn nostr(&self) -> &NostrRelaySubscriber
pub fn nostr(&self) -> &NostrRelaySubscriber
Get the underlying Nostr client (for sending messages)
Sourcepub fn sort_providers(providers: &mut [ProviderInfo], sort_by: &str)
pub fn sort_providers(providers: &mut [ProviderInfo], sort_by: &str)
Sort providers by various criteria
Sourcepub fn format_provider_table(providers: &[ProviderInfo]) -> String
pub fn format_provider_table(providers: &[ProviderInfo]) -> String
Format provider list for display
Sourcepub fn format_provider_details(provider: &ProviderInfo) -> String
pub fn format_provider_details(provider: &ProviderInfo) -> String
Format single provider details
Auto Trait Implementations§
impl Freeze for DiscoveryClient
impl !RefUnwindSafe for DiscoveryClient
impl Send for DiscoveryClient
impl Sync for DiscoveryClient
impl Unpin for DiscoveryClient
impl UnsafeUnpin for DiscoveryClient
impl !UnwindSafe for DiscoveryClient
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
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more