Struct iroh_rpc_client::status::ClientStatus
source · pub struct ClientStatus {
pub gateway: ServiceStatus,
pub p2p: ServiceStatus,
pub store: ServiceStatus,
}
Fields§
§gateway: ServiceStatus
§p2p: ServiceStatus
§store: ServiceStatus
Implementations§
source§impl ClientStatus
impl ClientStatus
sourcepub fn new(
gateway: Option<ServiceStatus>,
p2p: Option<ServiceStatus>,
store: Option<ServiceStatus>
) -> Self
pub fn new(
gateway: Option<ServiceStatus>,
p2p: Option<ServiceStatus>,
store: Option<ServiceStatus>
) -> Self
Examples found in repository?
More examples
src/client.rs (line 166)
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
pub async fn check(&self) -> crate::status::ClientStatus {
let g = if let Some(ref g) = self.gateway {
let (s, v) = g.check().await;
Some(ServiceStatus::new(ServiceType::Gateway, s, v))
} else {
None
};
let p = if let Some(ref p) = self.p2p.get() {
let (s, v) = p.check().await;
Some(ServiceStatus::new(ServiceType::P2p, s, v))
} else {
None
};
let s = if let Some(ref s) = self.store.get() {
let (s, v) = s.check().await;
Some(ServiceStatus::new(ServiceType::Store, s, v))
} else {
None
};
ClientStatus::new(g, p, s)
}
pub fn iter(&self) -> ClientStatusIterator<'_> ⓘ
pub fn update(&mut self, s: ServiceStatus)
Trait Implementations§
source§impl Clone for ClientStatus
impl Clone for ClientStatus
source§fn clone(&self) -> ClientStatus
fn clone(&self) -> ClientStatus
Returns a copy 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 ClientStatus
impl Debug for ClientStatus
source§impl Default for ClientStatus
impl Default for ClientStatus
source§impl PartialEq<ClientStatus> for ClientStatus
impl PartialEq<ClientStatus> for ClientStatus
source§fn eq(&self, other: &ClientStatus) -> bool
fn eq(&self, other: &ClientStatus) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for ClientStatus
impl StructuralEq for ClientStatus
impl StructuralPartialEq for ClientStatus
Auto Trait Implementations§
impl RefUnwindSafe for ClientStatus
impl Send for ClientStatus
impl Sync for ClientStatus
impl Unpin for ClientStatus
impl UnwindSafe for ClientStatus
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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