pub struct Peer {
pub id: PeerId,
pub socket: SocketAddr,
pub transport: TransportType,
pub httpurl: String,
pub is_pub: bool,
}
Fields§
§id: PeerId
§socket: SocketAddr
§transport: TransportType
§httpurl: String
§is_pub: bool
Implementations§
source§impl Peer
impl Peer
pub fn socket(socket: SocketAddr) -> Peer
pub fn socket_transport(socket: SocketAddr, trans: &str) -> Peer
pub fn peer(peer_id: PeerId) -> Peer
sourcepub fn to_string(&self) -> String
pub fn to_string(&self) -> String
Enhanced multiaddr, you can import/export it. example: “p2p::xxx::/ip4/127.0.0.1/tcp/1234” example: “rpc::xxx::http://example.com”
pub fn from_string(s: &str) -> Result<Peer, Error>
Trait Implementations§
source§impl PartialEq for Peer
impl PartialEq for Peer
impl Eq for Peer
impl StructuralPartialEq for Peer
Auto Trait Implementations§
impl Freeze for Peer
impl RefUnwindSafe for Peer
impl Send for Peer
impl Sync for Peer
impl Unpin for Peer
impl UnwindSafe for Peer
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.