pub enum AnyNode {
NodeRecord(NodeRecord),
Enr(Enr<SecretKey>),
PeerId(PeerId),
}
Expand description
A peer that can come in ENR or NodeRecord
form.
Variants§
NodeRecord(NodeRecord)
An “enode:” peer with full ip
Enr(Enr<SecretKey>)
Available on crate feature
secp256k1
only.An “enr:” peer
PeerId(PeerId)
An incomplete “enode” with only a peer id
Implementations§
Source§impl AnyNode
impl AnyNode
Sourcepub fn node_record(&self) -> Option<NodeRecord>
pub fn node_record(&self) -> Option<NodeRecord>
Returns the full node record if available.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AnyNode
impl<'de> Deserialize<'de> for AnyNode
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 From<NodeRecord> for AnyNode
impl From<NodeRecord> for AnyNode
Source§fn from(value: NodeRecord) -> Self
fn from(value: NodeRecord) -> Self
Converts to this type from the input type.
impl Eq for AnyNode
impl StructuralPartialEq for AnyNode
Auto Trait Implementations§
impl Freeze for AnyNode
impl RefUnwindSafe for AnyNode
impl Send for AnyNode
impl Sync for AnyNode
impl Unpin for AnyNode
impl UnwindSafe for AnyNode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 96 bytes
Size for each variant:
NodeRecord
: 87 bytesEnr
: 95 bytesPeerId
: 64 bytes