pub struct SubnetCatalog {
pub catalog_schema_version: u32,
pub network: String,
pub registry_canister_id: String,
pub registry_version: u64,
pub fetched_at: String,
pub fetched_by: String,
pub source_endpoint: String,
pub resolver_backend: String,
pub subnets: Vec<SubnetInfo>,
pub routing_ranges: Vec<RoutingRange>,
}Expand description
SubnetCatalog
Fields§
§catalog_schema_version: u32§network: String§registry_canister_id: String§registry_version: u64§fetched_at: String§fetched_by: String§source_endpoint: String§resolver_backend: String§subnets: Vec<SubnetInfo>§routing_ranges: Vec<RoutingRange>Implementations§
Source§impl SubnetCatalog
impl SubnetCatalog
Sourcepub fn validate(&self) -> Result<(), CatalogError>
pub fn validate(&self) -> Result<(), CatalogError>
Validate schema, principal syntax, and routing references.
pub fn subnet_by_principal(&self, subnet_principal: &str) -> Option<&SubnetInfo>
pub fn routing_ranges_for_subnet( &self, subnet_principal: &str, ) -> Vec<&RoutingRange>
Source§impl SubnetCatalog
impl SubnetCatalog
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.
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.
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.
Trait Implementations§
Source§impl Clone for SubnetCatalog
impl Clone for SubnetCatalog
Source§fn clone(&self) -> SubnetCatalog
fn clone(&self) -> SubnetCatalog
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SubnetCatalog
impl Debug for SubnetCatalog
Source§impl<'de> Deserialize<'de> for SubnetCatalog
impl<'de> Deserialize<'de> for SubnetCatalog
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
impl Eq for SubnetCatalog
Source§impl PartialEq for SubnetCatalog
impl PartialEq for SubnetCatalog
Source§fn eq(&self, other: &SubnetCatalog) -> bool
fn eq(&self, other: &SubnetCatalog) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for SubnetCatalog
impl Serialize for SubnetCatalog
impl StructuralPartialEq for SubnetCatalog
Auto Trait Implementations§
impl Freeze for SubnetCatalog
impl RefUnwindSafe for SubnetCatalog
impl Send for SubnetCatalog
impl Sync for SubnetCatalog
impl Unpin for SubnetCatalog
impl UnsafeUnpin for SubnetCatalog
impl UnwindSafe for SubnetCatalog
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.