sui_sdk_types

Struct Digest

source
pub struct Digest(/* private fields */);
Expand description

A representation of a 32 byte digest

Implementations§

source§

impl Digest

source

pub const LENGTH: usize = 32usize

source

pub const ZERO: Self = _

source

pub const fn new(digest: [u8; 32]) -> Self

source

pub fn generate<R>(rng: R) -> Self
where R: RngCore + CryptoRng,

Available on crate feature rand only.
source

pub const fn inner(&self) -> &[u8; 32]

source

pub const fn into_inner(self) -> [u8; 32]

source

pub const fn as_bytes(&self) -> &[u8]

source

pub fn from_base58<T: AsRef<[u8]>>(base58: T) -> Result<Self, DigestParseError>

source

pub fn to_base58(&self) -> String

source

pub fn from_bytes<T: AsRef<[u8]>>(bytes: T) -> Result<Self, DigestParseError>

Trait Implementations§

source§

impl Arbitrary for Digest

source§

type Parameters = ()

The type of parameters that arbitrary_with accepts for configuration of the generated Strategy. Parameters must implement Default.
source§

type Strategy = BoxedStrategy<Digest>

The type of Strategy used to generate values of type Self.
source§

fn arbitrary_with(args: <Self as Arbitrary>::Parameters) -> Self::Strategy

Generates a Strategy for producing arbitrary values of type the implementing type (Self). The strategy is passed the arguments given in args. Read more
§

fn arbitrary() -> Self::Strategy

Generates a Strategy for producing arbitrary values of type the implementing type (Self). Read more
source§

impl AsRef<[u8]> for Digest

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<[u8; 32]> for Digest

source§

fn as_ref(&self) -> &[u8; 32]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for Digest

source§

fn clone(&self) -> Digest

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Digest

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Digest

source§

fn default() -> Digest

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for Digest

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for Digest

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<[u8; 32]> for Digest

source§

fn from(digest: [u8; 32]) -> Self

Converts to this type from the input type.
source§

impl From<CheckpointContentsDigest> for Digest

source§

fn from(digest: CheckpointContentsDigest) -> Self

Converts to this type from the input type.
source§

impl From<CheckpointDigest> for Digest

source§

fn from(digest: CheckpointDigest) -> Self

Converts to this type from the input type.
source§

impl From<ConsensusCommitDigest> for Digest

source§

fn from(digest: ConsensusCommitDigest) -> Self

Converts to this type from the input type.
source§

impl From<Digest> for [u8; 32]

source§

fn from(digest: Digest) -> Self

Converts to this type from the input type.
source§

impl From<Digest> for CheckpointContentsDigest

source§

fn from(digest: Digest) -> Self

Converts to this type from the input type.
source§

impl From<Digest> for CheckpointDigest

source§

fn from(digest: Digest) -> Self

Converts to this type from the input type.
source§

impl From<Digest> for ConsensusCommitDigest

source§

fn from(digest: Digest) -> Self

Converts to this type from the input type.
source§

impl From<Digest> for EffectsAuxiliaryDataDigest

source§

fn from(digest: Digest) -> Self

Converts to this type from the input type.
source§

impl From<Digest> for ObjectDigest

source§

fn from(digest: Digest) -> Self

Converts to this type from the input type.
source§

impl From<Digest> for TransactionDigest

source§

fn from(digest: Digest) -> Self

Converts to this type from the input type.
source§

impl From<Digest> for TransactionEffectsDigest

source§

fn from(digest: Digest) -> Self

Converts to this type from the input type.
source§

impl From<Digest> for TransactionEventsDigest

source§

fn from(digest: Digest) -> Self

Converts to this type from the input type.
source§

impl From<EffectsAuxiliaryDataDigest> for Digest

source§

fn from(digest: EffectsAuxiliaryDataDigest) -> Self

Converts to this type from the input type.
source§

impl From<ObjectDigest> for Digest

source§

fn from(digest: ObjectDigest) -> Self

Converts to this type from the input type.
source§

impl From<TransactionDigest> for Digest

source§

fn from(digest: TransactionDigest) -> Self

Converts to this type from the input type.
source§

impl From<TransactionEffectsDigest> for Digest

source§

fn from(digest: TransactionEffectsDigest) -> Self

Converts to this type from the input type.
source§

impl From<TransactionEventsDigest> for Digest

source§

fn from(digest: TransactionEventsDigest) -> Self

Converts to this type from the input type.
source§

impl FromStr for Digest

source§

type Err = DigestParseError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl Hash for Digest

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl LowerHex for Digest

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Ord for Digest

source§

fn cmp(&self, other: &Digest) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Digest

source§

fn eq(&self, other: &Digest) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Digest

source§

fn partial_cmp(&self, other: &Digest) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Serialize for Digest

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Copy for Digest

source§

impl Eq for Digest

source§

impl StructuralPartialEq for Digest

Auto Trait Implementations§

§

impl Freeze for Digest

§

impl RefUnwindSafe for Digest

§

impl Send for Digest

§

impl Sync for Digest

§

impl Unpin for Digest

§

impl UnwindSafe for Digest

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<U> As for U

§

fn as_<T>(self) -> T
where T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T> ToHex for T
where T: AsRef<[u8]>,

source§

fn encode_hex<U>(&self) -> U
where U: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case letters are used (e.g. f9b4ca)
source§

fn encode_hex_upper<U>(&self) -> U
where U: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case letters are used (e.g. F9B4CA)
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

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

§

fn vzip(self) -> V

source§

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