Struct blot::uvar::Uvar[][src]

pub struct Uvar(_);

Methods

impl Uvar
[src]

Constructs a new uvar from a byte list. Use {Uvar::from_bytes} if you need a safe constructor.

Consumes the list of bytes.

use blot::uvar::Uvar;

assert_eq!(Uvar::from_bytes(&[0x12]).unwrap().to_bytes(), vec![0x12]);

Transforms a byte list into a uvar.

Takes a uvar from a list of bytes and returns it with the rest of bytes.

use blot::uvar::Uvar;

let buffer = vec![0x12, 0x07, 0x06];
let (uvar, bytes) = Uvar::take(&buffer).unwrap();

assert_eq!(uvar, Uvar::from_bytes(&[0x12]).unwrap());

Trait Implementations

impl From<Sha1> for Uvar
[src]

Performs the conversion.

impl From<Uvar> for Result<Sha1, MultihashError>
[src]

Performs the conversion.

impl From<Sha2256> for Uvar
[src]

Performs the conversion.

impl From<Uvar> for Result<Sha2256, MultihashError>
[src]

Performs the conversion.

impl From<Sha2512> for Uvar
[src]

Performs the conversion.

impl From<Uvar> for Result<Sha2512, MultihashError>
[src]

Performs the conversion.

impl From<Sha3512> for Uvar
[src]

Performs the conversion.

impl From<Uvar> for Result<Sha3512, MultihashError>
[src]

Performs the conversion.

impl From<Sha3384> for Uvar
[src]

Performs the conversion.

impl From<Uvar> for Result<Sha3384, MultihashError>
[src]

Performs the conversion.

impl From<Sha3256> for Uvar
[src]

Performs the conversion.

impl From<Uvar> for Result<Sha3256, MultihashError>
[src]

Performs the conversion.

impl From<Sha3224> for Uvar
[src]

Performs the conversion.

impl From<Uvar> for Result<Sha3224, MultihashError>
[src]

Performs the conversion.

impl From<Blake2b512> for Uvar
[src]

Performs the conversion.

impl From<Uvar> for Result<Blake2b512, MultihashError>
[src]

Performs the conversion.

impl From<Blake2s256> for Uvar
[src]

Performs the conversion.

impl From<Uvar> for Result<Blake2s256, MultihashError>
[src]

Performs the conversion.

impl Debug for Uvar
[src]

Formats the value using the given formatter. Read more

impl Clone for Uvar
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for Uvar
[src]

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

This method tests for !=.

impl LowerHex for Uvar
[src]

Formats the value using the given formatter.

impl UpperHex for Uvar
[src]

Formats the value using the given formatter.

impl Binary for Uvar
[src]

Formats the value using the given formatter.

impl Display for Uvar
[src]

Formats the value using the given formatter. Read more

impl From<Uvar> for u64
[src]

Performs the conversion.

impl From<u64> for Uvar
[src]

This conversion consumes full bytes, not 7bit bytes as you would expect from variable integers.

WARNING: This method forces to Big Endian. It hasn't been tested properly with different architectures.

Performs the conversion.

Auto Trait Implementations

impl Send for Uvar

impl Sync for Uvar