Struct tox::toxcore::toxid::NoSpam[][src]

pub struct NoSpam(pub [u8; 4]);

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

Methods

impl NoSpam
[src]

Create new NoSpam with random bytes.

Two new() NoSpams will always be different:

use self::tox::toxcore::toxid::NoSpam;

assert!(NoSpam::new() != NoSpam::new());

Trait Implementations

impl Clone for NoSpam
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for NoSpam
[src]

impl Debug for NoSpam
[src]

Formats the value using the given formatter. Read more

impl Eq for NoSpam
[src]

impl PartialEq for NoSpam
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Default for NoSpam
[src]

Always returns a random NoSpam. Equivalent to the NoSpam::new() (#method.new).

Returns the "default value" for a type. Read more

impl UpperHex for NoSpam
[src]

The default formatting of NoSpam.

E.g.:

use self::tox::toxcore::toxid::NoSpam;

assert_eq!(format!("{:X}", NoSpam([0, 0, 0, 0])), "00000000");
assert_eq!(format!("{:X}", NoSpam([255, 255, 255, 255])), "FFFFFFFF");

Formats the value using the given formatter.

impl Display for NoSpam
[src]

Display should always be the same as UpperHex.

use self::tox::toxcore::toxid::NoSpam;

let nospam = NoSpam::new();
assert_eq!(format!("{}", nospam), format!("{:X}", nospam));

Formats the value using the given formatter. Read more

impl FromBytes for NoSpam
[src]

Deserialize struct using nom from raw bytes

impl ToBytes for NoSpam
[src]

Serialize struct into raw bytes using cookie_factory

Auto Trait Implementations

impl Send for NoSpam

impl Sync for NoSpam