#[repr(C)]pub struct H160(pub [u8; 20]);
Expand description
A byte array of length 20 representing the Address.
Tuple Fields§
§0: [u8; 20]
Implementations§
Source§impl H160
impl H160
Sourcepub const fn repeat_byte(byte: u8) -> H160
pub const fn repeat_byte(byte: u8) -> H160
Returns a new fixed hash where all bits are set to the given byte.
Sourcepub fn as_bytes_mut(&mut self) -> &mut [u8] ⓘ
pub fn as_bytes_mut(&mut self) -> &mut [u8] ⓘ
Extracts a mutable byte slice containing the entire fixed hash.
Sourcepub const fn as_fixed_bytes(&self) -> &[u8; 20]
pub const fn as_fixed_bytes(&self) -> &[u8; 20]
Extracts a reference to the byte array containing the entire fixed hash.
Sourcepub fn as_fixed_bytes_mut(&mut self) -> &mut [u8; 20]
pub fn as_fixed_bytes_mut(&mut self) -> &mut [u8; 20]
Extracts a reference to the byte array containing the entire fixed hash.
Sourcepub const fn to_fixed_bytes(self) -> [u8; 20]
pub const fn to_fixed_bytes(self) -> [u8; 20]
Returns the inner bytes array.
Sourcepub fn as_mut_ptr(&mut self) -> *mut u8
pub fn as_mut_ptr(&mut self) -> *mut u8
Returns a mutable raw pointer to the value.
Sourcepub fn assign_from_slice(&mut self, src: &[u8])
pub fn assign_from_slice(&mut self, src: &[u8])
Sourcepub fn from_slice(src: &[u8]) -> Self
pub fn from_slice(src: &[u8]) -> Self
Trait Implementations§
Source§impl<'r> BitAndAssign<&'r H160> for H160
impl<'r> BitAndAssign<&'r H160> for H160
Source§fn bitand_assign(&mut self, rhs: &'r H160)
fn bitand_assign(&mut self, rhs: &'r H160)
Performs the
&=
operation. Read moreSource§impl BitAndAssign for H160
impl BitAndAssign for H160
Source§fn bitand_assign(&mut self, rhs: H160)
fn bitand_assign(&mut self, rhs: H160)
Performs the
&=
operation. Read moreSource§impl<'r> BitOrAssign<&'r H160> for H160
impl<'r> BitOrAssign<&'r H160> for H160
Source§fn bitor_assign(&mut self, rhs: &'r H160)
fn bitor_assign(&mut self, rhs: &'r H160)
Performs the
|=
operation. Read moreSource§impl BitOrAssign for H160
impl BitOrAssign for H160
Source§fn bitor_assign(&mut self, rhs: H160)
fn bitor_assign(&mut self, rhs: H160)
Performs the
|=
operation. Read moreSource§impl<'r> BitXorAssign<&'r H160> for H160
impl<'r> BitXorAssign<&'r H160> for H160
Source§fn bitxor_assign(&mut self, rhs: &'r H160)
fn bitxor_assign(&mut self, rhs: &'r H160)
Performs the
^=
operation. Read moreSource§impl BitXorAssign for H160
impl BitXorAssign for H160
Source§fn bitxor_assign(&mut self, rhs: H160)
fn bitxor_assign(&mut self, rhs: H160)
Performs the
^=
operation. Read moreSource§impl Decode for H160
impl Decode for H160
Source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy,
) -> Result<Self, Error>
fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy, ) -> Result<Self, Error>
Attempt to deserialise the value from input.
Source§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
Source§impl Encode for H160
impl Encode for H160
Source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
If possible give a hint of expected size of the encoding. Read more
Source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy,
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy, )
Convert self to a slice and append it to the destination.
Source§fn using_encoded<__CodecOutputReturn, __CodecUsingEncodedCallback: FnOnce(&[u8]) -> __CodecOutputReturn>(
&self,
f: __CodecUsingEncodedCallback,
) -> __CodecOutputReturn
fn using_encoded<__CodecOutputReturn, __CodecUsingEncodedCallback: FnOnce(&[u8]) -> __CodecOutputReturn>( &self, f: __CodecUsingEncodedCallback, ) -> __CodecOutputReturn
Convert self to a slice and then invoke the given closure with it.
Source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
Source§impl Ord for H160
impl Ord for H160
Source§impl PartialOrd for H160
impl PartialOrd for H160
impl Copy for H160
impl EncodeLike for H160
impl Eq for H160
Auto Trait Implementations§
impl Freeze for H160
impl RefUnwindSafe for H160
impl Send for H160
impl Sync for H160
impl Unpin for H160
impl UnwindSafe for H160
Blanket Implementations§
Source§impl<T, U> AsByteSlice<T> for U
impl<T, U> AsByteSlice<T> for U
fn as_byte_slice(&self) -> &[u8] ⓘ
Source§impl<T, U> AsMutByteSlice<T> for U
impl<T, U> AsMutByteSlice<T> for U
fn as_mut_byte_slice(&mut self) -> &mut [u8] ⓘ
Source§impl<U> AsMutSliceOf for U
impl<U> AsMutSliceOf for U
fn as_mut_slice_of<T>(&mut self) -> Result<&mut [T], Error>where
T: FromByteSlice,
Source§impl<U> AsSliceOf for U
impl<U> AsSliceOf for U
fn as_slice_of<T>(&self) -> Result<&[T], Error>where
T: FromByteSlice,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
Source§impl<T> SpreadLayout for T
impl<T> SpreadLayout for T
Source§fn read_ledger(key: &[u8], _: &[u8]) -> T
fn read_ledger(key: &[u8], _: &[u8]) -> T
从账本读数据接口
Source§fn write_ledger(&self, key: &[u8], _: &[u8])
fn write_ledger(&self, key: &[u8], _: &[u8])
写入账本数据接口,key为属性名