pub struct AccountId(pub [u8; 32]);
Expand description
The default environment AccountId
type.
§Note
This is a mirror of the AccountId
type used in the default configuration
of PALLET contracts.
Tuple Fields§
§0: [u8; 32]
Trait Implementations§
Source§impl Decode for AccountId
impl Decode for AccountId
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 DecodeAsFields for AccountId
impl DecodeAsFields for AccountId
Source§fn decode_as_fields<'info, R: TypeResolver>(
input: &mut &[u8],
fields: &mut dyn FieldIter<'info, R::TypeId>,
types: &'info R,
) -> Result<Self, Error>
fn decode_as_fields<'info, R: TypeResolver>( input: &mut &[u8], fields: &mut dyn FieldIter<'info, R::TypeId>, types: &'info R, ) -> Result<Self, Error>
Given some bytes and some fields denoting their structure, attempt to decode.
Source§impl Encode for AccountId
impl Encode for AccountId
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 EncodeAsFields for AccountId
impl EncodeAsFields for AccountId
Source§fn encode_as_fields_to<ScaleEncodeResolver: TypeResolver>(
&self,
__encode_as_type_fields: &mut dyn FieldIter<'_, ScaleEncodeResolver::TypeId>,
__encode_as_type_types: &ScaleEncodeResolver,
__encode_as_type_out: &mut Vec<u8>,
) -> Result<(), Error>
fn encode_as_fields_to<ScaleEncodeResolver: TypeResolver>( &self, __encode_as_type_fields: &mut dyn FieldIter<'_, ScaleEncodeResolver::TypeId>, __encode_as_type_types: &ScaleEncodeResolver, __encode_as_type_out: &mut Vec<u8>, ) -> Result<(), Error>
Given some fields describing the shape of a type, attempt to encode to that shape.
Source§fn encode_as_fields<R>(
&self,
fields: &mut dyn FieldIter<'_, <R as TypeResolver>::TypeId, Item = Field<'_, <R as TypeResolver>::TypeId>>,
types: &R,
) -> Result<Vec<u8>, Error>where
R: TypeResolver,
fn encode_as_fields<R>(
&self,
fields: &mut dyn FieldIter<'_, <R as TypeResolver>::TypeId, Item = Field<'_, <R as TypeResolver>::TypeId>>,
types: &R,
) -> Result<Vec<u8>, Error>where
R: TypeResolver,
This is a helper function which internally calls
EncodeAsFields::encode_as_fields_to
. Prefer to
implement that instead.Source§impl EncodeAsType for AccountId
impl EncodeAsType for AccountId
Source§fn encode_as_type_to<ScaleEncodeResolver: TypeResolver>(
&self,
__encode_as_type_type_id: &ScaleEncodeResolver::TypeId,
__encode_as_type_types: &ScaleEncodeResolver,
__encode_as_type_out: &mut Vec<u8>,
) -> Result<(), Error>
fn encode_as_type_to<ScaleEncodeResolver: TypeResolver>( &self, __encode_as_type_type_id: &ScaleEncodeResolver::TypeId, __encode_as_type_types: &ScaleEncodeResolver, __encode_as_type_out: &mut Vec<u8>, ) -> Result<(), Error>
Given some
type_id
, types
, a context
and some output target for the SCALE encoded bytes,
attempt to SCALE encode the current value into the type given by type_id
.Source§fn encode_as_type<R>(
&self,
type_id: &<R as TypeResolver>::TypeId,
types: &R,
) -> Result<Vec<u8>, Error>where
R: TypeResolver,
fn encode_as_type<R>(
&self,
type_id: &<R as TypeResolver>::TypeId,
types: &R,
) -> Result<Vec<u8>, Error>where
R: TypeResolver,
This is a helper function which internally calls
EncodeAsType::encode_as_type_to
. Prefer to
implement that instead.Source§impl IntoVisitor for AccountId
impl IntoVisitor for AccountId
Source§type AnyVisitor<ScaleDecodeTypeResolver: TypeResolver> = Visitor<ScaleDecodeTypeResolver>
type AnyVisitor<ScaleDecodeTypeResolver: TypeResolver> = Visitor<ScaleDecodeTypeResolver>
The visitor type used to decode SCALE encoded bytes to
Self
.Source§fn into_visitor<ScaleDecodeTypeResolver: TypeResolver>() -> Self::AnyVisitor<ScaleDecodeTypeResolver>
fn into_visitor<ScaleDecodeTypeResolver: TypeResolver>() -> Self::AnyVisitor<ScaleDecodeTypeResolver>
A means of obtaining this visitor.
Source§impl MaxEncodedLen for AccountId
impl MaxEncodedLen for AccountId
Source§fn max_encoded_len() -> usize
fn max_encoded_len() -> usize
Upper bound, in bytes, of the maximum encoded size of this item.
Source§impl Ord for AccountId
impl Ord for AccountId
Source§impl PartialOrd for AccountId
impl PartialOrd for AccountId
Source§impl<'a> TryFrom<&'a [u8]> for AccountId
impl<'a> TryFrom<&'a [u8]> for AccountId
Source§type Error = TryFromSliceError
type Error = TryFromSliceError
The type returned in the event of a conversion error.
impl Copy for AccountId
impl EncodeLike for AccountId
impl Eq for AccountId
impl StructuralPartialEq for AccountId
Auto Trait Implementations§
impl Freeze for AccountId
impl RefUnwindSafe for AccountId
impl Send for AccountId
impl Sync for AccountId
impl Unpin for AccountId
impl UnwindSafe for AccountId
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> DecodeAsType for Twhere
T: IntoVisitor,
impl<T> DecodeAsType for Twhere
T: IntoVisitor,
fn decode_as_type_maybe_compact<R>(
input: &mut &[u8],
type_id: &<R as TypeResolver>::TypeId,
types: &R,
is_compact: bool,
) -> Result<T, Error>where
R: TypeResolver,
Source§fn decode_as_type<R>(
input: &mut &[u8],
type_id: &<R as TypeResolver>::TypeId,
types: &R,
) -> Result<Self, Error>where
R: TypeResolver,
fn decode_as_type<R>(
input: &mut &[u8],
type_id: &<R as TypeResolver>::TypeId,
types: &R,
) -> Result<Self, Error>where
R: TypeResolver,
Given some input bytes, a
type_id
, and type registry, attempt to decode said bytes into
Self
. Implementations should modify the &mut
reference to the bytes such that any bytes
not used in the course of decoding are still pointed to after decoding is complete.