Struct ckb_types::packed::Byte32

source ·
pub struct Byte32(/* private fields */);

Implementations§

source§

impl Byte32

source

pub fn zero() -> Byte32

Creates a new Bytes32 whose bits are all zeros.

source

pub fn max_value() -> Byte32

Creates a new Byte32 whose bits are all ones.

source

pub fn is_zero(&self) -> bool

Checks whether all bits in self are zeros.

source

pub fn new(v: [u8; 32]) -> Byte32

Creates a new Bytes32.

source§

impl Byte32

source

pub const TOTAL_SIZE: usize = 32usize

source

pub const ITEM_SIZE: usize = 1usize

source

pub const ITEM_COUNT: usize = 32usize

source

pub fn nth0(&self) -> Byte

source

pub fn nth1(&self) -> Byte

source

pub fn nth2(&self) -> Byte

source

pub fn nth3(&self) -> Byte

source

pub fn nth4(&self) -> Byte

source

pub fn nth5(&self) -> Byte

source

pub fn nth6(&self) -> Byte

source

pub fn nth7(&self) -> Byte

source

pub fn nth8(&self) -> Byte

source

pub fn nth9(&self) -> Byte

source

pub fn nth10(&self) -> Byte

source

pub fn nth11(&self) -> Byte

source

pub fn nth12(&self) -> Byte

source

pub fn nth13(&self) -> Byte

source

pub fn nth14(&self) -> Byte

source

pub fn nth15(&self) -> Byte

source

pub fn nth16(&self) -> Byte

source

pub fn nth17(&self) -> Byte

source

pub fn nth18(&self) -> Byte

source

pub fn nth19(&self) -> Byte

source

pub fn nth20(&self) -> Byte

source

pub fn nth21(&self) -> Byte

source

pub fn nth22(&self) -> Byte

source

pub fn nth23(&self) -> Byte

source

pub fn nth24(&self) -> Byte

source

pub fn nth25(&self) -> Byte

source

pub fn nth26(&self) -> Byte

source

pub fn nth27(&self) -> Byte

source

pub fn nth28(&self) -> Byte

source

pub fn nth29(&self) -> Byte

source

pub fn nth30(&self) -> Byte

source

pub fn nth31(&self) -> Byte

source

pub fn raw_data(&self) -> Bytes

source

pub fn as_reader<'r>(&'r self) -> Byte32Reader<'r>

Trait Implementations§

source§

impl Clone for Byte32

source§

fn clone(&self) -> Byte32

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 Byte32

source§

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

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

impl Default for Byte32

source§

fn default() -> Byte32

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

impl Display for Byte32

source§

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

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

impl Entity for Byte32

source§

impl Hash for Byte32

source§

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

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 Byte32

source§

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

Formats the value using the given formatter.
source§

impl Ord for Byte32

source§

fn cmp(&self, other: &Byte32) -> 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 + PartialOrd,

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

impl Pack<Byte32> for [u8; 32]

source§

fn pack(&self) -> Byte32

Packs a rust type into binary data.
source§

impl Pack<Byte32> for H256

source§

fn pack(&self) -> Byte32

Packs a rust type into binary data.
source§

impl PartialEq for Byte32

source§

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

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

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

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

impl PartialOrd for Byte32

source§

fn partial_cmp(&self, other: &Byte32) -> 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

This method 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

This method 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

This method 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

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

impl Unpack<[u8; 32]> for Byte32

source§

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

Unpack binary data into rust types.
source§

impl Unpack<H256> for Byte32

source§

fn unpack(&self) -> H256

Unpack binary data into rust types.
source§

impl Eq for Byte32

Auto Trait Implementations§

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
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> 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> PackVec<Byte32Vec, Byte32> for T
where T: IntoIterator<Item = Byte32>,

source§

fn pack(self) -> Byte32Vec

Packs a vector of binary data into one binary data.
source§

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

§

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>,

§

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>,

§

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