Enum diem_config::network_id::NetworkId
source · pub enum NetworkId {
Validator,
Public,
Private(String),
}
Expand description
A representation of the network being used in communication.
There should only be one of each NetworkId used for a single node (except for NetworkId::Public),
and handshakes should verify that the NetworkId being used is the same during a handshake,
to effectively ensure communication is restricted to a network. Network should be checked that
it is not the DEFAULT_NETWORK
Variants§
Implementations§
source§impl NetworkId
impl NetworkId
sourcepub fn vfn_network() -> NetworkId
pub fn vfn_network() -> NetworkId
Convenience function to specify the VFN network
pub fn is_vfn_network(&self) -> bool
pub fn is_validator_network(&self) -> bool
sourcepub fn upstream_roles(&self, role: &RoleType) -> &'static [PeerRole]
pub fn upstream_roles(&self, role: &RoleType) -> &'static [PeerRole]
Roles for a prioritization of relative upstreams
sourcepub fn downstream_roles(&self, role: &RoleType) -> &'static [PeerRole]
pub fn downstream_roles(&self, role: &RoleType) -> &'static [PeerRole]
Roles for a prioritization of relative downstreams
pub fn as_str(&self) -> &str
Trait Implementations§
source§impl<'de> Deserialize<'de> for NetworkId
impl<'de> Deserialize<'de> for NetworkId
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
source§impl Ord for NetworkId
impl Ord for NetworkId
source§impl PartialEq<NetworkId> for NetworkId
impl PartialEq<NetworkId> for NetworkId
source§impl PartialOrd<NetworkId> for NetworkId
impl PartialOrd<NetworkId> for NetworkId
source§fn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
Generalized ordering for determining which network is the most important. The lower the ordering, the higher the importance (i.e., the validator network is less than all other networks because it has the highest priority).
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for NetworkId
impl StructuralEq for NetworkId
impl StructuralPartialEq for NetworkId
Auto Trait Implementations§
impl RefUnwindSafe for NetworkId
impl Send for NetworkId
impl Sync for NetworkId
impl Unpin for NetworkId
impl UnwindSafe for NetworkId
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.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> PersistableConfig for Twhere
T: Serialize + DeserializeOwned + ?Sized,
impl<T> PersistableConfig for Twhere T: Serialize + DeserializeOwned + ?Sized,
source§impl<T> Serialize for Twhere
T: Serialize + ?Sized,
impl<T> Serialize for Twhere T: Serialize + ?Sized,
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>
§impl<T> TestOnlyHash for Twhere
T: Serialize + ?Sized,
impl<T> TestOnlyHash for Twhere T: Serialize + ?Sized,
§fn test_only_hash(&self) -> HashValue
fn test_only_hash(&self) -> HashValue
Generates a hash used only for tests.