pub struct ServiceInfo {
pub id: String,
pub service_type: ServiceType,
pub network_id: String,
pub status: ServiceStatus,
pub started_at: DateTime<Utc>,
pub metadata: HashMap<String, Value>,
}Expand description
Metadata for a local service instance (daemon-side).
Created by ServiceInfo::new when a Hatch request is dispatched.
Stored in the ServiceRegistry for the lifetime of the running service.
Fields§
§id: StringUnique ID for this service instance (UUID v4).
service_type: ServiceTypeWhether this node offers storage, file I/O, or pure relay.
network_id: StringIdentifier of the BillPouch network this service participates in.
status: ServiceStatusCurrent lifecycle state of the service.
started_at: DateTime<Utc>UTC timestamp when the service was started.
metadata: HashMap<String, Value>Extensible metadata (e.g. storage_bytes for Pouch, mount_path for Bill).
Implementations§
Source§impl ServiceInfo
impl ServiceInfo
Sourcepub fn new(
service_type: ServiceType,
network_id: String,
metadata: HashMap<String, Value>,
) -> Self
pub fn new( service_type: ServiceType, network_id: String, metadata: HashMap<String, Value>, ) -> Self
Construct a new ServiceInfo in the ServiceStatus::Starting state.
Generates a fresh UUID v4 service_id and records the current UTC time
as started_at.
Trait Implementations§
Source§impl Clone for ServiceInfo
impl Clone for ServiceInfo
Source§fn clone(&self) -> ServiceInfo
fn clone(&self) -> ServiceInfo
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 ServiceInfo
impl Debug for ServiceInfo
Source§impl<'de> Deserialize<'de> for ServiceInfo
impl<'de> Deserialize<'de> for ServiceInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ServiceInfo
impl RefUnwindSafe for ServiceInfo
impl Send for ServiceInfo
impl Sync for ServiceInfo
impl Unpin for ServiceInfo
impl UnwindSafe for ServiceInfo
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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