Struct dharitri_wasm::types::CodeMetadata
source · pub struct CodeMetadata(/* private fields */);
Expand description
Flags concerning smart contract creation and upgrade. Currently always represented as a 2-byte bitfield.
Implementations§
source§impl CodeMetadata
impl CodeMetadata
pub const DEFAULT: CodeMetadata = _
pub const UPGRADEABLE: CodeMetadata = _
pub const PAYABLE: CodeMetadata = _
pub const READABLE: CodeMetadata = _
pub fn is_upgradeable(&self) -> bool
pub fn is_payable(&self) -> bool
pub fn is_readable(&self) -> bool
pub fn as_ptr(&self) -> *const u8
pub fn into_bytes(self) -> [u8; 2]
Trait Implementations§
source§impl<'a, 'b> BitOr<&'b CodeMetadata> for &'a CodeMetadata
impl<'a, 'b> BitOr<&'b CodeMetadata> for &'a CodeMetadata
§type Output = CodeMetadata
type Output = CodeMetadata
The resulting type after applying the
|
operator.source§fn bitor(self, other: &CodeMetadata) -> CodeMetadata
fn bitor(self, other: &CodeMetadata) -> CodeMetadata
Performs the
|
operation. Read moresource§impl BitOr for CodeMetadata
impl BitOr for CodeMetadata
§type Output = CodeMetadata
type Output = CodeMetadata
The resulting type after applying the
|
operator.source§fn bitor(self, other: CodeMetadata) -> CodeMetadata
fn bitor(self, other: CodeMetadata) -> CodeMetadata
Performs the
|
operation. Read moresource§impl BitOrAssign<&CodeMetadata> for CodeMetadata
impl BitOrAssign<&CodeMetadata> for CodeMetadata
source§fn bitor_assign(&mut self, other: &CodeMetadata)
fn bitor_assign(&mut self, other: &CodeMetadata)
Performs the
|=
operation. Read moresource§impl BitOrAssign for CodeMetadata
impl BitOrAssign for CodeMetadata
source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
Performs the
|=
operation. Read moresource§impl Clone for CodeMetadata
impl Clone for CodeMetadata
source§fn clone(&self) -> CodeMetadata
fn clone(&self) -> CodeMetadata
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 moresource§impl NestedDecode for CodeMetadata
impl NestedDecode for CodeMetadata
source§fn dep_decode<I: NestedDecodeInput>(input: &mut I) -> Result<Self, DecodeError>
fn dep_decode<I: NestedDecodeInput>(input: &mut I) -> Result<Self, DecodeError>
Attempt to deserialise the value from input,
using the format of an object nested inside another structure.
In case of success returns the deserialized value and the number of bytes consumed during the operation.
source§fn dep_decode_or_exit<I: NestedDecodeInput, ExitCtx: Clone>(
input: &mut I,
c: ExitCtx,
exit: fn(_: ExitCtx, _: DecodeError) -> !
) -> Self
fn dep_decode_or_exit<I: NestedDecodeInput, ExitCtx: Clone>( input: &mut I, c: ExitCtx, exit: fn(_: ExitCtx, _: DecodeError) -> ! ) -> Self
Version of
top_decode
that exits quickly in case of error.
Its purpose is to create smaller implementations
in cases where the application is supposed to exit directly on decode error.source§impl NestedEncode for CodeMetadata
impl NestedEncode for CodeMetadata
source§fn dep_encode<O: NestedEncodeOutput>(
&self,
dest: &mut O
) -> Result<(), EncodeError>
fn dep_encode<O: NestedEncodeOutput>( &self, dest: &mut O ) -> Result<(), EncodeError>
NestedEncode to output, using the format of an object nested inside another structure.
Does not provide compact version.
source§fn dep_encode_or_exit<O: NestedEncodeOutput, ExitCtx: Clone>(
&self,
dest: &mut O,
c: ExitCtx,
exit: fn(_: ExitCtx, _: EncodeError) -> !
)
fn dep_encode_or_exit<O: NestedEncodeOutput, ExitCtx: Clone>( &self, dest: &mut O, c: ExitCtx, exit: fn(_: ExitCtx, _: EncodeError) -> ! )
Version of
top_decode
that exits quickly in case of error.
Its purpose is to create smaller implementations
in cases where the application is supposed to exit directly on decode error.source§impl PartialEq for CodeMetadata
impl PartialEq for CodeMetadata
source§fn eq(&self, other: &CodeMetadata) -> bool
fn eq(&self, other: &CodeMetadata) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl TopDecode for CodeMetadata
impl TopDecode for CodeMetadata
source§fn top_decode<I: TopDecodeInput>(input: I) -> Result<Self, DecodeError>
fn top_decode<I: TopDecodeInput>(input: I) -> Result<Self, DecodeError>
Attempt to deserialize the value from input.
source§fn top_decode_or_exit<I: TopDecodeInput, ExitCtx: Clone>(
input: I,
c: ExitCtx,
exit: fn(_: ExitCtx, _: DecodeError) -> !
) -> Self
fn top_decode_or_exit<I: TopDecodeInput, ExitCtx: Clone>( input: I, c: ExitCtx, exit: fn(_: ExitCtx, _: DecodeError) -> ! ) -> Self
Version of
top_decode
that exits quickly in case of error.
Its purpose is to create smaller implementations
in cases where the application is supposed to exit directly on decode error.source§impl TopEncode for CodeMetadata
impl TopEncode for CodeMetadata
source§fn top_encode<O: TopEncodeOutput>(&self, output: O) -> Result<(), EncodeError>
fn top_encode<O: TopEncodeOutput>(&self, output: O) -> Result<(), EncodeError>
Attempt to serialize the value to ouput.
source§fn top_encode_or_exit<O: TopEncodeOutput, ExitCtx: Clone>(
&self,
output: O,
c: ExitCtx,
exit: fn(_: ExitCtx, _: EncodeError) -> !
)
fn top_encode_or_exit<O: TopEncodeOutput, ExitCtx: Clone>( &self, output: O, c: ExitCtx, exit: fn(_: ExitCtx, _: EncodeError) -> ! )
Version of
top_decode
that exits quickly in case of error.
Its purpose is to create smaller bytecode implementations
in cases where the application is supposed to exit directly on decode error.source§impl TypeAbi for CodeMetadata
impl TypeAbi for CodeMetadata
fn type_name() -> String
source§fn provide_type_descriptions<TDC: TypeDescriptionContainer>(
accumulator: &mut TDC
)
fn provide_type_descriptions<TDC: TypeDescriptionContainer>( accumulator: &mut TDC )
A type can provide more than its own description.
For instance, a struct can also provide the descriptions of the type of its fields.
TypeAbi doesn’t care for the exact accumulator type,
which is abstracted by the TypeDescriptionContainer trait.
impl Copy for CodeMetadata
impl StructuralPartialEq for CodeMetadata
Auto Trait Implementations§
impl RefUnwindSafe for CodeMetadata
impl Send for CodeMetadata
impl Sync for CodeMetadata
impl Unpin for CodeMetadata
impl UnwindSafe for CodeMetadata
Blanket Implementations§
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