mssf-util 0.5.0

mssf utilites and extensions for tokio and more
Documentation
// ------------------------------------------------------------
// Copyright (c) Microsoft Corporation.  All rights reserved.
// Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
// ------------------------------------------------------------

/// Health entities produced by HealthDataProducer.
#[derive(Debug, Clone)]
pub enum HealthEntity {
    Node(NodeHealthEntity),
    Cluster(ClusterHealthEntity),
    Application(ApplicationHealthEntity),
    Partition(PartitionHealthEntity),
    Service(ServiceHealthEntity),
    Replica(ReplicaHealthEntity),
}

/// There is no info for cluster name in FabricClient.
/// User is supposed to inject the cluster name in consumer side.
#[derive(Debug, Clone)]
pub struct ClusterHealthEntity {
    pub health: mssf_core::types::ClusterHealth,
}

#[derive(Debug, Clone)]
pub struct NodeHealthEntity {
    pub node: mssf_core::types::NodeQueryResultItem,
    pub health: mssf_core::types::NodeHealthResult,
}

#[derive(Debug, Clone)]
pub struct ApplicationHealthEntity {
    pub application: mssf_core::types::ApplicationQueryResultItem,
    pub health: mssf_core::types::ApplicationHealth,
}

#[derive(Debug, Clone)]
pub struct ServiceHealthEntity {
    pub service: mssf_core::types::ServiceQueryResultItem,
    pub health: mssf_core::types::ServiceHealthResult,
}

#[derive(Debug, Clone)]
pub struct PartitionHealthEntity {
    pub partition: mssf_core::types::ServicePartitionQueryResultItem,
    pub health: mssf_core::types::PartitionHealthResult,
}

#[derive(Debug, Clone)]
pub struct ReplicaHealthEntity {
    pub replica: mssf_core::types::ServiceReplicaQueryResultItem,
    pub health: mssf_core::types::ReplicaHealthResult,
}