#[repr(transparent)]pub struct ContractType(pub i32);Expand description
The execution environment for a contract.
Discriminant 0 is retired. It selected an earlier contract runtime, which was removed once RV32 became the only deployable execution environment. Do not reuse the value: old encodings that carry it must fail to parse rather than silently decode as a live contract type.
Tuple Fields§
§0: i32Implementations§
Source§impl ContractType
impl ContractType
Sourcepub const kNative: ContractType
pub const kNative: ContractType
Precompiled native contract implemented natively by the node.
Used for system contracts like the native token. Cheaper to invoke than a deployed RV32 contract, but users cannot deploy new ones.
Sourcepub const kMockTest: ContractType
pub const kMockTest: ContractType
Mock contract for local testing.
Never deployed on-chain; exists only in the test harness.
Sourcepub const kRv32: ContractType
pub const kRv32: ContractType
RiscV contract executed in the RV32 VM.
This is the standard contract type for user-deployed contracts.
Trait Implementations§
Source§impl Clone for ContractType
impl Clone for ContractType
Source§fn clone(&self) -> ContractType
fn clone(&self) -> ContractType
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ConstMaxSize for ContractType
impl ConstMaxSize for ContractType
Source§impl ConstMaxSize for ContractType
impl ConstMaxSize for ContractType
impl Copy for ContractType
Source§impl Debug for ContractType
impl Debug for ContractType
Source§impl Display for ContractType
Available on crate feature std only.
impl Display for ContractType
Available on crate feature
std only.impl EncodesAs<ContractType> for ContractType
impl Eq for ContractType
Source§impl From<i32> for ContractType
impl From<i32> for ContractType
Source§fn from(v: i32) -> ContractType
fn from(v: i32) -> ContractType
Converts to this type from the input type.
Source§impl Hash for ContractType
impl Hash for ContractType
Source§impl JsonSchema for ContractType
impl JsonSchema for ContractType
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl Ord for ContractType
impl Ord for ContractType
Source§fn cmp(&self, other: &ContractType) -> Ordering
fn cmp(&self, other: &ContractType) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for ContractType
impl PartialEq for ContractType
Source§impl PartialOrd for ContractType
impl PartialOrd for ContractType
Source§impl<'_r> ReadXDR<'_r> for ContractType
impl<'_r> ReadXDR<'_r> for ContractType
Source§fn read_xdr<R>(r: &mut R) -> Result<ContractType, ReadError>where
R: Reader<'_r>,
fn read_xdr<R>(r: &mut R) -> Result<ContractType, ReadError>where
R: Reader<'_r>,
Reads an XDR value from the reader. Read more
Source§fn read_xdr_in_place<R, '__xdrs_s>(
r: &mut R,
__xdrs_slot: Slot<'__xdrs_s, ContractType>,
) -> Result<Init<'__xdrs_s, ContractType>, ReadError>where
R: Reader<'_r>,
fn read_xdr_in_place<R, '__xdrs_s>(
r: &mut R,
__xdrs_slot: Slot<'__xdrs_s, ContractType>,
) -> Result<Init<'__xdrs_s, ContractType>, ReadError>where
R: Reader<'_r>,
Reads an XDR value directly into
slot, without first building it
on the stack. Read moreimpl StructuralPartialEq for ContractType
Source§impl WriteXDR for ContractType
impl WriteXDR for ContractType
Source§fn write_xdr<F, W>(&self, w: &mut W) -> Result<(), WriteError>where
W: Writer<F>,
fn write_xdr<F, W>(&self, w: &mut W) -> Result<(), WriteError>where
W: Writer<F>,
Writes this value as XDR data to the writer. Read more
Source§unsafe fn write_xdr_unchecked<F, W>(&self, w: &mut W)where
W: WriterUnchecked<F>,
unsafe fn write_xdr_unchecked<F, W>(&self, w: &mut W)where
W: WriterUnchecked<F>,
Writes this value as XDR data to the writer, without runtime checks. Read more
Auto Trait Implementations§
impl Freeze for ContractType
impl RefUnwindSafe for ContractType
impl Send for ContractType
impl Sync for ContractType
impl Unpin for ContractType
impl UnsafeUnpin for ContractType
impl UnwindSafe for ContractType
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