Struct diem_config::network_id::NetworkContext
source · pub struct NetworkContext { /* private fields */ }
Expand description
A grouping of common information between all networking code for logging. This should greatly reduce the groupings between these given everywhere, and will allow for logging accordingly.
Implementations§
source§impl NetworkContext
impl NetworkContext
pub fn new( role: RoleType, network_id: NetworkId, peer_id: PeerId ) -> NetworkContext
pub fn role(&self) -> RoleType
pub fn network_id(&self) -> &NetworkId
pub fn peer_id(&self) -> PeerId
pub fn mock_with_peer_id(peer_id: PeerId) -> Arc<Self>
pub fn mock() -> Arc<Self>
Trait Implementations§
source§impl Clone for NetworkContext
impl Clone for NetworkContext
source§fn clone(&self) -> NetworkContext
fn clone(&self) -> NetworkContext
Returns a copy 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 NetworkContext
impl Debug for NetworkContext
source§impl Display for NetworkContext
impl Display for NetworkContext
source§impl PartialEq<NetworkContext> for NetworkContext
impl PartialEq<NetworkContext> for NetworkContext
source§fn eq(&self, other: &NetworkContext) -> bool
fn eq(&self, other: &NetworkContext) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for NetworkContext
impl Serialize for NetworkContext
impl Eq for NetworkContext
impl StructuralEq for NetworkContext
impl StructuralPartialEq for NetworkContext
Auto Trait Implementations§
impl RefUnwindSafe for NetworkContext
impl Send for NetworkContext
impl Sync for NetworkContext
impl Unpin for NetworkContext
impl UnwindSafe for NetworkContext
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> 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.