Struct soroban_env_common::UnimplementedEnv
source · pub struct UnimplementedEnv;
Expand description
A dummy implementation of the Env trait that fails with unimplemented!()
in
all functions. Useful for certain testing scenarios.
Trait Implementations§
source§impl Clone for UnimplementedEnv
impl Clone for UnimplementedEnv
source§fn clone(&self) -> UnimplementedEnv
fn clone(&self) -> UnimplementedEnv
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 Default for UnimplementedEnv
impl Default for UnimplementedEnv
source§fn default() -> UnimplementedEnv
fn default() -> UnimplementedEnv
Returns the “default value” for a type. Read more
source§impl Env for UnimplementedEnv
impl Env for UnimplementedEnv
source§fn log_from_linear_memory(
&self,
_: U32Val,
_: U32Val,
_: U32Val,
_: U32Val
) -> Result<Void, Self::Error>
fn log_from_linear_memory( &self, _: U32Val, _: U32Val, _: U32Val, _: U32Val ) -> Result<Void, Self::Error>
Emit a diagnostic event containing a message and sequence of
Val
s.source§fn get_invoking_contract(&self) -> Result<AddressObject, Self::Error>
fn get_invoking_contract(&self) -> Result<AddressObject, Self::Error>
Get the address object of the contract which invoked the running contract. Traps if the running contract was not invoked by a contract.
source§fn obj_cmp(&self, _: Val, _: Val) -> Result<i64, Self::Error>
fn obj_cmp(&self, _: Val, _: Val) -> Result<i64, Self::Error>
Compare two objects, or at least one object to a non-object, structurally. Returns -1 if a<b, 1 if a>b, or 0 if a==b.
source§fn contract_event(&self, _: VecObject, _: Val) -> Result<Void, Self::Error>
fn contract_event(&self, _: VecObject, _: Val) -> Result<Void, Self::Error>
Records a contract event.
topics
is expected to be a SCVec
with length <= 4 that cannot contain Vec
, Map
, or Bytes
with length > 32.source§fn get_ledger_version(&self) -> Result<U32Val, Self::Error>
fn get_ledger_version(&self) -> Result<U32Val, Self::Error>
Return the protocol version of the current ledger as a u32.
source§fn get_ledger_sequence(&self) -> Result<U32Val, Self::Error>
fn get_ledger_sequence(&self) -> Result<U32Val, Self::Error>
Return the sequence number of the current ledger as a u32.
source§fn get_ledger_timestamp(&self) -> Result<U64Val, Self::Error>
fn get_ledger_timestamp(&self) -> Result<U64Val, Self::Error>
Return the timestamp number of the current ledger as a u64.
source§fn get_current_call_stack(&self) -> Result<VecObject, Self::Error>
fn get_current_call_stack(&self) -> Result<VecObject, Self::Error>
Returns the full call stack from the first contract call to the current one as a vector of vectors, where the inside vector contains the contract id as Hash, and a function as a Symbol.
source§fn fail_with_error(&self, _: Error) -> Result<Void, Self::Error>
fn fail_with_error(&self, _: Error) -> Result<Void, Self::Error>
Causes the currently executing contract to fail immediately with a provided error code, which must be of error-type
ScErrorType::Contract
. Does not actually return.source§fn get_ledger_network_id(&self) -> Result<BytesObject, Self::Error>
fn get_ledger_network_id(&self) -> Result<BytesObject, Self::Error>
Return the network id (sha256 hash of network passphrase) of the current ledger as
Bytes
. The value is always 32 bytes in length.source§fn get_current_contract_address(&self) -> Result<AddressObject, Self::Error>
fn get_current_contract_address(&self) -> Result<AddressObject, Self::Error>
Get the Address object for the current contract.
source§fn obj_from_u64(&self, _: u64) -> Result<U64Object, Self::Error>
fn obj_from_u64(&self, _: u64) -> Result<U64Object, Self::Error>
Convert a
u64
to an object containing a u64
.source§fn obj_to_u64(&self, _: U64Object) -> Result<u64, Self::Error>
fn obj_to_u64(&self, _: U64Object) -> Result<u64, Self::Error>
Convert an object containing a
u64
to a u64
.source§fn obj_from_i64(&self, _: i64) -> Result<I64Object, Self::Error>
fn obj_from_i64(&self, _: i64) -> Result<I64Object, Self::Error>
Convert an
i64
to an object containing an i64
.source§fn obj_to_i64(&self, _: I64Object) -> Result<i64, Self::Error>
fn obj_to_i64(&self, _: I64Object) -> Result<i64, Self::Error>
Convert an object containing an
i64
to an i64
.source§fn obj_from_u128_pieces(
&self,
_: u64,
_: u64
) -> Result<U128Object, Self::Error>
fn obj_from_u128_pieces( &self, _: u64, _: u64 ) -> Result<U128Object, Self::Error>
Convert the high and low 64-bit words of a u128 to an object containing a u128.
source§fn obj_to_u128_lo64(&self, _: U128Object) -> Result<u64, Self::Error>
fn obj_to_u128_lo64(&self, _: U128Object) -> Result<u64, Self::Error>
Extract the low 64 bits from an object containing a u128.
source§fn obj_to_u128_hi64(&self, _: U128Object) -> Result<u64, Self::Error>
fn obj_to_u128_hi64(&self, _: U128Object) -> Result<u64, Self::Error>
Extract the high 64 bits from an object containing a u128.
source§fn obj_from_i128_pieces(
&self,
_: i64,
_: u64
) -> Result<I128Object, Self::Error>
fn obj_from_i128_pieces( &self, _: i64, _: u64 ) -> Result<I128Object, Self::Error>
Convert the high and low 64-bit words of an i128 to an object containing an i128.
source§fn obj_to_i128_lo64(&self, _: I128Object) -> Result<u64, Self::Error>
fn obj_to_i128_lo64(&self, _: I128Object) -> Result<u64, Self::Error>
Extract the low 64 bits from an object containing an i128.
source§fn obj_to_i128_hi64(&self, _: I128Object) -> Result<i64, Self::Error>
fn obj_to_i128_hi64(&self, _: I128Object) -> Result<i64, Self::Error>
Extract the high 64 bits from an object containing an i128.
source§fn obj_from_u256_pieces(
&self,
_: u64,
_: u64,
_: u64,
_: u64
) -> Result<U256Object, Self::Error>
fn obj_from_u256_pieces( &self, _: u64, _: u64, _: u64, _: u64 ) -> Result<U256Object, Self::Error>
Convert the four 64-bit words of a u256 (big-endian) to an object containing a u256.
source§fn u256_val_from_be_bytes(&self, _: BytesObject) -> Result<U256Val, Self::Error>
fn u256_val_from_be_bytes(&self, _: BytesObject) -> Result<U256Val, Self::Error>
Create a U256
Val
from its representation as a byte array in big endian.source§fn u256_val_to_be_bytes(&self, _: U256Val) -> Result<BytesObject, Self::Error>
fn u256_val_to_be_bytes(&self, _: U256Val) -> Result<BytesObject, Self::Error>
Return the memory representation of this U256
Val
as a byte array in big endian byte order.source§fn obj_to_u256_hi_hi(&self, _: U256Object) -> Result<u64, Self::Error>
fn obj_to_u256_hi_hi(&self, _: U256Object) -> Result<u64, Self::Error>
Extract the highest 64-bits (bits 192-255) from an object containing a u256.
source§fn obj_to_u256_hi_lo(&self, _: U256Object) -> Result<u64, Self::Error>
fn obj_to_u256_hi_lo(&self, _: U256Object) -> Result<u64, Self::Error>
Extract bits 128-191 from an object containing a u256.
source§fn obj_to_u256_lo_hi(&self, _: U256Object) -> Result<u64, Self::Error>
fn obj_to_u256_lo_hi(&self, _: U256Object) -> Result<u64, Self::Error>
Extract bits 64-127 from an object containing a u256.
source§fn obj_to_u256_lo_lo(&self, _: U256Object) -> Result<u64, Self::Error>
fn obj_to_u256_lo_lo(&self, _: U256Object) -> Result<u64, Self::Error>
Extract the lowest 64-bits (bits 0-63) from an object containing a u256.
source§fn obj_from_i256_pieces(
&self,
_: i64,
_: u64,
_: u64,
_: u64
) -> Result<I256Object, Self::Error>
fn obj_from_i256_pieces( &self, _: i64, _: u64, _: u64, _: u64 ) -> Result<I256Object, Self::Error>
Convert the four 64-bit words of an i256 (big-endian) to an object containing an i256.
source§fn i256_val_from_be_bytes(&self, _: BytesObject) -> Result<I256Val, Self::Error>
fn i256_val_from_be_bytes(&self, _: BytesObject) -> Result<I256Val, Self::Error>
Create a I256
Val
from its representation as a byte array in big endian.source§fn i256_val_to_be_bytes(&self, _: I256Val) -> Result<BytesObject, Self::Error>
fn i256_val_to_be_bytes(&self, _: I256Val) -> Result<BytesObject, Self::Error>
Return the memory representation of this I256
Val
as a byte array in big endian byte order.source§fn obj_to_i256_hi_hi(&self, _: I256Object) -> Result<i64, Self::Error>
fn obj_to_i256_hi_hi(&self, _: I256Object) -> Result<i64, Self::Error>
Extract the highest 64-bits (bits 192-255) from an object containing an i256.
source§fn obj_to_i256_hi_lo(&self, _: I256Object) -> Result<u64, Self::Error>
fn obj_to_i256_hi_lo(&self, _: I256Object) -> Result<u64, Self::Error>
Extract bits 128-191 from an object containing an i256.
source§fn obj_to_i256_lo_hi(&self, _: I256Object) -> Result<u64, Self::Error>
fn obj_to_i256_lo_hi(&self, _: I256Object) -> Result<u64, Self::Error>
Extract bits 64-127 from an object containing an i256.
source§fn obj_to_i256_lo_lo(&self, _: I256Object) -> Result<u64, Self::Error>
fn obj_to_i256_lo_lo(&self, _: I256Object) -> Result<u64, Self::Error>
Extract the lowest 64-bits (bits 0-63) from an object containing an i256.
source§fn u256_add(&self, _: U256Val, _: U256Val) -> Result<U256Val, Self::Error>
fn u256_add(&self, _: U256Val, _: U256Val) -> Result<U256Val, Self::Error>
Performs checked integer addition. Computes
lhs + rhs
, returning ScError
if overflow occurred. source§fn u256_sub(&self, _: U256Val, _: U256Val) -> Result<U256Val, Self::Error>
fn u256_sub(&self, _: U256Val, _: U256Val) -> Result<U256Val, Self::Error>
Performs checked integer subtraction. Computes
lhs - rhs
, returning ScError
if overflow occurred. source§fn u256_mul(&self, _: U256Val, _: U256Val) -> Result<U256Val, Self::Error>
fn u256_mul(&self, _: U256Val, _: U256Val) -> Result<U256Val, Self::Error>
Performs checked integer multiplication. Computes
lhs * rhs
, returning ScError
if overflow occurred. source§fn u256_div(&self, _: U256Val, _: U256Val) -> Result<U256Val, Self::Error>
fn u256_div(&self, _: U256Val, _: U256Val) -> Result<U256Val, Self::Error>
Performs checked integer division. Computes
lhs / rhs
, returning ScError
if rhs == 0
or overflow occurred. source§fn u256_pow(&self, _: U256Val, _: U32Val) -> Result<U256Val, Self::Error>
fn u256_pow(&self, _: U256Val, _: U32Val) -> Result<U256Val, Self::Error>
Performs checked exponentiation. Computes
lhs.exp(rhs)
, returning ScError
if overflow occurred. source§fn u256_shl(&self, _: U256Val, _: U32Val) -> Result<U256Val, Self::Error>
fn u256_shl(&self, _: U256Val, _: U32Val) -> Result<U256Val, Self::Error>
Performs checked shift left. Computes
lhs << rhs
, returning ScError
if rhs
is larger than or equal to the number of bits in lhs
.source§fn u256_shr(&self, _: U256Val, _: U32Val) -> Result<U256Val, Self::Error>
fn u256_shr(&self, _: U256Val, _: U32Val) -> Result<U256Val, Self::Error>
Performs checked shift right. Computes
lhs >> rhs
, returning ScError
if rhs
is larger than or equal to the number of bits in lhs
.source§fn i256_add(&self, _: I256Val, _: I256Val) -> Result<I256Val, Self::Error>
fn i256_add(&self, _: I256Val, _: I256Val) -> Result<I256Val, Self::Error>
Performs checked integer addition. Computes
lhs + rhs
, returning ScError
if overflow occurred. source§fn i256_sub(&self, _: I256Val, _: I256Val) -> Result<I256Val, Self::Error>
fn i256_sub(&self, _: I256Val, _: I256Val) -> Result<I256Val, Self::Error>
Performs checked integer subtraction. Computes
lhs - rhs
, returning ScError
if overflow occurred. source§fn i256_mul(&self, _: I256Val, _: I256Val) -> Result<I256Val, Self::Error>
fn i256_mul(&self, _: I256Val, _: I256Val) -> Result<I256Val, Self::Error>
Performs checked integer multiplication. Computes
lhs * rhs
, returning ScError
if overflow occurred. source§fn i256_div(&self, _: I256Val, _: I256Val) -> Result<I256Val, Self::Error>
fn i256_div(&self, _: I256Val, _: I256Val) -> Result<I256Val, Self::Error>
Performs checked integer division. Computes
lhs / rhs
, returning ScError
if rhs == 0
or overflow occurred. source§fn i256_pow(&self, _: I256Val, _: U32Val) -> Result<I256Val, Self::Error>
fn i256_pow(&self, _: I256Val, _: U32Val) -> Result<I256Val, Self::Error>
Performs checked exponentiation. Computes
lhs.exp(rhs)
, returning ScError
if overflow occurred. source§fn i256_shl(&self, _: I256Val, _: U32Val) -> Result<I256Val, Self::Error>
fn i256_shl(&self, _: I256Val, _: U32Val) -> Result<I256Val, Self::Error>
Performs checked shift left. Computes
lhs << rhs
, returning ScError
if rhs
is larger than or equal to the number of bits in lhs
.source§fn i256_shr(&self, _: I256Val, _: U32Val) -> Result<I256Val, Self::Error>
fn i256_shr(&self, _: I256Val, _: U32Val) -> Result<I256Val, Self::Error>
Performs checked shift right. Computes
lhs >> rhs
, returning ScError
if rhs
is larger than or equal to the number of bits in lhs
.source§fn timepoint_obj_from_u64(&self, _: u64) -> Result<TimepointObject, Self::Error>
fn timepoint_obj_from_u64(&self, _: u64) -> Result<TimepointObject, Self::Error>
Convert a
u64
to a Timepoint
object.source§fn timepoint_obj_to_u64(&self, _: TimepointObject) -> Result<u64, Self::Error>
fn timepoint_obj_to_u64(&self, _: TimepointObject) -> Result<u64, Self::Error>
Convert a
Timepoint
object to a u64
.source§fn duration_obj_from_u64(&self, _: u64) -> Result<DurationObject, Self::Error>
fn duration_obj_from_u64(&self, _: u64) -> Result<DurationObject, Self::Error>
Convert a
u64
to a Duration
object.source§fn duration_obj_to_u64(&self, _: DurationObject) -> Result<u64, Self::Error>
fn duration_obj_to_u64(&self, _: DurationObject) -> Result<u64, Self::Error>
Convert a
Duration
object a u64
.source§fn map_put(
&self,
_: MapObject,
_: Val,
_: Val
) -> Result<MapObject, Self::Error>
fn map_put( &self, _: MapObject, _: Val, _: Val ) -> Result<MapObject, Self::Error>
Insert a key/value mapping into an existing map, and return the map object handle. If the map already has a mapping for the given key, the previous value is overwritten.
source§fn map_get(&self, _: MapObject, _: Val) -> Result<Val, Self::Error>
fn map_get(&self, _: MapObject, _: Val) -> Result<Val, Self::Error>
Get the value for a key from a map. Traps if key is not found.
source§fn map_del(&self, _: MapObject, _: Val) -> Result<MapObject, Self::Error>
fn map_del(&self, _: MapObject, _: Val) -> Result<MapObject, Self::Error>
Remove a key/value mapping from a map if it exists, traps if doesn’t.
source§fn map_has(&self, _: MapObject, _: Val) -> Result<Bool, Self::Error>
fn map_has(&self, _: MapObject, _: Val) -> Result<Bool, Self::Error>
Test for the presence of a key in a map. Returns Bool.
source§fn map_prev_key(&self, _: MapObject, _: Val) -> Result<Val, Self::Error>
fn map_prev_key(&self, _: MapObject, _: Val) -> Result<Val, Self::Error>
Given a key, find the first key less than itself in the map’s sorted order. If such a key does not exist, return an ScError.
source§fn map_next_key(&self, _: MapObject, _: Val) -> Result<Val, Self::Error>
fn map_next_key(&self, _: MapObject, _: Val) -> Result<Val, Self::Error>
Given a key, find the first key greater than itself in the map’s sorted order. If such a key does not exist, return an ScError.
source§fn map_min_key(&self, _: MapObject) -> Result<Val, Self::Error>
fn map_min_key(&self, _: MapObject) -> Result<Val, Self::Error>
Find the minimum key from a map. If the map is empty, return an ScError.
source§fn map_max_key(&self, _: MapObject) -> Result<Val, Self::Error>
fn map_max_key(&self, _: MapObject) -> Result<Val, Self::Error>
Find the maximum key from a map. If the map is empty, return an ScError.
source§fn map_keys(&self, _: MapObject) -> Result<VecObject, Self::Error>
fn map_keys(&self, _: MapObject) -> Result<VecObject, Self::Error>
Return a new vector containing all the keys in a map. The new vector is ordered in the original map’s key-sorted order.
source§fn map_values(&self, _: MapObject) -> Result<VecObject, Self::Error>
fn map_values(&self, _: MapObject) -> Result<VecObject, Self::Error>
Return a new vector containing all the values in a map. The new vector is ordered in the original map’s key-sorted order.
source§fn map_new_from_linear_memory(
&self,
_: U32Val,
_: U32Val,
_: U32Val
) -> Result<MapObject, Self::Error>
fn map_new_from_linear_memory( &self, _: U32Val, _: U32Val, _: U32Val ) -> Result<MapObject, Self::Error>
Return a new map initialized from a set of input slices given by linear-memory addresses and lengths.
source§fn map_unpack_to_linear_memory(
&self,
_: MapObject,
_: U32Val,
_: U32Val,
_: U32Val
) -> Result<Void, Self::Error>
fn map_unpack_to_linear_memory( &self, _: MapObject, _: U32Val, _: U32Val, _: U32Val ) -> Result<Void, Self::Error>
Copy the Val values of a map, as described by set of input keys, into an array at a given linear-memory address.
source§fn vec_new(&self, _: Val) -> Result<VecObject, Self::Error>
fn vec_new(&self, _: Val) -> Result<VecObject, Self::Error>
Creates a new vector with an optional capacity hint
c
. If c
is Void
, no hint is assumed and the new vector is empty. Otherwise, c
is parsed as a u32
that represents the initial capacity of the new vector.source§fn vec_put(
&self,
_: VecObject,
_: U32Val,
_: Val
) -> Result<VecObject, Self::Error>
fn vec_put( &self, _: VecObject, _: U32Val, _: Val ) -> Result<VecObject, Self::Error>
Update the value at index
i
in the vector. Return the new vector. Trap if the index is out of bounds.source§fn vec_get(&self, _: VecObject, _: U32Val) -> Result<Val, Self::Error>
fn vec_get(&self, _: VecObject, _: U32Val) -> Result<Val, Self::Error>
Returns the element at index
i
of the vector. Traps if the index is out of bound.source§fn vec_del(&self, _: VecObject, _: U32Val) -> Result<VecObject, Self::Error>
fn vec_del(&self, _: VecObject, _: U32Val) -> Result<VecObject, Self::Error>
Delete an element in a vector at index
i
, shifting all elements after it to the left. Return the new vector. Traps if the index is out of bound.source§fn vec_push_front(&self, _: VecObject, _: Val) -> Result<VecObject, Self::Error>
fn vec_push_front(&self, _: VecObject, _: Val) -> Result<VecObject, Self::Error>
Push a value to the front of a vector.
source§fn vec_pop_front(&self, _: VecObject) -> Result<VecObject, Self::Error>
fn vec_pop_front(&self, _: VecObject) -> Result<VecObject, Self::Error>
Removes the first element from the vector and returns the new vector. Traps if original vector is empty.
source§fn vec_push_back(&self, _: VecObject, _: Val) -> Result<VecObject, Self::Error>
fn vec_push_back(&self, _: VecObject, _: Val) -> Result<VecObject, Self::Error>
Appends an element to the back of the vector.
source§fn vec_pop_back(&self, _: VecObject) -> Result<VecObject, Self::Error>
fn vec_pop_back(&self, _: VecObject) -> Result<VecObject, Self::Error>
Removes the last element from the vector and returns the new vector. Traps if original vector is empty.
source§fn vec_front(&self, _: VecObject) -> Result<Val, Self::Error>
fn vec_front(&self, _: VecObject) -> Result<Val, Self::Error>
Return the first element in the vector. Traps if the vector is empty
source§fn vec_back(&self, _: VecObject) -> Result<Val, Self::Error>
fn vec_back(&self, _: VecObject) -> Result<Val, Self::Error>
Return the last element in the vector. Traps if the vector is empty
source§fn vec_insert(
&self,
_: VecObject,
_: U32Val,
_: Val
) -> Result<VecObject, Self::Error>
fn vec_insert( &self, _: VecObject, _: U32Val, _: Val ) -> Result<VecObject, Self::Error>
Inserts an element at index
i
within the vector, shifting all elements after it to the right. Traps if the index is out of boundsource§fn vec_append(
&self,
_: VecObject,
_: VecObject
) -> Result<VecObject, Self::Error>
fn vec_append( &self, _: VecObject, _: VecObject ) -> Result<VecObject, Self::Error>
Clone the vector
v1
, then moves all the elements of vector v2
into it. Return the new vector. Traps if number of elements in the vector overflows a u32.source§fn vec_slice(
&self,
_: VecObject,
_: U32Val,
_: U32Val
) -> Result<VecObject, Self::Error>
fn vec_slice( &self, _: VecObject, _: U32Val, _: U32Val ) -> Result<VecObject, Self::Error>
Copy the elements from
start
index until end
index, exclusive, in the vector and create a new vector from it. Return the new vector. Traps if the index is out of bound.source§fn vec_first_index_of(&self, _: VecObject, _: Val) -> Result<Val, Self::Error>
fn vec_first_index_of(&self, _: VecObject, _: Val) -> Result<Val, Self::Error>
Get the index of the first occurrence of a given element in the vector. Returns the u32 index of the value if it’s there. Otherwise, it returns
Void
.source§fn vec_last_index_of(&self, _: VecObject, _: Val) -> Result<Val, Self::Error>
fn vec_last_index_of(&self, _: VecObject, _: Val) -> Result<Val, Self::Error>
Get the index of the last occurrence of a given element in the vector. Returns the u32 index of the value if it’s there. Otherwise, it returns
Void
.source§fn vec_binary_search(&self, _: VecObject, _: Val) -> Result<u64, Self::Error>
fn vec_binary_search(&self, _: VecObject, _: Val) -> Result<u64, Self::Error>
Binary search a sorted vector for a given element. If it exists, the high-32 bits of the return value is 0x0001 and the low-32 bits contain the u32 index of the element. If it does not exist, the high-32 bits of the return value is 0x0000 and the low-32 bits contain the u32 index at which the element would need to be inserted into the vector to maintain sorted order.
source§fn vec_new_from_linear_memory(
&self,
_: U32Val,
_: U32Val
) -> Result<VecObject, Self::Error>
fn vec_new_from_linear_memory( &self, _: U32Val, _: U32Val ) -> Result<VecObject, Self::Error>
Return a new vec initialized from an input slice of Vals given by a linear-memory address and length.
source§fn vec_unpack_to_linear_memory(
&self,
_: VecObject,
_: U32Val,
_: U32Val
) -> Result<Void, Self::Error>
fn vec_unpack_to_linear_memory( &self, _: VecObject, _: U32Val, _: U32Val ) -> Result<Void, Self::Error>
Copy the Vals of a vec into an array at a given linear-memory address.
source§fn put_contract_data(
&self,
_: Val,
_: Val,
_: StorageType,
_: Val
) -> Result<Void, Self::Error>
fn put_contract_data( &self, _: Val, _: Val, _: StorageType, _: Val ) -> Result<Void, Self::Error>
If
f
is Void
, then there will be no changes to flags for an existing entry, and none will be set if this is a new entry. Otherwise, f
is parsed as a u32
. If the value is 0, then all flags are cleared. If it’s not 0, then flags will be set to the passed in value.fn has_contract_data(&self, _: Val, _: StorageType) -> Result<Bool, Self::Error>
fn get_contract_data(&self, _: Val, _: StorageType) -> Result<Val, Self::Error>
fn del_contract_data(&self, _: Val, _: StorageType) -> Result<Void, Self::Error>
source§fn create_contract(
&self,
_: AddressObject,
_: BytesObject,
_: BytesObject
) -> Result<AddressObject, Self::Error>
fn create_contract( &self, _: AddressObject, _: BytesObject, _: BytesObject ) -> Result<AddressObject, Self::Error>
Creates the contract instance on behalf of
deployer
. deployer
must authorize this call via Soroban auth framework, i.e. this calls deployer.require_auth
with respective arguments. wasm_hash
must be a hash of the contract code that has already been uploaded on this network. salt
is used to create a unique contract id. Returns the address of the created contract.source§fn create_asset_contract(
&self,
_: BytesObject
) -> Result<AddressObject, Self::Error>
fn create_asset_contract( &self, _: BytesObject ) -> Result<AddressObject, Self::Error>
Creates the instance of Stellar Asset contract corresponding to the provided asset.
serialized_asset
is stellar::Asset
XDR serialized to bytes format. Returns the address of the created contract.source§fn upload_wasm(&self, _: BytesObject) -> Result<BytesObject, Self::Error>
fn upload_wasm(&self, _: BytesObject) -> Result<BytesObject, Self::Error>
Uploads provided
wasm
bytecode to the network and returns its identifier (SHA-256 hash). No-op in case if the same Wasm object already exists.source§fn update_current_contract_wasm(
&self,
_: BytesObject
) -> Result<Void, Self::Error>
fn update_current_contract_wasm( &self, _: BytesObject ) -> Result<Void, Self::Error>
Replaces the executable of the current contract with the provided Wasm code identified by a hash. Wasm entry corresponding to the hash has to already be present in the ledger. The update happens only after the current contract invocation has successfully finished, so this can be safely called in the middle of a function.
source§fn bump_contract_data(
&self,
_: Val,
_: StorageType,
_: U32Val
) -> Result<Void, Self::Error>
fn bump_contract_data( &self, _: Val, _: StorageType, _: U32Val ) -> Result<Void, Self::Error>
Bumps the expiration ledger of the key specified so the entry will live for
min
ledgers from now. If the current expiration ledger is already large enough to live at least min
more ledgers, then nothing happens.source§fn bump_current_contract_instance_and_code(
&self,
_: U32Val
) -> Result<Void, Self::Error>
fn bump_current_contract_instance_and_code( &self, _: U32Val ) -> Result<Void, Self::Error>
Bumps the expiration ledger the current contract instance and code (if applicable), so they will live for
min
ledgers from now. If the current expiration ledger is already large enough (>= last closed ledger + min
more ledgers), it is untouched.source§fn get_contract_id(
&self,
_: AddressObject,
_: BytesObject
) -> Result<AddressObject, Self::Error>
fn get_contract_id( &self, _: AddressObject, _: BytesObject ) -> Result<AddressObject, Self::Error>
Get the id of a contract without creating it.
deployer
is address of the contract deployer. salt
is used to create a unique contract id. Returns the address of the would-be contract.source§fn get_asset_contract_id(
&self,
_: BytesObject
) -> Result<AddressObject, Self::Error>
fn get_asset_contract_id( &self, _: BytesObject ) -> Result<AddressObject, Self::Error>
Get the id of the Stellar Asset contract corresponding to the provided asset without creating the instance.
serialized_asset
is stellar::Asset
XDR serialized to bytes format. Returns the address of the would-be asset contract.source§fn call(
&self,
_: AddressObject,
_: Symbol,
_: VecObject
) -> Result<Val, Self::Error>
fn call( &self, _: AddressObject, _: Symbol, _: VecObject ) -> Result<Val, Self::Error>
Calls a function in another contract with arguments contained in vector
args
. If the call is successful, returns the result of the called function. Traps otherwise.source§fn try_call(
&self,
_: AddressObject,
_: Symbol,
_: VecObject
) -> Result<Val, Self::Error>
fn try_call( &self, _: AddressObject, _: Symbol, _: VecObject ) -> Result<Val, Self::Error>
Calls a function in another contract with arguments contained in vector
args
, returning either the result of the called function or an ScError if the called function failed.source§fn serialize_to_bytes(&self, _: Val) -> Result<BytesObject, Self::Error>
fn serialize_to_bytes(&self, _: Val) -> Result<BytesObject, Self::Error>
Serializes an (SC)Val into XDR opaque
Bytes
object.source§fn deserialize_from_bytes(&self, _: BytesObject) -> Result<Val, Self::Error>
fn deserialize_from_bytes(&self, _: BytesObject) -> Result<Val, Self::Error>
Deserialize a
Bytes
object to get back the (SC)Val.source§fn bytes_copy_to_linear_memory(
&self,
_: BytesObject,
_: U32Val,
_: U32Val,
_: U32Val
) -> Result<Void, Self::Error>
fn bytes_copy_to_linear_memory( &self, _: BytesObject, _: U32Val, _: U32Val, _: U32Val ) -> Result<Void, Self::Error>
Copies a slice of bytes from a
Bytes
object specified at offset b_pos
with length len
into the linear memory at position lm_pos
. Traps if either the Bytes
object or the linear memory doesn’t have enough bytes.source§fn bytes_copy_from_linear_memory(
&self,
_: BytesObject,
_: U32Val,
_: U32Val,
_: U32Val
) -> Result<BytesObject, Self::Error>
fn bytes_copy_from_linear_memory( &self, _: BytesObject, _: U32Val, _: U32Val, _: U32Val ) -> Result<BytesObject, Self::Error>
Copies a segment of the linear memory specified at position
lm_pos
with length len
, into a Bytes
object at offset b_pos
. The Bytes
object may grow in size to accommodate the new bytes. Traps if the linear memory doesn’t have enough bytes.source§fn bytes_new_from_linear_memory(
&self,
_: U32Val,
_: U32Val
) -> Result<BytesObject, Self::Error>
fn bytes_new_from_linear_memory( &self, _: U32Val, _: U32Val ) -> Result<BytesObject, Self::Error>
Constructs a new
Bytes
object initialized with bytes copied from a linear memory slice specified at position lm_pos
with length len
.source§fn bytes_put(
&self,
_: BytesObject,
_: U32Val,
_: U32Val
) -> Result<BytesObject, Self::Error>
fn bytes_put( &self, _: BytesObject, _: U32Val, _: U32Val ) -> Result<BytesObject, Self::Error>
Update the value at index
i
in the Bytes
object. Return the new Bytes
. Trap if the index is out of bounds.source§fn bytes_get(&self, _: BytesObject, _: U32Val) -> Result<U32Val, Self::Error>
fn bytes_get(&self, _: BytesObject, _: U32Val) -> Result<U32Val, Self::Error>
Returns the element at index
i
of the Bytes
object. Traps if the index is out of bound.source§fn bytes_del(
&self,
_: BytesObject,
_: U32Val
) -> Result<BytesObject, Self::Error>
fn bytes_del( &self, _: BytesObject, _: U32Val ) -> Result<BytesObject, Self::Error>
Delete an element in a
Bytes
object at index i
, shifting all elements after it to the left. Return the new Bytes
. Traps if the index is out of bound.source§fn bytes_len(&self, _: BytesObject) -> Result<U32Val, Self::Error>
fn bytes_len(&self, _: BytesObject) -> Result<U32Val, Self::Error>
Returns length of the
Bytes
object.source§fn bytes_push(
&self,
_: BytesObject,
_: U32Val
) -> Result<BytesObject, Self::Error>
fn bytes_push( &self, _: BytesObject, _: U32Val ) -> Result<BytesObject, Self::Error>
Appends an element to the back of the
Bytes
object.source§fn bytes_pop(&self, _: BytesObject) -> Result<BytesObject, Self::Error>
fn bytes_pop(&self, _: BytesObject) -> Result<BytesObject, Self::Error>
Removes the last element from the
Bytes
object and returns the new Bytes
. Traps if original Bytes
is empty.source§fn bytes_front(&self, _: BytesObject) -> Result<U32Val, Self::Error>
fn bytes_front(&self, _: BytesObject) -> Result<U32Val, Self::Error>
Return the first element in the
Bytes
object. Traps if the Bytes
is emptysource§fn bytes_back(&self, _: BytesObject) -> Result<U32Val, Self::Error>
fn bytes_back(&self, _: BytesObject) -> Result<U32Val, Self::Error>
Return the last element in the
Bytes
object. Traps if the Bytes
is emptysource§fn bytes_insert(
&self,
_: BytesObject,
_: U32Val,
_: U32Val
) -> Result<BytesObject, Self::Error>
fn bytes_insert( &self, _: BytesObject, _: U32Val, _: U32Val ) -> Result<BytesObject, Self::Error>
Inserts an element at index
i
within the Bytes
object, shifting all elements after it to the right. Traps if the index is out of boundsource§fn bytes_append(
&self,
_: BytesObject,
_: BytesObject
) -> Result<BytesObject, Self::Error>
fn bytes_append( &self, _: BytesObject, _: BytesObject ) -> Result<BytesObject, Self::Error>
Clone the
Bytes
object b1
, then moves all the elements of Bytes
object b2
into it. Return the new Bytes
. Traps if its length overflows a u32.source§fn bytes_slice(
&self,
_: BytesObject,
_: U32Val,
_: U32Val
) -> Result<BytesObject, Self::Error>
fn bytes_slice( &self, _: BytesObject, _: U32Val, _: U32Val ) -> Result<BytesObject, Self::Error>
Copies the elements from
start
index until end
index, exclusive, in the Bytes
object and creates a new Bytes
from it. Returns the new Bytes
. Traps if the index is out of bound.source§fn string_copy_to_linear_memory(
&self,
_: StringObject,
_: U32Val,
_: U32Val,
_: U32Val
) -> Result<Void, Self::Error>
fn string_copy_to_linear_memory( &self, _: StringObject, _: U32Val, _: U32Val, _: U32Val ) -> Result<Void, Self::Error>
Copies a slice of bytes from a
String
object specified at offset s_pos
with length len
into the linear memory at position lm_pos
. Traps if either the String
object or the linear memory doesn’t have enough bytes.source§fn symbol_copy_to_linear_memory(
&self,
_: SymbolObject,
_: U32Val,
_: U32Val,
_: U32Val
) -> Result<Void, Self::Error>
fn symbol_copy_to_linear_memory( &self, _: SymbolObject, _: U32Val, _: U32Val, _: U32Val ) -> Result<Void, Self::Error>
Copies a slice of bytes from a
Symbol
object specified at offset s_pos
with length len
into the linear memory at position lm_pos
. Traps if either the String
object or the linear memory doesn’t have enough bytes.source§fn string_new_from_linear_memory(
&self,
_: U32Val,
_: U32Val
) -> Result<StringObject, Self::Error>
fn string_new_from_linear_memory( &self, _: U32Val, _: U32Val ) -> Result<StringObject, Self::Error>
Constructs a new
String
object initialized with bytes copied from a linear memory slice specified at position lm_pos
with length len
.source§fn symbol_new_from_linear_memory(
&self,
_: U32Val,
_: U32Val
) -> Result<SymbolObject, Self::Error>
fn symbol_new_from_linear_memory( &self, _: U32Val, _: U32Val ) -> Result<SymbolObject, Self::Error>
Constructs a new
Symbol
object initialized with bytes copied from a linear memory slice specified at position lm_pos
with length len
.source§fn string_len(&self, _: StringObject) -> Result<U32Val, Self::Error>
fn string_len(&self, _: StringObject) -> Result<U32Val, Self::Error>
Returns length of the
String
object.source§fn symbol_len(&self, _: SymbolObject) -> Result<U32Val, Self::Error>
fn symbol_len(&self, _: SymbolObject) -> Result<U32Val, Self::Error>
Returns length of the
Symbol
object.source§fn symbol_index_in_linear_memory(
&self,
_: Symbol,
_: U32Val,
_: U32Val
) -> Result<U32Val, Self::Error>
fn symbol_index_in_linear_memory( &self, _: Symbol, _: U32Val, _: U32Val ) -> Result<U32Val, Self::Error>
Return the index of a Symbol in an array of linear-memory byte-slices, or trap if not found.
fn compute_hash_sha256( &self, _: BytesObject ) -> Result<BytesObject, Self::Error>
fn verify_sig_ed25519( &self, _: BytesObject, _: BytesObject, _: BytesObject ) -> Result<Void, Self::Error>
source§fn compute_hash_keccak256(
&self,
_: BytesObject
) -> Result<BytesObject, Self::Error>
fn compute_hash_keccak256( &self, _: BytesObject ) -> Result<BytesObject, Self::Error>
Returns the keccak256 hash of given input bytes.
source§fn recover_key_ecdsa_secp256k1(
&self,
_: BytesObject,
_: BytesObject,
_: U32Val
) -> Result<BytesObject, Self::Error>
fn recover_key_ecdsa_secp256k1( &self, _: BytesObject, _: BytesObject, _: U32Val ) -> Result<BytesObject, Self::Error>
Recovers the SEC-1-encoded ECDSA secp256k1 public key that produced a given 64-byte signature over a given 32-byte message digest, for a given recovery_id byte.
source§fn require_auth_for_args(
&self,
_: AddressObject,
_: VecObject
) -> Result<Void, Self::Error>
fn require_auth_for_args( &self, _: AddressObject, _: VecObject ) -> Result<Void, Self::Error>
Checks if the address has authorized the invocation of the current contract function with the provided arguments. Traps if the invocation hasn’t been authorized.
source§fn require_auth(&self, _: AddressObject) -> Result<Void, Self::Error>
fn require_auth(&self, _: AddressObject) -> Result<Void, Self::Error>
Checks if the address has authorized the invocation of the current contract function with all the arguments of the invocation. Traps if the invocation hasn’t been authorized.
source§fn account_public_key_to_address(
&self,
_: BytesObject
) -> Result<AddressObject, Self::Error>
fn account_public_key_to_address( &self, _: BytesObject ) -> Result<AddressObject, Self::Error>
Converts a provided 32-byte Stellar account public key to the corresponding address. This is only useful in the context of cross-chain interoperability. Prefer directly using the Address objects whenever possible.
source§fn contract_id_to_address(
&self,
_: BytesObject
) -> Result<AddressObject, Self::Error>
fn contract_id_to_address( &self, _: BytesObject ) -> Result<AddressObject, Self::Error>
Converts a provided 32-byte contract identifier to a corresponding Address object.
source§fn address_to_account_public_key(
&self,
_: AddressObject
) -> Result<Val, Self::Error>
fn address_to_account_public_key( &self, _: AddressObject ) -> Result<Val, Self::Error>
Returns the 32-byte public key of the Stellar account corresponding to the provided Address object. If the Address doesn’t belong to an account, returns Val corresponding to the unit type (
()
).source§fn address_to_contract_id(&self, _: AddressObject) -> Result<Val, Self::Error>
fn address_to_contract_id(&self, _: AddressObject) -> Result<Val, Self::Error>
Returns the 32-byte contract identifier corresponding to the provided Address object. If the Address doesn’t belong to an account, returns Val corresponding to the unit type (
()
).Authorizes sub-contract calls for the next contract call on behalf of the current contract. Every entry in the argument vector corresponds to
InvokerContractAuthEntry
contract type that authorizes a tree of require_auth
calls on behalf of the current contract. The entries must not contain any authorizations for the direct contract call, i.e. if current contract needs to call contract function F1 that calls function F2 both of which require auth, only F2 should be present in auth_entries
.source§fn dummy0(&self) -> Result<Val, Self::Error>
fn dummy0(&self) -> Result<Val, Self::Error>
A dummy function taking 0 arguments and performs no-op. This function is for test purpose only, for measuring the roundtrip cost of invoking a host function, i.e. host->Vm->host.
source§fn prng_reseed(&self, _: BytesObject) -> Result<Void, Self::Error>
fn prng_reseed(&self, _: BytesObject) -> Result<Void, Self::Error>
Reseed the frame-local PRNG with a given BytesObject, which should be 32 bytes long.
source§fn prng_bytes_new(&self, _: U32Val) -> Result<BytesObject, Self::Error>
fn prng_bytes_new(&self, _: U32Val) -> Result<BytesObject, Self::Error>
Construct a new BytesObject of the given length filled with bytes drawn from the frame-local PRNG.
source§impl EnvBase for UnimplementedEnv
impl EnvBase for UnimplementedEnv
§type Error = Infallible
type Error = Infallible
The type of error returned from the environment when the environment
itself fails “unrecoverably”, or at least in a way that the user is not
expected to be able to recover from, such as an internal logic error,
exceeding the execution budget, or being passed malformed input in a way
that the user-facing API does not anticipate or allow for. This type is
returned from all environment-interface methods, and will only ever
take on two possible concrete types: either
Infallible
(in the
Guest
) or HostError
(in the Host
). Read moresource§fn escalate_error_to_panic(&self, _e: Self::Error) -> !
fn escalate_error_to_panic(&self, _e: Self::Error) -> !
Reject an error from the environment, turning it into a panic but on
terms that the environment controls (eg. transforming or logging it).
This should only ever be called by client-side / SDK local-testing code,
never in the
Host
.source§fn as_mut_any(&mut self) -> &mut dyn Any
fn as_mut_any(&mut self) -> &mut dyn Any
Used for recovering the concrete type of the Host.
source§fn check_same_env(&self, _other: &Self)
fn check_same_env(&self, _other: &Self)
Used to check two environments are the same, trapping if not.
source§fn deep_clone(&self) -> Self
fn deep_clone(&self) -> Self
Used to clone an environment deeply, not just a handle to it.
source§fn bytes_copy_from_slice(
&self,
_b: BytesObject,
_b_pos: U32Val,
_slice: &[u8]
) -> Result<BytesObject, Self::Error>
fn bytes_copy_from_slice( &self, _b: BytesObject, _b_pos: U32Val, _slice: &[u8] ) -> Result<BytesObject, Self::Error>
Clone an existing
Bytes
object in the host, replacing the portion of
its memory with bytes supplied by slice
, returning the new object. The
replaced portion of the original object’s memory begins at b_pos
and
extends for the same length as the new slice
.source§fn bytes_copy_to_slice(
&self,
_b: BytesObject,
_b_pos: U32Val,
_slice: &mut [u8]
) -> Result<(), Self::Error>
fn bytes_copy_to_slice( &self, _b: BytesObject, _b_pos: U32Val, _slice: &mut [u8] ) -> Result<(), Self::Error>
Copy a slice of bytes from a
Bytes
object in the host into a slice in
the caller’s memory.source§fn string_copy_to_slice(
&self,
_b: StringObject,
_b_pos: U32Val,
_slice: &mut [u8]
) -> Result<(), Self::Error>
fn string_copy_to_slice( &self, _b: StringObject, _b_pos: U32Val, _slice: &mut [u8] ) -> Result<(), Self::Error>
Copy a slice of bytes from a
String
object in the host into a slice in
the caller’s memory.source§fn symbol_copy_to_slice(
&self,
_b: SymbolObject,
_b_pos: U32Val,
_slice: &mut [u8]
) -> Result<(), Self::Error>
fn symbol_copy_to_slice( &self, _b: SymbolObject, _b_pos: U32Val, _slice: &mut [u8] ) -> Result<(), Self::Error>
Copy a slice of bytes from a
Symbol
object in the host into the
caller’s memory.source§fn bytes_new_from_slice(
&self,
_slice: &[u8]
) -> Result<BytesObject, Self::Error>
fn bytes_new_from_slice( &self, _slice: &[u8] ) -> Result<BytesObject, Self::Error>
Form a new
Bytes
host object from a slice of client memory.source§fn string_new_from_slice(&self, _s: &str) -> Result<StringObject, Self::Error>
fn string_new_from_slice(&self, _s: &str) -> Result<StringObject, Self::Error>
Form a new
String
host object from a slice of client memory.source§fn symbol_new_from_slice(&self, _s: &str) -> Result<SymbolObject, Self::Error>
fn symbol_new_from_slice(&self, _s: &str) -> Result<SymbolObject, Self::Error>
Form a new
Symbol
host object from a slice of client memory.source§fn map_new_from_slices(
&self,
_keys: &[&str],
_vals: &[Val]
) -> Result<MapObject, Self::Error>
fn map_new_from_slices( &self, _keys: &[&str], _vals: &[Val] ) -> Result<MapObject, Self::Error>
Form a new
Map
host object from a slice of symbol-names and a slice of values.
Keys must be in sorted order.source§fn map_unpack_to_slice(
&self,
_map: MapObject,
_keys: &[&str],
_vals: &mut [Val]
) -> Result<Void, Self::Error>
fn map_unpack_to_slice( &self, _map: MapObject, _keys: &[&str], _vals: &mut [Val] ) -> Result<Void, Self::Error>
Unpack a
Map
host object with a specified set of keys to a slice of
Val
s. Keys must be in sorted order and must match the key set of
the unpacked object exactly.source§fn vec_new_from_slice(&self, _vals: &[Val]) -> Result<VecObject, Self::Error>
fn vec_new_from_slice(&self, _vals: &[Val]) -> Result<VecObject, Self::Error>
Form a new
Vec
host object from a slice of values.source§fn vec_unpack_to_slice(
&self,
_vec: VecObject,
_vals: &mut [Val]
) -> Result<Void, Self::Error>
fn vec_unpack_to_slice( &self, _vec: VecObject, _vals: &mut [Val] ) -> Result<Void, Self::Error>
Form a new
Vec
host object from a slice of values. The values slice must
be the same length as the host object.Auto Trait Implementations§
impl RefUnwindSafe for UnimplementedEnv
impl Send for UnimplementedEnv
impl Sync for UnimplementedEnv
impl Unpin for UnimplementedEnv
impl UnwindSafe for UnimplementedEnv
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
source§impl<T, U, E, C> Compare<(T, U)> for Cwhere
C: Compare<T, Error = E, Error = E> + Compare<U>,
impl<T, U, E, C> Compare<(T, U)> for Cwhere C: Compare<T, Error = E, Error = E> + Compare<U>,
source§impl<T, U, V, E, C> Compare<(T, U, V)> for Cwhere
C: Compare<T, Error = E, Error = E, Error = E> + Compare<U> + Compare<V>,
impl<T, U, V, E, C> Compare<(T, U, V)> for Cwhere C: Compare<T, Error = E, Error = E, Error = E> + Compare<U> + Compare<V>,
source§impl<T, U, V, W, E, C> Compare<(T, U, V, W)> for Cwhere
C: Compare<T, Error = E, Error = E, Error = E, Error = E> + Compare<U> + Compare<V> + Compare<W>,
impl<T, U, V, W, E, C> Compare<(T, U, V, W)> for Cwhere C: Compare<T, Error = E, Error = E, Error = E, Error = E> + Compare<U> + Compare<V> + Compare<W>,
type Error = E
fn compare( &self, a: &(T, U, V, W), b: &(T, U, V, W) ) -> Result<Ordering, <C as Compare<(T, U, V, W)>>::Error>
source§impl<T, U, V, W, X, E, C> Compare<(T, U, V, W, X)> for Cwhere
C: Compare<T, Error = E, Error = E, Error = E, Error = E, Error = E> + Compare<U> + Compare<V> + Compare<W> + Compare<X>,
impl<T, U, V, W, X, E, C> Compare<(T, U, V, W, X)> for Cwhere C: Compare<T, Error = E, Error = E, Error = E, Error = E, Error = E> + Compare<U> + Compare<V> + Compare<W> + Compare<X>,
type Error = E
fn compare( &self, a: &(T, U, V, W, X), b: &(T, U, V, W, X) ) -> Result<Ordering, <C as Compare<(T, U, V, W, X)>>::Error>
source§impl<E> Compare<AddressObject> for Ewhere
E: Env,
impl<E> Compare<AddressObject> for Ewhere E: Env,
type Error = <E as EnvBase>::Error
fn compare( &self, a: &AddressObject, b: &AddressObject ) -> Result<Ordering, <E as Compare<AddressObject>>::Error>
source§impl<E> Compare<BytesObject> for Ewhere
E: Env,
impl<E> Compare<BytesObject> for Ewhere E: Env,
type Error = <E as EnvBase>::Error
fn compare( &self, a: &BytesObject, b: &BytesObject ) -> Result<Ordering, <E as Compare<BytesObject>>::Error>
source§impl<E> Compare<DurationObject> for Ewhere
E: Env,
impl<E> Compare<DurationObject> for Ewhere E: Env,
type Error = <E as EnvBase>::Error
fn compare( &self, a: &DurationObject, b: &DurationObject ) -> Result<Ordering, <E as Compare<DurationObject>>::Error>
source§impl<E> Compare<DurationSmall> for Ewhere
E: Env,
impl<E> Compare<DurationSmall> for Ewhere E: Env,
type Error = <E as EnvBase>::Error
fn compare( &self, a: &DurationSmall, b: &DurationSmall ) -> Result<Ordering, <E as Compare<DurationSmall>>::Error>
source§impl<E> Compare<I128Object> for Ewhere
E: Env,
impl<E> Compare<I128Object> for Ewhere E: Env,
type Error = <E as EnvBase>::Error
fn compare( &self, a: &I128Object, b: &I128Object ) -> Result<Ordering, <E as Compare<I128Object>>::Error>
source§impl<E> Compare<I256Object> for Ewhere
E: Env,
impl<E> Compare<I256Object> for Ewhere E: Env,
type Error = <E as EnvBase>::Error
fn compare( &self, a: &I256Object, b: &I256Object ) -> Result<Ordering, <E as Compare<I256Object>>::Error>
source§impl<E> Compare<StringObject> for Ewhere
E: Env,
impl<E> Compare<StringObject> for Ewhere E: Env,
type Error = <E as EnvBase>::Error
fn compare( &self, a: &StringObject, b: &StringObject ) -> Result<Ordering, <E as Compare<StringObject>>::Error>
source§impl<E> Compare<SymbolObject> for Ewhere
E: Env,
impl<E> Compare<SymbolObject> for Ewhere E: Env,
type Error = <E as EnvBase>::Error
fn compare( &self, a: &SymbolObject, b: &SymbolObject ) -> Result<Ordering, <E as Compare<SymbolObject>>::Error>
source§impl<E> Compare<SymbolSmall> for Ewhere
E: Env,
impl<E> Compare<SymbolSmall> for Ewhere E: Env,
type Error = <E as EnvBase>::Error
fn compare( &self, a: &SymbolSmall, b: &SymbolSmall ) -> Result<Ordering, <E as Compare<SymbolSmall>>::Error>
source§impl<E> Compare<TimepointObject> for Ewhere
E: Env,
impl<E> Compare<TimepointObject> for Ewhere E: Env,
type Error = <E as EnvBase>::Error
fn compare( &self, a: &TimepointObject, b: &TimepointObject ) -> Result<Ordering, <E as Compare<TimepointObject>>::Error>
source§impl<E> Compare<TimepointSmall> for Ewhere
E: Env,
impl<E> Compare<TimepointSmall> for Ewhere E: Env,
type Error = <E as EnvBase>::Error
fn compare( &self, a: &TimepointSmall, b: &TimepointSmall ) -> Result<Ordering, <E as Compare<TimepointSmall>>::Error>
source§impl<E> Compare<U128Object> for Ewhere
E: Env,
impl<E> Compare<U128Object> for Ewhere E: Env,
type Error = <E as EnvBase>::Error
fn compare( &self, a: &U128Object, b: &U128Object ) -> Result<Ordering, <E as Compare<U128Object>>::Error>
source§impl<E> Compare<U256Object> for Ewhere
E: Env,
impl<E> Compare<U256Object> for Ewhere E: Env,
type Error = <E as EnvBase>::Error
fn compare( &self, a: &U256Object, b: &U256Object ) -> Result<Ordering, <E as Compare<U256Object>>::Error>
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.