pub struct RawSubnetCatalog {
pub catalog_schema_version: u32,
pub provenance: SubnetCatalogProvenance,
pub catalog_digest: String,
pub subnets: Vec<SubnetInfo>,
pub routing_ranges: Vec<RoutingRange>,
}Expand description
RawSubnetCatalog
Untrusted serialized subnet catalog representation from a source or cache.
Fields§
§catalog_schema_version: u32Persisted catalog schema version.
provenance: SubnetCatalogProvenanceRegistry and collection provenance supplied with the snapshot.
catalog_digest: StringLowercase SHA-256 digest of the canonical authority payload.
subnets: Vec<SubnetInfo>Canonically ordered Subnet rows.
routing_ranges: Vec<RoutingRange>Canonically ordered inclusive routing ranges.
Implementations§
Source§impl RawSubnetCatalog
impl RawSubnetCatalog
Sourcepub fn validate(&self) -> Result<(), CatalogError>
pub fn validate(&self) -> Result<(), CatalogError>
Validate schema, fixed mainnet identity, raw classifications, and routing structure.
Sourcepub fn subnet_by_principal(&self, subnet_principal: &str) -> Option<&SubnetInfo>
pub fn subnet_by_principal(&self, subnet_principal: &str) -> Option<&SubnetInfo>
Find one raw Subnet row by canonical principal text.
Sourcepub fn routing_ranges_for_subnet(
&self,
subnet_principal: &str,
) -> Vec<&RoutingRange>
pub fn routing_ranges_for_subnet( &self, subnet_principal: &str, ) -> Vec<&RoutingRange>
Return raw routing ranges assigned to one Subnet.
Source§impl RawSubnetCatalog
impl RawSubnetCatalog
Sourcepub fn resolve_canister(
&self,
input_principal: &str,
) -> Result<ResolvedSubnet, CatalogError>
pub fn resolve_canister( &self, input_principal: &str, ) -> Result<ResolvedSubnet, CatalogError>
Resolve a canister principal through cached routing ranges.
Source§impl RawSubnetCatalog
impl RawSubnetCatalog
Sourcepub fn resolve_principal_or_prefix(
&self,
input: &str,
forced: Option<ResolveAs>,
) -> Result<ResolvedSubnet, CatalogError>
pub fn resolve_principal_or_prefix( &self, input: &str, forced: Option<ResolveAs>, ) -> Result<ResolvedSubnet, CatalogError>
Resolve an exact principal or a unique cached subnet principal prefix.
Sourcepub fn resolve_principal_prefix(
&self,
input: &str,
forced: Option<ResolveAs>,
) -> Result<ResolvedSubnet, CatalogError>
pub fn resolve_principal_prefix( &self, input: &str, forced: Option<ResolveAs>, ) -> Result<ResolvedSubnet, CatalogError>
Resolve a unique prefix of a cached subnet principal.
Source§impl RawSubnetCatalog
impl RawSubnetCatalog
Sourcepub fn resolve_principal(
&self,
input: &str,
forced: Option<ResolveAs>,
) -> Result<ResolvedSubnet, CatalogError>
pub fn resolve_principal( &self, input: &str, forced: Option<ResolveAs>, ) -> Result<ResolvedSubnet, CatalogError>
Resolve a principal as a known subnet or as a canister covered by a cached range.
Trait Implementations§
Source§impl Clone for RawSubnetCatalog
impl Clone for RawSubnetCatalog
Source§fn clone(&self) -> RawSubnetCatalog
fn clone(&self) -> RawSubnetCatalog
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more