Struct iroh_rpc_client::status::ServiceStatus
source · pub struct ServiceStatus { /* private fields */ }
Expand description
The status of an individual rpc service
Implementations§
source§impl ServiceStatus
impl ServiceStatus
sourcepub fn new<I: Into<String>>(
typ: ServiceType,
status: StatusType,
version: I
) -> Self
pub fn new<I: Into<String>>(
typ: ServiceType,
status: StatusType,
version: I
) -> Self
Examples found in repository?
src/status.rs (line 84)
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
pub fn new(
gateway: Option<ServiceStatus>,
p2p: Option<ServiceStatus>,
store: Option<ServiceStatus>,
) -> Self {
Self {
gateway: gateway.unwrap_or_else(|| {
ServiceStatus::new(ServiceType::Gateway, StatusType::Unknown, "")
}),
p2p: p2p
.unwrap_or_else(|| ServiceStatus::new(ServiceType::P2p, StatusType::Unknown, "")),
store: store
.unwrap_or_else(|| ServiceStatus::new(ServiceType::Store, StatusType::Unknown, "")),
}
}
More examples
src/client.rs (line 150)
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 name(&self) -> &'static str
pub fn status(&self) -> StatusType
pub fn version(&self) -> &str
Trait Implementations§
source§impl Clone for ServiceStatus
impl Clone for ServiceStatus
source§fn clone(&self) -> ServiceStatus
fn clone(&self) -> ServiceStatus
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 ServiceStatus
impl Debug for ServiceStatus
source§impl PartialEq<ServiceStatus> for ServiceStatus
impl PartialEq<ServiceStatus> for ServiceStatus
source§fn eq(&self, other: &ServiceStatus) -> bool
fn eq(&self, other: &ServiceStatus) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for ServiceStatus
impl StructuralEq for ServiceStatus
impl StructuralPartialEq for ServiceStatus
Auto Trait Implementations§
impl RefUnwindSafe for ServiceStatus
impl Send for ServiceStatus
impl Sync for ServiceStatus
impl Unpin for ServiceStatus
impl UnwindSafe for ServiceStatus
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