pub struct PeerId(pub Id20);Expand description
A BitTorrent peer ID (20 bytes).
Uses Azureus-style encoding: -FE0100- followed by 12 random bytes.
FE = Torrent (formerly Ferrite), 0100 = version 0.1.0.
Tuple Fields§
§0: Id20Implementations§
Source§impl PeerId
impl PeerId
Sourcepub fn generate_anonymous() -> Self
pub fn generate_anonymous() -> Self
Generate an anonymous peer ID with a generic client prefix.
Uses -XX0000- prefix (generic/unknown client) instead of -FE0100-
to avoid identifying the client software.
Trait Implementations§
impl Copy for PeerId
impl Eq for PeerId
impl StructuralPartialEq for PeerId
Auto Trait Implementations§
impl Freeze for PeerId
impl RefUnwindSafe for PeerId
impl Send for PeerId
impl Sync for PeerId
impl Unpin for PeerId
impl UnsafeUnpin for PeerId
impl UnwindSafe for PeerId
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