pub struct NodeInfo {
pub node_id: String,
pub address: Option<Address>,
pub role: NetworkRole,
pub listen_addresses: Vec<SocketAddr>,
pub public_addresses: Vec<SocketAddr>,
pub protocol_version: u32,
pub user_agent: String,
pub start_time: Timestamp,
pub config: NodeConfiguration,
}Expand description
Information about the local node
Fields§
§node_id: StringNode’s unique identifier
address: Option<Address>Node’s account address (if applicable)
role: NetworkRoleNode’s role in the network
listen_addresses: Vec<SocketAddr>Listen addresses
public_addresses: Vec<SocketAddr>Public addresses (for NAT traversal)
protocol_version: u32Protocol version
user_agent: StringUser agent string
start_time: TimestampNode start time
config: NodeConfigurationNode configuration
Implementations§
Source§impl NodeInfo
impl NodeInfo
Sourcepub fn new(node_id: String, role: NetworkRole) -> Self
pub fn new(node_id: String, role: NetworkRole) -> Self
Creates a new NodeInfo
Sourcepub fn with_address(self, address: Address) -> Self
pub fn with_address(self, address: Address) -> Self
Sets the node’s account address
Sourcepub fn add_listen_address(&mut self, addr: SocketAddr)
pub fn add_listen_address(&mut self, addr: SocketAddr)
Adds a listen address
Sourcepub fn add_public_address(&mut self, addr: SocketAddr)
pub fn add_public_address(&mut self, addr: SocketAddr)
Adds a public address
Trait Implementations§
Source§impl<'de> Deserialize<'de> for NodeInfo
impl<'de> Deserialize<'de> for NodeInfo
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 NodeInfo
impl StructuralPartialEq for NodeInfo
Auto Trait Implementations§
impl Freeze for NodeInfo
impl RefUnwindSafe for NodeInfo
impl Send for NodeInfo
impl Sync for NodeInfo
impl Unpin for NodeInfo
impl UnsafeUnpin for NodeInfo
impl UnwindSafe for NodeInfo
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