Struct gstd::ReservationId
pub struct ReservationId(/* private fields */);
Expand description
Reservation identifier.
The identifier is used to reserve and unreserve gas amount for program execution later.
Implementations§
§impl ReservationId
impl ReservationId
pub const fn new(array: [u8; 32]) -> ReservationId
pub const fn new(array: [u8; 32]) -> ReservationId
Creates a new ReservationId
from a 32-byte array.
§impl ReservationId
impl ReservationId
pub const fn zero() -> ReservationId
pub const fn zero() -> ReservationId
Creates a new zero ReservationId
.
§impl ReservationId
impl ReservationId
pub fn into_bytes(self) -> [u8; 32]
pub fn into_bytes(self) -> [u8; 32]
Returns ReservationId
as bytes array.
Trait Implementations§
§impl<__AsMutT> AsMut<__AsMutT> for ReservationId
impl<__AsMutT> AsMut<__AsMutT> for ReservationId
§fn as_mut(&mut self) -> &mut __AsMutT
fn as_mut(&mut self) -> &mut __AsMutT
Converts this type into a mutable reference of the (usually inferred) input type.
§impl<__AsRefT> AsRef<__AsRefT> for ReservationId
impl<__AsRefT> AsRef<__AsRefT> for ReservationId
§impl Clone for ReservationId
impl Clone for ReservationId
§fn clone(&self) -> ReservationId
fn clone(&self) -> ReservationId
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl Debug for ReservationId
impl Debug for ReservationId
§impl Decode for ReservationId
impl Decode for ReservationId
§fn decode<__CodecInputEdqy>(
__codec_input_edqy: &mut __CodecInputEdqy,
) -> Result<ReservationId, Error>where
__CodecInputEdqy: Input,
fn decode<__CodecInputEdqy>(
__codec_input_edqy: &mut __CodecInputEdqy,
) -> Result<ReservationId, Error>where
__CodecInputEdqy: Input,
Attempt to deserialise the value from input.
§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
§fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
Attempt to skip the encoded value from input. Read more
§fn encoded_fixed_size() -> Option<usize>
fn encoded_fixed_size() -> Option<usize>
Returns the fixed encoded size of the type. Read more
§impl Default for ReservationId
impl Default for ReservationId
§fn default() -> ReservationId
fn default() -> ReservationId
Returns the “default value” for a type. Read more
§impl Display for ReservationId
impl Display for ReservationId
§impl Encode for ReservationId
impl Encode for ReservationId
§fn encode_to<__CodecOutputEdqy>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy,
)where
__CodecOutputEdqy: Output + ?Sized,
fn encode_to<__CodecOutputEdqy>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy,
)where
__CodecOutputEdqy: Output + ?Sized,
Convert self to a slice and append it to the destination.
§fn using_encoded<__CodecOutputReturn, __CodecUsingEncodedCallback>(
&self,
f: __CodecUsingEncodedCallback,
) -> __CodecOutputReturn
fn using_encoded<__CodecOutputReturn, __CodecUsingEncodedCallback>( &self, f: __CodecUsingEncodedCallback, ) -> __CodecOutputReturn
Convert self to a slice and then invoke the given closure with it.
§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
§impl From<[u8; 32]> for ReservationId
impl From<[u8; 32]> for ReservationId
§fn from(original: [u8; 32]) -> ReservationId
fn from(original: [u8; 32]) -> ReservationId
Converts to this type from the input type.
§impl From<H256> for ReservationId
impl From<H256> for ReservationId
§fn from(h256: H256) -> ReservationId
fn from(h256: H256) -> ReservationId
Converts to this type from the input type.
source§impl From<Reservation> for ReservationId
impl From<Reservation> for ReservationId
source§fn from(res: Reservation) -> Self
fn from(res: Reservation) -> Self
Converts to this type from the input type.
§impl From<ReservationId> for [u8; 32]
impl From<ReservationId> for [u8; 32]
§fn from(original: ReservationId) -> [u8; 32]
fn from(original: ReservationId) -> [u8; 32]
Converts to this type from the input type.
§impl From<ReservationId> for H256
impl From<ReservationId> for H256
§fn from(value: ReservationId) -> H256
fn from(value: ReservationId) -> H256
Converts to this type from the input type.
§impl From<u64> for ReservationId
impl From<u64> for ReservationId
§fn from(value: u64) -> ReservationId
fn from(value: u64) -> ReservationId
Converts to this type from the input type.
§impl FromStr for ReservationId
impl FromStr for ReservationId
§type Err = ConversionError
type Err = ConversionError
The associated error which can be returned from parsing.
§fn from_str(s: &str) -> Result<ReservationId, <ReservationId as FromStr>::Err>
fn from_str(s: &str) -> Result<ReservationId, <ReservationId as FromStr>::Err>
Parses a string
s
to return a value of this type. Read more§impl Hash for ReservationId
impl Hash for ReservationId
§impl MaxEncodedLen for ReservationId
impl MaxEncodedLen for ReservationId
§fn max_encoded_len() -> usize
fn max_encoded_len() -> usize
Upper bound, in bytes, of the maximum encoded size of this item.
§impl Ord for ReservationId
impl Ord for ReservationId
§impl PartialEq for ReservationId
impl PartialEq for ReservationId
§impl PartialOrd for ReservationId
impl PartialOrd for ReservationId
source§impl ReservationIdExt for ReservationId
impl ReservationIdExt for ReservationId
§impl TypeInfo for ReservationId
impl TypeInfo for ReservationId
impl Copy for ReservationId
impl EncodeLike for ReservationId
impl Eq for ReservationId
impl StructuralPartialEq for ReservationId
Auto Trait Implementations§
impl Freeze for ReservationId
impl RefUnwindSafe for ReservationId
impl Send for ReservationId
impl Sync for ReservationId
impl Unpin for ReservationId
impl UnwindSafe for ReservationId
Blanket Implementations§
§impl<T, U> AsByteSlice<T> for U
impl<T, U> AsByteSlice<T> for U
fn as_byte_slice(&self) -> &[u8]
§impl<T, U> AsMutByteSlice<T> for U
impl<T, U> AsMutByteSlice<T> for U
fn as_mut_byte_slice(&mut self) -> &mut [u8]
§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,
§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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> KeyedVec for Twhere
T: Codec,
impl<T> KeyedVec for Twhere
T: Codec,
§fn to_keyed_vec(&self, prepend_key: &[u8]) -> Vec<u8>
fn to_keyed_vec(&self, prepend_key: &[u8]) -> Vec<u8>
Return an encoding of
Self
prepended by given slice.source§impl<T> ToHex for T
impl<T> ToHex for T
source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
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) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Upper case
letters are used (e.g. F9B4CA
)