pub struct InfoHash(pub [u8; 20]);Expand description
BitTorrent Info Hash v1
Tuple Fields§
§0: [u8; 20]Implementations§
Source§impl InfoHash
impl InfoHash
Sourcepub fn from_bytes(bytes: &[u8]) -> Self
pub fn from_bytes(bytes: &[u8]) -> Self
Sourcepub fn to_hex_string(&self) -> String
pub fn to_hex_string(&self) -> String
Returns the InfoHash as a hex string.
Trait Implementations§
impl Copy for InfoHash
Source§impl<'de> Deserialize<'de> for InfoHash
Available on crate feature serde only.
impl<'de> Deserialize<'de> for InfoHash
Available on crate feature
serde only.Source§fn deserialize<D: Deserializer<'de>>(des: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(des: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for InfoHash
Source§impl From<&DefaultHasher> for InfoHash
for testing
impl From<&DefaultHasher> for InfoHash
for testing
Source§fn from(data: &DefaultHasher) -> Self
fn from(data: &DefaultHasher) -> Self
Converts to this type from the input type.
Source§impl Ord for InfoHash
impl Ord for InfoHash
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for InfoHash
impl PartialOrd for InfoHash
impl StructuralPartialEq for InfoHash
Auto Trait Implementations§
impl Freeze for InfoHash
impl RefUnwindSafe for InfoHash
impl Send for InfoHash
impl Sync for InfoHash
impl Unpin for InfoHash
impl UnsafeUnpin for InfoHash
impl UnwindSafe for InfoHash
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