[−][src]Struct tox_packet::toxid::NoSpam
NoSpam
used in ToxId
.
Number is used to make sure that there is no friend requests from peers that know out long term PK, but don't actually know Tox ID.
The preferred way of creating NoSpam
is to generate a random one.
Additionally, it should be possible to set a custom NoSpam
.
https://zetok.github.io/tox-spec/#tox-id
Implementations
impl NoSpam
[src]
pub fn random() -> Self
[src]
Create new NoSpam
with random bytes.
Two random()
NoSpam
s will always be different:
use tox_packet::toxid::NoSpam; assert_ne!(NoSpam::random(), NoSpam::random());
Trait Implementations
impl Clone for NoSpam
[src]
impl Copy for NoSpam
[src]
impl Debug for NoSpam
[src]
impl Display for NoSpam
[src]
Display
should always be the same as UpperHex
.
use tox_packet::toxid::NoSpam; let nospam = NoSpam::random(); assert_eq!(format!("{}", nospam), format!("{:X}", nospam));
impl Eq for NoSpam
[src]
impl FromBytes for NoSpam
[src]
impl PartialEq<NoSpam> for NoSpam
[src]
impl StructuralEq for NoSpam
[src]
impl StructuralPartialEq for NoSpam
[src]
impl ToBytes for NoSpam
[src]
impl UpperHex for NoSpam
[src]
The default formatting of NoSpam
.
E.g.:
use tox_packet::toxid::NoSpam; assert_eq!(format!("{:X}", NoSpam([0, 0, 0, 0])), "00000000"); assert_eq!(format!("{:X}", NoSpam([255, 255, 255, 255])), "FFFFFFFF");
Auto Trait Implementations
impl RefUnwindSafe for NoSpam
impl Send for NoSpam
impl Sync for NoSpam
impl Unpin for NoSpam
impl UnwindSafe for NoSpam
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,