[][src]Struct sampi::Sampi

pub struct Sampi {
    pub public_key: [u8; 32],
    pub unix_time: i64,
    pub data: SampiData,
    pub metadata: SampiMetadata,
    // some fields omitted
}

Fields

public_key: [u8; 32]unix_time: i64data: SampiDatametadata: SampiMetadata

Implementations

impl Sampi[src]

pub fn from_bytes(bytes: &[u8]) -> Result<Self>[src]

Attempt to deserialize a Sampi object from a slice of bytes

pub fn from_bytes_iterator(bytes: &[u8]) -> impl Iterator<Item = Self> + '_[src]

Attempt to deserialize multiple Sampi objects from a slice of bytes

pub fn to_bytes(&self) -> Vec<u8>[src]

Serialize to a Vector of bytes

pub fn from_hex(hex_string: &str) -> Result<Self>[src]

Attempt to deserialize a Sampi object from a &str of hex

pub fn to_hex(&self) -> String[src]

Serialize to a hex string

pub fn from_base32(base32_string: &str) -> Result<Self>[src]

Attempt to deserialize a Sampi object from a &str of base32

pub fn to_base32(&self) -> String[src]

Serialize to a base32 string

pub fn from_base58(base58_string: &str) -> Result<Self>[src]

Attempt to deserialize a Sampi object from a &str of base58

pub fn to_base58(&self) -> String[src]

Serialize to a base58 string

pub fn to_base64(&self) -> String[src]

Serialize to a base64 string

pub fn from_base64(base64_string: &str) -> Result<Self>[src]

Attempt to deserialize a Sampi object from a &str of base64

pub fn get_pow_score(&self) -> u8[src]

Get the Proof of Work Score

pub fn get_public_key_as_hex(&self) -> String[src]

Public key as a hex string

pub fn get_hash_as_hex(&self) -> String[src]

Get the SHA256 hash of the serialized bytes of this object, as a string

pub fn get_hash(&self) -> [u8; 32][src]

Get the SHA256 hash of the serialized bytes of this object, as an array of bytes

Trait Implementations

impl Clone for Sampi[src]

impl Debug for Sampi[src]

impl<'de> Deserialize<'de> for Sampi[src]

impl Eq for Sampi[src]

impl FromStr for Sampi[src]

type Err = Box<dyn Error + Send + Sync + 'static>

The associated error which can be returned from parsing.

fn from_str(data: &str) -> Result<Self, Self::Err>[src]

Attempt to deserialize from a string of base64, base58, base32, or hex

impl Ord for Sampi[src]

impl PartialEq<Sampi> for Sampi[src]

impl PartialOrd<Sampi> for Sampi[src]

impl Serialize for Sampi[src]

Auto Trait Implementations

impl RefUnwindSafe for Sampi

impl Send for Sampi

impl Sync for Sampi

impl Unpin for Sampi

impl UnwindSafe for Sampi

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,