Struct soroban_env_host::Host
source · pub struct Host(_);Implementations§
source§impl Host
impl Host
pub fn ed25519_pub_key_from_obj_input(
&self,
k: Object
) -> Result<PublicKey, HostError>
pub fn sha256_hash_from_bytes_input(
&self,
x: Object
) -> Result<Vec<u8>, HostError>
pub fn contract_data_key_from_rawval(
&self,
k: RawVal
) -> Result<LedgerKey, HostError>
source§impl Host
impl Host
pub fn contract_source_ledger_key(&self, contract_id: Hash) -> LedgerKey
pub fn id_preimage_from_ed25519(
&self,
key: Uint256,
salt: Uint256
) -> Result<HashIdPreimage, HostError>
pub fn id_preimage_from_contract(
&self,
contract_id: Hash,
salt: Uint256
) -> Result<HashIdPreimage, HostError>
pub fn id_preimage_from_asset(
&self,
asset: Asset
) -> Result<HashIdPreimage, HostError>
pub fn id_preimage_from_source_account(
&self,
salt: Uint256
) -> Result<HashIdPreimage, HostError>
pub fn create_contract_args_hash_preimage(
&self,
source: ScContractCode,
salt: Uint256
) -> Result<HashIdPreimage, HostError>
pub fn load_account(
&self,
account_id: AccountId
) -> Result<AccountEntry, HostError>
pub fn has_account(&self, account_id: AccountId) -> Result<bool, HostError>
source§impl Host
impl Host
sourcepub fn err<T>(&self, src: T) -> HostErrorwhere
DebugError: From<T>,
pub fn err<T>(&self, src: T) -> HostErrorwhere
DebugError: From<T>,
Records a debug-event from its input in as much detail as possible, then converts its input to a (often coarser-granularity) Status code, and then forms a HostError with it (which also captures a backtrace::Backtrace). This is the method you want to call any time there’s a finer-granularity error type that you want to log the details of and then downgrade fail with.
sourcepub fn err_status<T>(&self, status: T) -> HostErrorwhere
Status: From<T>,
pub fn err_status<T>(&self, status: T) -> HostErrorwhere
Status: From<T>,
Helper for the simplest status-only error path.
sourcepub fn err_general(&self, msg: &'static str) -> HostError
pub fn err_general(&self, msg: &'static str) -> HostError
Helper for the simplest string + general-error path.
sourcepub fn err_status_msg<T>(&self, status: T, msg: &'static str) -> HostErrorwhere
Status: From<T>,
pub fn err_status_msg<T>(&self, status: T, msg: &'static str) -> HostErrorwhere
Status: From<T>,
Helper for the next-simplest status-and-extended-debug-message error path.
sourcepub fn err_status_msg_with_args<T>(
&self,
status: T,
msg: &'static str,
args: &[RawVal]
) -> HostErrorwhere
Status: From<T>,
pub fn err_status_msg_with_args<T>(
&self,
status: T,
msg: &'static str,
args: &[RawVal]
) -> HostErrorwhere
Status: From<T>,
Helper for the error message with status and an arbitrary number of args.
pub fn err_conversion_into_rawval<T>(&self, rv: RawVal) -> HostError
pub fn err_conversion_general(&self, msg: &'static str) -> HostError
sourcepub fn map_err<T, E>(&self, res: Result<T, E>) -> Result<T, HostError>where
DebugError: From<E>,
pub fn map_err<T, E>(&self, res: Result<T, E>) -> Result<T, HostError>where
DebugError: From<E>,
Given a result carrying some error type that can be converted to a DebugError, calls self.err with it when there’s an error. Returns a result over HostError.
If you have an error type T you want to record as a detailed debug event
and a less-detailed Status code embedded in a HostError, add an impl From<T> for DebugError over in the events module and call this
where the error is generated.
Note: we do not want to impl From<T> for HostError for such types,
as doing so will avoid routing them through the host in order to record
their extended diagnostic information into the debug buffer. This means
you will wind up writing host.map_err(...)? a bunch in code that you
used to be able to get away with just writing ...?, there’s no way
around this if we want to record the diagnostic information.
source§impl Host
impl Host
sourcepub fn with_storage_and_budget(storage: Storage, budget: Budget) -> Self
pub fn with_storage_and_budget(storage: Storage, budget: Budget) -> Self
pub fn set_source_account(&self, source_account: AccountId)
pub fn remove_source_account(&self)
pub fn source_account(&self) -> Result<AccountId, HostError>
pub fn set_ledger_info(&self, info: LedgerInfo)
pub fn with_ledger_info<F, T>(&self, f: F) -> Result<T, HostError>where
F: FnOnce(&LedgerInfo) -> Result<T, HostError>,
pub fn with_mut_ledger_info<F>(&self, f: F) -> Result<(), HostError>where
F: FnMut(&mut LedgerInfo),
sourcepub fn with_budget<T, F>(&self, f: F) -> Twhere
F: FnOnce(Budget) -> T,
pub fn with_budget<T, F>(&self, f: F) -> Twhere
F: FnOnce(Budget) -> T,
pub fn budget_cloned(&self) -> Budget
pub fn charge_budget(&self, ty: CostType, input: u64) -> Result<(), HostError>
sourcepub fn record_debug_event<T>(&self, src: T) -> Result<(), HostError>where
DebugEvent: From<T>,
pub fn record_debug_event<T>(&self, src: T) -> Result<(), HostError>where
DebugEvent: From<T>,
Records a debug event. This in itself is not necessarily an error; it might just be some contextual event we want to put in a debug log for diagnostic purpopses. The return value from this is therefore () when the event is recorded successfully, even if the event itself represented some other error. This function only returns Err(…) when there was a failure to record the event, such as when budget is exceeded.
pub fn record_contract_event(
&self,
type_: ContractEventType,
topics: ScVec,
data: ScVal
) -> Result<(), HostError>
pub fn with_mut_storage<F, U>(&self, f: F) -> Result<U, HostError>where
F: FnOnce(&mut Storage) -> Result<U, HostError>,
sourcepub fn try_finish(self) -> Result<(Storage, Budget, Events), Self>
pub fn try_finish(self) -> Result<(Storage, Budget, Events), Self>
Accept a unique (refcount = 1) host reference and destroy the
underlying [HostImpl], returning its constituent components to the
caller as a tuple wrapped in Ok(...). If the provided host reference
is not unique, returns Err(self).
sourcepub fn with_test_contract_frame<F>(
&self,
id: Hash,
func: Symbol,
f: F
) -> Result<RawVal, HostError>where
F: FnOnce() -> Result<RawVal, HostError>,
pub fn with_test_contract_frame<F>(
&self,
id: Hash,
func: Symbol,
f: F
) -> Result<RawVal, HostError>where
F: FnOnce() -> Result<RawVal, HostError>,
Pushes a test contract [Frame], runs a closure, and then pops the
frame, rolling back if the closure returned an error. Returns the result
that the closure returned (or any error caused during the frame
push/pop). Used for testing.
pub fn inject_val(&self, v: &ScVal) -> Result<RawVal, HostError>
pub fn get_events(&self) -> Result<Events, HostError>
pub fn get_contract_id_from_asset(
&self,
asset: Asset
) -> Result<Object, HostError>
pub fn invoke_function(&self, hf: HostFunction) -> Result<ScVal, HostError>
pub fn register_test_contract(
&self,
contract_id: Object,
contract_fns: Rc<dyn ContractFunctionSet>
) -> Result<(), HostError>
pub fn add_ledger_entry(
&self,
key: LedgerKey,
val: LedgerEntry
) -> Result<(), HostError>
Trait Implementations§
source§impl Compare<AccessType> for Host
impl Compare<AccessType> for Host
source§impl Compare<AccountEntry> for Host
impl Compare<AccountEntry> for Host
source§impl Compare<ClaimableBalanceEntry> for Host
impl Compare<ClaimableBalanceEntry> for Host
source§impl Compare<ConfigSettingEntry> for Host
impl Compare<ConfigSettingEntry> for Host
source§impl Compare<ContractCodeEntry> for Host
impl Compare<ContractCodeEntry> for Host
source§impl Compare<LedgerEntryExt> for Host
impl Compare<LedgerEntryExt> for Host
source§impl Compare<LedgerKeyAccount> for Host
impl Compare<LedgerKeyAccount> for Host
source§impl Compare<LedgerKeyClaimableBalance> for Host
impl Compare<LedgerKeyClaimableBalance> for Host
source§impl Compare<LedgerKeyConfigSetting> for Host
impl Compare<LedgerKeyConfigSetting> for Host
source§impl Compare<LedgerKeyContractCode> for Host
impl Compare<LedgerKeyContractCode> for Host
source§impl Compare<LedgerKeyData> for Host
impl Compare<LedgerKeyData> for Host
source§impl Compare<LedgerKeyLiquidityPool> for Host
impl Compare<LedgerKeyLiquidityPool> for Host
source§impl Compare<LedgerKeyOffer> for Host
impl Compare<LedgerKeyOffer> for Host
source§impl Compare<LedgerKeyTrustLine> for Host
impl Compare<LedgerKeyTrustLine> for Host
source§impl Compare<LiquidityPoolEntry> for Host
impl Compare<LiquidityPoolEntry> for Host
source§impl<K, V> Compare<MeteredOrdMap<K, V, Host>> for Hostwhere
K: MeteredClone,
V: MeteredClone,
Host: Compare<K, Error = HostError> + Compare<V, Error = HostError>,
impl<K, V> Compare<MeteredOrdMap<K, V, Host>> for Hostwhere
K: MeteredClone,
V: MeteredClone,
Host: Compare<K, Error = HostError> + Compare<V, Error = HostError>,
source§impl<Elt: MeteredClone> Compare<MeteredVector<Elt>> for Hostwhere
Host: Compare<Elt, Error = HostError>,
impl<Elt: MeteredClone> Compare<MeteredVector<Elt>> for Hostwhere
Host: Compare<Elt, Error = HostError>,
source§impl Compare<OfferEntry> for Host
impl Compare<OfferEntry> for Host
source§impl Compare<ScContractCode> for Host
impl Compare<ScContractCode> for Host
source§impl Compare<TrustLineAsset> for Host
impl Compare<TrustLineAsset> for Host
source§impl Compare<TrustLineEntry> for Host
impl Compare<TrustLineEntry> for Host
source§impl EnvBase for Host
impl EnvBase for Host
source§fn as_mut_any(&mut self) -> &mut dyn Any
fn as_mut_any(&mut self) -> &mut dyn Any
source§fn check_same_env(&self, other: &Self)
fn check_same_env(&self, other: &Self)
source§fn deep_clone(&self) -> Self
fn deep_clone(&self) -> Self
source§fn bytes_copy_from_slice(
&self,
b: Object,
b_pos: RawVal,
mem: &[u8]
) -> Result<Object, Status>
fn bytes_copy_from_slice(
&self,
b: Object,
b_pos: RawVal,
mem: &[u8]
) -> Result<Object, Status>
Bytes
object the host, returning a new Bytes.source§fn bytes_copy_to_slice(
&self,
b: Object,
b_pos: RawVal,
mem: &mut [u8]
) -> Result<(), Status>
fn bytes_copy_to_slice(
&self,
b: Object,
b_pos: RawVal,
mem: &mut [u8]
) -> Result<(), Status>
Bytes object in the host into the
caller’s memory.source§fn bytes_new_from_slice(&self, mem: &[u8]) -> Result<Object, Status>
fn bytes_new_from_slice(&self, mem: &[u8]) -> Result<Object, Status>
Bytes object in the host from a slice of memory in the
caller.source§fn log_static_fmt_val(&self, fmt: &'static str, v: RawVal) -> Result<(), Status>
fn log_static_fmt_val(&self, fmt: &'static str, v: RawVal) -> Result<(), Status>
{} markers) and
a single RawVal argument that will be inserted at the marker in the
format string.source§fn log_static_fmt_static_str(
&self,
fmt: &'static str,
s: &'static str
) -> Result<(), Status>
fn log_static_fmt_static_str(
&self,
fmt: &'static str,
s: &'static str
) -> Result<(), Status>
{} markers) and
a single string-slice argument that will be inserted at the marker in
the format string.source§fn log_static_fmt_val_static_str(
&self,
fmt: &'static str,
v: RawVal,
s: &'static str
) -> Result<(), Status>
fn log_static_fmt_val_static_str(
&self,
fmt: &'static str,
v: RawVal,
s: &'static str
) -> Result<(), Status>
{} markers) and
both a RawVal and a string-slice argument, that will each be inserted
at markers in the format string.source§fn log_static_fmt_general(
&self,
fmt: &'static str,
vals: &[RawVal],
strs: &[&'static str]
) -> Result<(), Status>
fn log_static_fmt_general(
&self,
fmt: &'static str,
vals: &[RawVal],
strs: &[&'static str]
) -> Result<(), Status>
{} markers) and
both a slice of RawVals and a slice of string-slice argument, that
will be sequentially inserted at markers in the format string.source§impl VmCallerCheckedEnv for Host
impl VmCallerCheckedEnv for Host
type VmUserState = Host
type Error = HostError
fn escalate_error_to_panic(&self, e: Self::Error) -> !
source§fn log_value(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
v: RawVal
) -> Result<RawVal, HostError>
fn log_value(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
v: RawVal
) -> Result<RawVal, HostError>
source§fn log_fmt_values(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
fmt: Object,
args: Object
) -> Result<RawVal, HostError>
fn log_fmt_values(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
fmt: Object,
args: Object
) -> Result<RawVal, HostError>
source§fn get_invoker_type(
&self,
_vmcaller: &mut VmCaller<'_, Host>
) -> Result<u64, HostError>
fn get_invoker_type(
&self,
_vmcaller: &mut VmCaller<'_, Host>
) -> Result<u64, HostError>
source§fn get_invoking_account(
&self,
vmcaller: &mut VmCaller<'_, Host>
) -> Result<Object, HostError>
fn get_invoking_account(
&self,
vmcaller: &mut VmCaller<'_, Host>
) -> Result<Object, HostError>
source§fn get_invoking_contract(
&self,
_vmcaller: &mut VmCaller<'_, Host>
) -> Result<Object, HostError>
fn get_invoking_contract(
&self,
_vmcaller: &mut VmCaller<'_, Host>
) -> Result<Object, HostError>
Bytes of the contract which invoked the running contract. Traps if the running contract was not invoked by a contract.fn obj_cmp(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
a: RawVal,
b: RawVal
) -> Result<i64, HostError>
source§fn contract_event(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
topics: Object,
data: RawVal
) -> Result<RawVal, HostError>
fn contract_event(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
topics: Object,
data: RawVal
) -> Result<RawVal, HostError>
topics is expected to be a SCVec with length <= 4 that cannot contain Vec, Map, or Bytes with length > 32 On success, returns an SCStatus::Ok.source§fn get_current_contract(
&self,
_vmcaller: &mut VmCaller<'_, Host>
) -> Result<Object, HostError>
fn get_current_contract(
&self,
_vmcaller: &mut VmCaller<'_, Host>
) -> Result<Object, HostError>
Bytes of the contract which invoked the running contract. Traps if the running contract was not invoked by a contract.source§fn obj_from_u64(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
u: u64
) -> Result<Object, HostError>
fn obj_from_u64(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
u: u64
) -> Result<Object, HostError>
source§fn obj_to_u64(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
obj: Object
) -> Result<u64, HostError>
fn obj_to_u64(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
obj: Object
) -> Result<u64, HostError>
source§fn obj_from_i64(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
i: i64
) -> Result<Object, HostError>
fn obj_from_i64(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
i: i64
) -> Result<Object, HostError>
source§fn obj_to_i64(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
obj: Object
) -> Result<i64, HostError>
fn obj_to_i64(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
obj: Object
) -> Result<i64, HostError>
source§fn obj_from_u128_pieces(
&self,
vmcaller: &mut VmCaller<'_, Self::VmUserState>,
lo: u64,
hi: u64
) -> Result<Object, Self::Error>
fn obj_from_u128_pieces(
&self,
vmcaller: &mut VmCaller<'_, Self::VmUserState>,
lo: u64,
hi: u64
) -> Result<Object, Self::Error>
source§fn obj_to_u128_lo64(
&self,
vmcaller: &mut VmCaller<'_, Self::VmUserState>,
obj: Object
) -> Result<u64, Self::Error>
fn obj_to_u128_lo64(
&self,
vmcaller: &mut VmCaller<'_, Self::VmUserState>,
obj: Object
) -> Result<u64, Self::Error>
source§fn obj_to_u128_hi64(
&self,
vmcaller: &mut VmCaller<'_, Self::VmUserState>,
obj: Object
) -> Result<u64, Self::Error>
fn obj_to_u128_hi64(
&self,
vmcaller: &mut VmCaller<'_, Self::VmUserState>,
obj: Object
) -> Result<u64, Self::Error>
source§fn obj_from_i128_pieces(
&self,
vmcaller: &mut VmCaller<'_, Self::VmUserState>,
lo: u64,
hi: u64
) -> Result<Object, Self::Error>
fn obj_from_i128_pieces(
&self,
vmcaller: &mut VmCaller<'_, Self::VmUserState>,
lo: u64,
hi: u64
) -> Result<Object, Self::Error>
source§fn obj_to_i128_lo64(
&self,
vmcaller: &mut VmCaller<'_, Self::VmUserState>,
obj: Object
) -> Result<u64, Self::Error>
fn obj_to_i128_lo64(
&self,
vmcaller: &mut VmCaller<'_, Self::VmUserState>,
obj: Object
) -> Result<u64, Self::Error>
source§fn obj_to_i128_hi64(
&self,
vmcaller: &mut VmCaller<'_, Self::VmUserState>,
obj: Object
) -> Result<u64, Self::Error>
fn obj_to_i128_hi64(
&self,
vmcaller: &mut VmCaller<'_, Self::VmUserState>,
obj: Object
) -> Result<u64, Self::Error>
source§fn map_new(
&self,
_vmcaller: &mut VmCaller<'_, Host>
) -> Result<Object, HostError>
fn map_new(
&self,
_vmcaller: &mut VmCaller<'_, Host>
) -> Result<Object, HostError>
source§fn map_put(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
m: Object,
k: RawVal,
v: RawVal
) -> Result<Object, HostError>
fn map_put(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
m: Object,
k: RawVal,
v: RawVal
) -> Result<Object, HostError>
source§fn map_get(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
m: Object,
k: RawVal
) -> Result<RawVal, HostError>
fn map_get(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
m: Object,
k: RawVal
) -> Result<RawVal, HostError>
source§fn map_del(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
m: Object,
k: RawVal
) -> Result<Object, HostError>
fn map_del(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
m: Object,
k: RawVal
) -> Result<Object, HostError>
source§fn map_len(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
m: Object
) -> Result<RawVal, HostError>
fn map_len(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
m: Object
) -> Result<RawVal, HostError>
source§fn map_has(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
m: Object,
k: RawVal
) -> Result<RawVal, HostError>
fn map_has(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
m: Object,
k: RawVal
) -> Result<RawVal, HostError>
source§fn map_prev_key(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
m: Object,
k: RawVal
) -> Result<RawVal, HostError>
fn map_prev_key(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
m: Object,
k: RawVal
) -> Result<RawVal, HostError>
source§fn map_next_key(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
m: Object,
k: RawVal
) -> Result<RawVal, HostError>
fn map_next_key(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
m: Object,
k: RawVal
) -> Result<RawVal, HostError>
source§fn map_min_key(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
m: Object
) -> Result<RawVal, HostError>
fn map_min_key(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
m: Object
) -> Result<RawVal, HostError>
source§fn map_max_key(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
m: Object
) -> Result<RawVal, HostError>
fn map_max_key(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
m: Object
) -> Result<RawVal, HostError>
source§fn map_keys(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
m: Object
) -> Result<Object, HostError>
fn map_keys(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
m: Object
) -> Result<Object, HostError>
source§fn map_values(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
m: Object
) -> Result<Object, HostError>
fn map_values(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
m: Object
) -> Result<Object, HostError>
source§fn vec_new(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
c: RawVal
) -> Result<Object, HostError>
fn vec_new(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
c: RawVal
) -> Result<Object, HostError>
c. If c is ScStatic::Void, no hint is assumed and the new vector is empty. Otherwise, c is parsed as an u32 that represents the initial capacity of the new vector.source§fn vec_put(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
v: Object,
i: RawVal,
x: RawVal
) -> Result<Object, HostError>
fn vec_put(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
v: Object,
i: RawVal,
x: RawVal
) -> Result<Object, HostError>
i in the vector. Return the new vector. Trap if the index is out of bounds.source§fn vec_get(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
v: Object,
i: RawVal
) -> Result<RawVal, HostError>
fn vec_get(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
v: Object,
i: RawVal
) -> Result<RawVal, HostError>
i of the vector. Traps if the index is out of bound.source§fn vec_del(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
v: Object,
i: RawVal
) -> Result<Object, HostError>
fn vec_del(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
v: Object,
i: RawVal
) -> Result<Object, HostError>
i, shifting all elements after it to the left. Return the new vector. Traps if the index is out of bound.source§fn vec_len(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
v: Object
) -> Result<RawVal, HostError>
fn vec_len(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
v: Object
) -> Result<RawVal, HostError>
source§fn vec_push_front(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
v: Object,
x: RawVal
) -> Result<Object, HostError>
fn vec_push_front(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
v: Object,
x: RawVal
) -> Result<Object, HostError>
source§fn vec_pop_front(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
v: Object
) -> Result<Object, HostError>
fn vec_pop_front(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
v: Object
) -> Result<Object, HostError>
source§fn vec_push_back(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
v: Object,
x: RawVal
) -> Result<Object, HostError>
fn vec_push_back(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
v: Object,
x: RawVal
) -> Result<Object, HostError>
source§fn vec_pop_back(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
v: Object
) -> Result<Object, HostError>
fn vec_pop_back(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
v: Object
) -> Result<Object, HostError>
source§fn vec_front(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
v: Object
) -> Result<RawVal, HostError>
fn vec_front(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
v: Object
) -> Result<RawVal, HostError>
source§fn vec_back(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
v: Object
) -> Result<RawVal, HostError>
fn vec_back(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
v: Object
) -> Result<RawVal, HostError>
source§fn vec_insert(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
v: Object,
i: RawVal,
x: RawVal
) -> Result<Object, HostError>
fn vec_insert(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
v: Object,
i: RawVal,
x: RawVal
) -> Result<Object, HostError>
i within the vector, shifting all elements after it to the right. Traps if the index is out of boundsource§fn vec_append(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
v1: Object,
v2: Object
) -> Result<Object, HostError>
fn vec_append(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
v1: Object,
v2: Object
) -> Result<Object, HostError>
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,
_vmcaller: &mut VmCaller<'_, Host>,
v: Object,
start: RawVal,
end: RawVal
) -> Result<Object, HostError>
fn vec_slice(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
v: Object,
start: RawVal,
end: RawVal
) -> Result<Object, HostError>
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,
_vmcaller: &mut VmCaller<'_, Host>,
v: Object,
x: RawVal
) -> Result<RawVal, Self::Error>
fn vec_first_index_of(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
v: Object,
x: RawVal
) -> Result<RawVal, Self::Error>
ScStatic::Void.source§fn vec_last_index_of(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
v: Object,
x: RawVal
) -> Result<RawVal, Self::Error>
fn vec_last_index_of(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
v: Object,
x: RawVal
) -> Result<RawVal, Self::Error>
ScStatic::Void.source§fn vec_binary_search(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
v: Object,
x: RawVal
) -> Result<u64, Self::Error>
fn vec_binary_search(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
v: Object,
x: RawVal
) -> Result<u64, Self::Error>
fn put_contract_data(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
k: RawVal,
v: RawVal
) -> Result<RawVal, HostError>
fn has_contract_data(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
k: RawVal
) -> Result<RawVal, HostError>
fn get_contract_data(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
k: RawVal
) -> Result<RawVal, HostError>
fn del_contract_data(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
k: RawVal
) -> Result<RawVal, HostError>
source§fn create_contract_from_contract(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
wasm_hash: Object,
salt: Object
) -> Result<Object, HostError>
fn create_contract_from_contract(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
wasm_hash: Object,
salt: Object
) -> Result<Object, HostError>
wasm_hash must be a hash of the contract code that has already been installed on this network. salt is used to create a unique contract id.source§fn call(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
contract: Object,
func: Symbol,
args: Object
) -> Result<RawVal, HostError>
fn call(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
contract: Object,
func: Symbol,
args: Object
) -> Result<RawVal, HostError>
args. If the call is successful, forwards the result of the called function. Traps otherwise.source§fn try_call(
&self,
vmcaller: &mut VmCaller<'_, Host>,
contract: Object,
func: Symbol,
args: Object
) -> Result<RawVal, HostError>
fn try_call(
&self,
vmcaller: &mut VmCaller<'_, Host>,
contract: Object,
func: Symbol,
args: Object
) -> Result<RawVal, HostError>
args. Returns: - if successful, result of the called function. - otherwise, an SCStatus containing the error status code.source§fn serialize_to_bytes(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
v: RawVal
) -> Result<Object, HostError>
fn serialize_to_bytes(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
v: RawVal
) -> Result<Object, HostError>
Bytes object.source§fn deserialize_from_bytes(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
b: Object
) -> Result<RawVal, HostError>
fn deserialize_from_bytes(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
b: Object
) -> Result<RawVal, HostError>
Bytes object to get back the (SC)Val.source§fn bytes_copy_to_linear_memory(
&self,
vmcaller: &mut VmCaller<'_, Host>,
b: Object,
b_pos: RawVal,
lm_pos: RawVal,
len: RawVal
) -> Result<RawVal, HostError>
fn bytes_copy_to_linear_memory(
&self,
vmcaller: &mut VmCaller<'_, Host>,
b: Object,
b_pos: RawVal,
lm_pos: RawVal,
len: RawVal
) -> Result<RawVal, HostError>
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,
vmcaller: &mut VmCaller<'_, Host>,
b: Object,
b_pos: RawVal,
lm_pos: RawVal,
len: RawVal
) -> Result<Object, HostError>
fn bytes_copy_from_linear_memory(
&self,
vmcaller: &mut VmCaller<'_, Host>,
b: Object,
b_pos: RawVal,
lm_pos: RawVal,
len: RawVal
) -> Result<Object, HostError>
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,
vmcaller: &mut VmCaller<'_, Host>,
lm_pos: RawVal,
len: RawVal
) -> Result<Object, HostError>
fn bytes_new_from_linear_memory(
&self,
vmcaller: &mut VmCaller<'_, Host>,
lm_pos: RawVal,
len: RawVal
) -> Result<Object, HostError>
Bytes object initialized with bytes copied from a linear memory slice specified at position lm_pos with length len.source§fn bytes_new(
&self,
_vmcaller: &mut VmCaller<'_, Host>
) -> Result<Object, HostError>
fn bytes_new(
&self,
_vmcaller: &mut VmCaller<'_, Host>
) -> Result<Object, HostError>
Bytes object.source§fn bytes_put(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
b: Object,
i: RawVal,
u: RawVal
) -> Result<Object, HostError>
fn bytes_put(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
b: Object,
i: RawVal,
u: RawVal
) -> Result<Object, HostError>
i in the Bytes object. Return the new Bytes. Trap if the index is out of bounds.source§fn bytes_get(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
b: Object,
i: RawVal
) -> Result<RawVal, HostError>
fn bytes_get(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
b: Object,
i: RawVal
) -> Result<RawVal, HostError>
i of the Bytes object. Traps if the index is out of bound.source§fn bytes_del(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
b: Object,
i: RawVal
) -> Result<Object, HostError>
fn bytes_del(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
b: Object,
i: RawVal
) -> Result<Object, HostError>
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,
_vmcaller: &mut VmCaller<'_, Host>,
b: Object
) -> Result<RawVal, HostError>
fn bytes_len(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
b: Object
) -> Result<RawVal, HostError>
Bytes object.source§fn bytes_push(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
b: Object,
u: RawVal
) -> Result<Object, HostError>
fn bytes_push(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
b: Object,
u: RawVal
) -> Result<Object, HostError>
Bytes object.source§fn bytes_pop(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
b: Object
) -> Result<Object, HostError>
fn bytes_pop(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
b: Object
) -> Result<Object, HostError>
Bytes object and returns the new Bytes. Traps if original Bytes is empty.source§fn bytes_front(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
b: Object
) -> Result<RawVal, HostError>
fn bytes_front(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
b: Object
) -> Result<RawVal, HostError>
Bytes object. Traps if the Bytes is emptysource§fn bytes_back(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
b: Object
) -> Result<RawVal, HostError>
fn bytes_back(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
b: Object
) -> Result<RawVal, HostError>
Bytes object. Traps if the Bytes is emptysource§fn bytes_insert(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
b: Object,
i: RawVal,
u: RawVal
) -> Result<Object, HostError>
fn bytes_insert(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
b: Object,
i: RawVal,
u: RawVal
) -> Result<Object, HostError>
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,
_vmcaller: &mut VmCaller<'_, Host>,
b1: Object,
b2: Object
) -> Result<Object, HostError>
fn bytes_append(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
b1: Object,
b2: Object
) -> Result<Object, HostError>
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,
_vmcaller: &mut VmCaller<'_, Host>,
b: Object,
start: RawVal,
end: RawVal
) -> Result<Object, HostError>
fn bytes_slice(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
b: Object,
start: RawVal,
end: RawVal
) -> Result<Object, HostError>
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.fn hash_from_bytes(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
x: Object
) -> Result<Object, HostError>
fn hash_to_bytes(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
x: Object
) -> Result<Object, HostError>
fn public_key_from_bytes(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
x: Object
) -> Result<Object, HostError>
fn public_key_to_bytes(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
x: Object
) -> Result<Object, HostError>
fn compute_hash_sha256(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
x: Object
) -> Result<Object, HostError>
fn verify_sig_ed25519(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
x: Object,
k: Object,
s: Object
) -> Result<RawVal, HostError>
source§fn account_get_low_threshold(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
a: Object
) -> Result<RawVal, Self::Error>
fn account_get_low_threshold(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
a: Object
) -> Result<RawVal, Self::Error>
a (a is AccountId). Traps if no such account exists.source§fn account_get_medium_threshold(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
a: Object
) -> Result<RawVal, Self::Error>
fn account_get_medium_threshold(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
a: Object
) -> Result<RawVal, Self::Error>
a (a is AccountId). Traps if no such account exists.source§fn account_get_high_threshold(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
a: Object
) -> Result<RawVal, Self::Error>
fn account_get_high_threshold(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
a: Object
) -> Result<RawVal, Self::Error>
a (a is AccountId). Traps if no such account exists.source§fn account_exists(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
a: Object
) -> Result<RawVal, Self::Error>
fn account_exists(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
a: Object
) -> Result<RawVal, Self::Error>
a (a is AccountId) of an account, check if it exists. Returns (SCStatic) TRUE/FALSE.source§fn account_get_signer_weight(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
a: Object,
s: Object
) -> Result<RawVal, Self::Error>
fn account_get_signer_weight(
&self,
_vmcaller: &mut VmCaller<'_, Host>,
a: Object,
s: Object
) -> Result<RawVal, Self::Error>
s (s is Bytes) on the account with ID a (a is AccountId). Returns the master weight if the signer is the master, and returns 0 if no such signer exists. Traps if no such account exists.source§fn get_ledger_version(
&self,
_vmcaller: &mut VmCaller<'_, Host>
) -> Result<RawVal, Self::Error>
fn get_ledger_version(
&self,
_vmcaller: &mut VmCaller<'_, Host>
) -> Result<RawVal, Self::Error>
source§fn get_ledger_sequence(
&self,
_vmcaller: &mut VmCaller<'_, Host>
) -> Result<RawVal, Self::Error>
fn get_ledger_sequence(
&self,
_vmcaller: &mut VmCaller<'_, Host>
) -> Result<RawVal, Self::Error>
source§fn get_ledger_timestamp(
&self,
_vmcaller: &mut VmCaller<'_, Host>
) -> Result<Object, Self::Error>
fn get_ledger_timestamp(
&self,
_vmcaller: &mut VmCaller<'_, Host>
) -> Result<Object, Self::Error>
source§fn get_ledger_network_passphrase(
&self,
_vmcaller: &mut VmCaller<'_, Host>
) -> Result<Object, Self::Error>
fn get_ledger_network_passphrase(
&self,
_vmcaller: &mut VmCaller<'_, Host>
) -> Result<Object, Self::Error>
Bytes.source§fn get_ledger_network_id(
&self,
_vmcaller: &mut VmCaller<'_, Host>
) -> Result<Object, Self::Error>
fn get_ledger_network_id(
&self,
_vmcaller: &mut VmCaller<'_, Host>
) -> Result<Object, Self::Error>
Bytes. The value is always 32 bytes in length.source§fn get_current_call_stack(
&self,
_vmcaller: &mut VmCaller<'_, Host>
) -> Result<Object, HostError>
fn get_current_call_stack(
&self,
_vmcaller: &mut VmCaller<'_, Host>
) -> Result<Object, HostError>
source§fn fail_with_status(
&self,
vmcaller: &mut VmCaller<'_, Self::VmUserState>,
status: Status
) -> Result<RawVal, Self::Error>
fn fail_with_status(
&self,
vmcaller: &mut VmCaller<'_, Self::VmUserState>,
status: Status
) -> Result<RawVal, Self::Error>
ScStatusType::ContractError. Does not actually return.Auto Trait Implementations§
impl !RefUnwindSafe for Host
impl !Send for Host
impl !Sync for Host
impl Unpin for Host
impl !UnwindSafe for Host
Blanket Implementations§
source§impl<T> CheckedEnv for Twhere
T: VmCallerCheckedEnv,
impl<T> CheckedEnv for Twhere
T: VmCallerCheckedEnv,
type Error = <T as VmCallerCheckedEnv>::Error
fn escalate_error_to_panic(&self, e: <T as CheckedEnv>::Error) -> !
source§fn log_value(&self, v: RawVal) -> Result<RawVal, <T as CheckedEnv>::Error>
fn log_value(&self, v: RawVal) -> Result<RawVal, <T as CheckedEnv>::Error>
source§fn get_invoking_contract(&self) -> Result<Object, <T as CheckedEnv>::Error>
fn get_invoking_contract(&self) -> Result<Object, <T as CheckedEnv>::Error>
Bytes of the contract which invoked the running contract. Traps if the running contract was not invoked by a contract.fn obj_cmp(&self, a: RawVal, b: RawVal) -> Result<i64, <T as CheckedEnv>::Error>
source§fn contract_event(
&self,
topics: Object,
data: RawVal
) -> Result<RawVal, <T as CheckedEnv>::Error>
fn contract_event(
&self,
topics: Object,
data: RawVal
) -> Result<RawVal, <T as CheckedEnv>::Error>
topics is expected to be a SCVec with length <= 4 that cannot contain Vec, Map, or Bytes with length > 32 On success, returns an SCStatus::Ok.source§fn get_current_contract(&self) -> Result<Object, <T as CheckedEnv>::Error>
fn get_current_contract(&self) -> Result<Object, <T as CheckedEnv>::Error>
Bytes of the contract which invoked the running contract. Traps if the running contract was not invoked by a contract.source§fn get_ledger_version(&self) -> Result<RawVal, <T as CheckedEnv>::Error>
fn get_ledger_version(&self) -> Result<RawVal, <T as CheckedEnv>::Error>
source§fn get_ledger_sequence(&self) -> Result<RawVal, <T as CheckedEnv>::Error>
fn get_ledger_sequence(&self) -> Result<RawVal, <T as CheckedEnv>::Error>
source§fn get_ledger_timestamp(&self) -> Result<Object, <T as CheckedEnv>::Error>
fn get_ledger_timestamp(&self) -> Result<Object, <T as CheckedEnv>::Error>
source§fn get_ledger_network_passphrase(
&self
) -> Result<Object, <T as CheckedEnv>::Error>
fn get_ledger_network_passphrase(
&self
) -> Result<Object, <T as CheckedEnv>::Error>
Bytes.source§fn get_current_call_stack(&self) -> Result<Object, <T as CheckedEnv>::Error>
fn get_current_call_stack(&self) -> Result<Object, <T as CheckedEnv>::Error>
source§fn fail_with_status(
&self,
status: Status
) -> Result<RawVal, <T as CheckedEnv>::Error>
fn fail_with_status(
&self,
status: Status
) -> Result<RawVal, <T as CheckedEnv>::Error>
ScStatusType::ContractError. Does not actually return.source§fn log_fmt_values(
&self,
fmt: Object,
args: Object
) -> Result<RawVal, <T as CheckedEnv>::Error>
fn log_fmt_values(
&self,
fmt: Object,
args: Object
) -> Result<RawVal, <T as CheckedEnv>::Error>
source§fn get_invoker_type(&self) -> Result<u64, <T as CheckedEnv>::Error>
fn get_invoker_type(&self) -> Result<u64, <T as CheckedEnv>::Error>
source§fn get_invoking_account(&self) -> Result<Object, <T as CheckedEnv>::Error>
fn get_invoking_account(&self) -> Result<Object, <T as CheckedEnv>::Error>
source§fn get_ledger_network_id(&self) -> Result<Object, <T as CheckedEnv>::Error>
fn get_ledger_network_id(&self) -> Result<Object, <T as CheckedEnv>::Error>
Bytes. The value is always 32 bytes in length.source§fn obj_from_u64(&self, v: u64) -> Result<Object, <T as CheckedEnv>::Error>
fn obj_from_u64(&self, v: u64) -> Result<Object, <T as CheckedEnv>::Error>
source§fn obj_to_u64(&self, obj: Object) -> Result<u64, <T as CheckedEnv>::Error>
fn obj_to_u64(&self, obj: Object) -> Result<u64, <T as CheckedEnv>::Error>
source§fn obj_from_i64(&self, v: i64) -> Result<Object, <T as CheckedEnv>::Error>
fn obj_from_i64(&self, v: i64) -> Result<Object, <T as CheckedEnv>::Error>
source§fn obj_to_i64(&self, obj: Object) -> Result<i64, <T as CheckedEnv>::Error>
fn obj_to_i64(&self, obj: Object) -> Result<i64, <T as CheckedEnv>::Error>
source§fn obj_from_u128_pieces(
&self,
lo: u64,
hi: u64
) -> Result<Object, <T as CheckedEnv>::Error>
fn obj_from_u128_pieces(
&self,
lo: u64,
hi: u64
) -> Result<Object, <T as CheckedEnv>::Error>
source§fn obj_to_u128_lo64(&self, obj: Object) -> Result<u64, <T as CheckedEnv>::Error>
fn obj_to_u128_lo64(&self, obj: Object) -> Result<u64, <T as CheckedEnv>::Error>
source§fn obj_to_u128_hi64(&self, obj: Object) -> Result<u64, <T as CheckedEnv>::Error>
fn obj_to_u128_hi64(&self, obj: Object) -> Result<u64, <T as CheckedEnv>::Error>
source§fn obj_from_i128_pieces(
&self,
lo: u64,
hi: u64
) -> Result<Object, <T as CheckedEnv>::Error>
fn obj_from_i128_pieces(
&self,
lo: u64,
hi: u64
) -> Result<Object, <T as CheckedEnv>::Error>
source§fn obj_to_i128_lo64(&self, obj: Object) -> Result<u64, <T as CheckedEnv>::Error>
fn obj_to_i128_lo64(&self, obj: Object) -> Result<u64, <T as CheckedEnv>::Error>
source§fn obj_to_i128_hi64(&self, obj: Object) -> Result<u64, <T as CheckedEnv>::Error>
fn obj_to_i128_hi64(&self, obj: Object) -> Result<u64, <T as CheckedEnv>::Error>
source§fn map_put(
&self,
m: Object,
k: RawVal,
v: RawVal
) -> Result<Object, <T as CheckedEnv>::Error>
fn map_put(
&self,
m: Object,
k: RawVal,
v: RawVal
) -> Result<Object, <T as CheckedEnv>::Error>
source§fn map_get(
&self,
m: Object,
k: RawVal
) -> Result<RawVal, <T as CheckedEnv>::Error>
fn map_get(
&self,
m: Object,
k: RawVal
) -> Result<RawVal, <T as CheckedEnv>::Error>
source§fn map_del(
&self,
m: Object,
k: RawVal
) -> Result<Object, <T as CheckedEnv>::Error>
fn map_del(
&self,
m: Object,
k: RawVal
) -> Result<Object, <T as CheckedEnv>::Error>
source§fn map_len(&self, m: Object) -> Result<RawVal, <T as CheckedEnv>::Error>
fn map_len(&self, m: Object) -> Result<RawVal, <T as CheckedEnv>::Error>
source§fn map_has(
&self,
m: Object,
k: RawVal
) -> Result<RawVal, <T as CheckedEnv>::Error>
fn map_has(
&self,
m: Object,
k: RawVal
) -> Result<RawVal, <T as CheckedEnv>::Error>
source§fn map_prev_key(
&self,
m: Object,
k: RawVal
) -> Result<RawVal, <T as CheckedEnv>::Error>
fn map_prev_key(
&self,
m: Object,
k: RawVal
) -> Result<RawVal, <T as CheckedEnv>::Error>
source§fn map_next_key(
&self,
m: Object,
k: RawVal
) -> Result<RawVal, <T as CheckedEnv>::Error>
fn map_next_key(
&self,
m: Object,
k: RawVal
) -> Result<RawVal, <T as CheckedEnv>::Error>
source§fn map_min_key(&self, m: Object) -> Result<RawVal, <T as CheckedEnv>::Error>
fn map_min_key(&self, m: Object) -> Result<RawVal, <T as CheckedEnv>::Error>
source§fn map_max_key(&self, m: Object) -> Result<RawVal, <T as CheckedEnv>::Error>
fn map_max_key(&self, m: Object) -> Result<RawVal, <T as CheckedEnv>::Error>
source§fn map_keys(&self, m: Object) -> Result<Object, <T as CheckedEnv>::Error>
fn map_keys(&self, m: Object) -> Result<Object, <T as CheckedEnv>::Error>
source§fn map_values(&self, m: Object) -> Result<Object, <T as CheckedEnv>::Error>
fn map_values(&self, m: Object) -> Result<Object, <T as CheckedEnv>::Error>
source§fn vec_new(&self, c: RawVal) -> Result<Object, <T as CheckedEnv>::Error>
fn vec_new(&self, c: RawVal) -> Result<Object, <T as CheckedEnv>::Error>
c. If c is ScStatic::Void, no hint is assumed and the new vector is empty. Otherwise, c is parsed as an u32 that represents the initial capacity of the new vector.source§fn vec_put(
&self,
v: Object,
i: RawVal,
x: RawVal
) -> Result<Object, <T as CheckedEnv>::Error>
fn vec_put(
&self,
v: Object,
i: RawVal,
x: RawVal
) -> Result<Object, <T as CheckedEnv>::Error>
i in the vector. Return the new vector. Trap if the index is out of bounds.source§fn vec_get(
&self,
v: Object,
i: RawVal
) -> Result<RawVal, <T as CheckedEnv>::Error>
fn vec_get(
&self,
v: Object,
i: RawVal
) -> Result<RawVal, <T as CheckedEnv>::Error>
i of the vector. Traps if the index is out of bound.source§fn vec_del(
&self,
v: Object,
i: RawVal
) -> Result<Object, <T as CheckedEnv>::Error>
fn vec_del(
&self,
v: Object,
i: RawVal
) -> Result<Object, <T as CheckedEnv>::Error>
i, shifting all elements after it to the left. Return the new vector. Traps if the index is out of bound.source§fn vec_len(&self, v: Object) -> Result<RawVal, <T as CheckedEnv>::Error>
fn vec_len(&self, v: Object) -> Result<RawVal, <T as CheckedEnv>::Error>
source§fn vec_push_front(
&self,
v: Object,
x: RawVal
) -> Result<Object, <T as CheckedEnv>::Error>
fn vec_push_front(
&self,
v: Object,
x: RawVal
) -> Result<Object, <T as CheckedEnv>::Error>
source§fn vec_pop_front(&self, v: Object) -> Result<Object, <T as CheckedEnv>::Error>
fn vec_pop_front(&self, v: Object) -> Result<Object, <T as CheckedEnv>::Error>
source§fn vec_push_back(
&self,
v: Object,
x: RawVal
) -> Result<Object, <T as CheckedEnv>::Error>
fn vec_push_back(
&self,
v: Object,
x: RawVal
) -> Result<Object, <T as CheckedEnv>::Error>
source§fn vec_pop_back(&self, v: Object) -> Result<Object, <T as CheckedEnv>::Error>
fn vec_pop_back(&self, v: Object) -> Result<Object, <T as CheckedEnv>::Error>
source§fn vec_front(&self, v: Object) -> Result<RawVal, <T as CheckedEnv>::Error>
fn vec_front(&self, v: Object) -> Result<RawVal, <T as CheckedEnv>::Error>
source§fn vec_back(&self, v: Object) -> Result<RawVal, <T as CheckedEnv>::Error>
fn vec_back(&self, v: Object) -> Result<RawVal, <T as CheckedEnv>::Error>
source§fn vec_insert(
&self,
v: Object,
i: RawVal,
x: RawVal
) -> Result<Object, <T as CheckedEnv>::Error>
fn vec_insert(
&self,
v: Object,
i: RawVal,
x: RawVal
) -> Result<Object, <T as CheckedEnv>::Error>
i within the vector, shifting all elements after it to the right. Traps if the index is out of boundsource§fn vec_append(
&self,
v1: Object,
v2: Object
) -> Result<Object, <T as CheckedEnv>::Error>
fn vec_append(
&self,
v1: Object,
v2: Object
) -> Result<Object, <T as CheckedEnv>::Error>
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,
v: Object,
start: RawVal,
end: RawVal
) -> Result<Object, <T as CheckedEnv>::Error>
fn vec_slice(
&self,
v: Object,
start: RawVal,
end: RawVal
) -> Result<Object, <T as CheckedEnv>::Error>
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,
v: Object,
x: RawVal
) -> Result<RawVal, <T as CheckedEnv>::Error>
fn vec_first_index_of(
&self,
v: Object,
x: RawVal
) -> Result<RawVal, <T as CheckedEnv>::Error>
ScStatic::Void.source§fn vec_last_index_of(
&self,
v: Object,
x: RawVal
) -> Result<RawVal, <T as CheckedEnv>::Error>
fn vec_last_index_of(
&self,
v: Object,
x: RawVal
) -> Result<RawVal, <T as CheckedEnv>::Error>
ScStatic::Void.source§fn vec_binary_search(
&self,
v: Object,
x: RawVal
) -> Result<u64, <T as CheckedEnv>::Error>
fn vec_binary_search(
&self,
v: Object,
x: RawVal
) -> Result<u64, <T as CheckedEnv>::Error>
fn put_contract_data(
&self,
k: RawVal,
v: RawVal
) -> Result<RawVal, <T as CheckedEnv>::Error>
fn has_contract_data(
&self,
k: RawVal
) -> Result<RawVal, <T as CheckedEnv>::Error>
fn get_contract_data(
&self,
k: RawVal
) -> Result<RawVal, <T as CheckedEnv>::Error>
fn del_contract_data(
&self,
k: RawVal
) -> Result<RawVal, <T as CheckedEnv>::Error>
source§fn create_contract_from_contract(
&self,
wasm_hash: Object,
salt: Object
) -> Result<Object, <T as CheckedEnv>::Error>
fn create_contract_from_contract(
&self,
wasm_hash: Object,
salt: Object
) -> Result<Object, <T as CheckedEnv>::Error>
wasm_hash must be a hash of the contract code that has already been installed on this network. salt is used to create a unique contract id.source§fn call(
&self,
contract: Object,
func: Symbol,
args: Object
) -> Result<RawVal, <T as CheckedEnv>::Error>
fn call(
&self,
contract: Object,
func: Symbol,
args: Object
) -> Result<RawVal, <T as CheckedEnv>::Error>
args. If the call is successful, forwards the result of the called function. Traps otherwise.source§fn try_call(
&self,
contract: Object,
func: Symbol,
args: Object
) -> Result<RawVal, <T as CheckedEnv>::Error>
fn try_call(
&self,
contract: Object,
func: Symbol,
args: Object
) -> Result<RawVal, <T as CheckedEnv>::Error>
args. Returns: - if successful, result of the called function. - otherwise, an SCStatus containing the error status code.source§fn serialize_to_bytes(
&self,
v: RawVal
) -> Result<Object, <T as CheckedEnv>::Error>
fn serialize_to_bytes(
&self,
v: RawVal
) -> Result<Object, <T as CheckedEnv>::Error>
Bytes object.source§fn deserialize_from_bytes(
&self,
b: Object
) -> Result<RawVal, <T as CheckedEnv>::Error>
fn deserialize_from_bytes(
&self,
b: Object
) -> Result<RawVal, <T as CheckedEnv>::Error>
Bytes object to get back the (SC)Val.source§fn bytes_copy_to_linear_memory(
&self,
b: Object,
b_pos: RawVal,
lm_pos: RawVal,
len: RawVal
) -> Result<RawVal, <T as CheckedEnv>::Error>
fn bytes_copy_to_linear_memory(
&self,
b: Object,
b_pos: RawVal,
lm_pos: RawVal,
len: RawVal
) -> Result<RawVal, <T as CheckedEnv>::Error>
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,
b: Object,
b_pos: RawVal,
lm_pos: RawVal,
len: RawVal
) -> Result<Object, <T as CheckedEnv>::Error>
fn bytes_copy_from_linear_memory(
&self,
b: Object,
b_pos: RawVal,
lm_pos: RawVal,
len: RawVal
) -> Result<Object, <T as CheckedEnv>::Error>
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,
lm_pos: RawVal,
len: RawVal
) -> Result<Object, <T as CheckedEnv>::Error>
fn bytes_new_from_linear_memory(
&self,
lm_pos: RawVal,
len: RawVal
) -> Result<Object, <T as CheckedEnv>::Error>
Bytes object initialized with bytes copied from a linear memory slice specified at position lm_pos with length len.source§fn bytes_new(&self) -> Result<Object, <T as CheckedEnv>::Error>
fn bytes_new(&self) -> Result<Object, <T as CheckedEnv>::Error>
Bytes object.source§fn bytes_put(
&self,
b: Object,
i: RawVal,
u: RawVal
) -> Result<Object, <T as CheckedEnv>::Error>
fn bytes_put(
&self,
b: Object,
i: RawVal,
u: RawVal
) -> Result<Object, <T as CheckedEnv>::Error>
i in the Bytes object. Return the new Bytes. Trap if the index is out of bounds.source§fn bytes_get(
&self,
b: Object,
i: RawVal
) -> Result<RawVal, <T as CheckedEnv>::Error>
fn bytes_get(
&self,
b: Object,
i: RawVal
) -> Result<RawVal, <T as CheckedEnv>::Error>
i of the Bytes object. Traps if the index is out of bound.source§fn bytes_del(
&self,
b: Object,
i: RawVal
) -> Result<Object, <T as CheckedEnv>::Error>
fn bytes_del(
&self,
b: Object,
i: RawVal
) -> Result<Object, <T as CheckedEnv>::Error>
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, b: Object) -> Result<RawVal, <T as CheckedEnv>::Error>
fn bytes_len(&self, b: Object) -> Result<RawVal, <T as CheckedEnv>::Error>
Bytes object.source§fn bytes_push(
&self,
b: Object,
u: RawVal
) -> Result<Object, <T as CheckedEnv>::Error>
fn bytes_push(
&self,
b: Object,
u: RawVal
) -> Result<Object, <T as CheckedEnv>::Error>
Bytes object.source§fn bytes_pop(&self, b: Object) -> Result<Object, <T as CheckedEnv>::Error>
fn bytes_pop(&self, b: Object) -> Result<Object, <T as CheckedEnv>::Error>
Bytes object and returns the new Bytes. Traps if original Bytes is empty.source§fn bytes_front(&self, b: Object) -> Result<RawVal, <T as CheckedEnv>::Error>
fn bytes_front(&self, b: Object) -> Result<RawVal, <T as CheckedEnv>::Error>
Bytes object. Traps if the Bytes is emptysource§fn bytes_back(&self, b: Object) -> Result<RawVal, <T as CheckedEnv>::Error>
fn bytes_back(&self, b: Object) -> Result<RawVal, <T as CheckedEnv>::Error>
Bytes object. Traps if the Bytes is emptysource§fn bytes_insert(
&self,
b: Object,
i: RawVal,
u: RawVal
) -> Result<Object, <T as CheckedEnv>::Error>
fn bytes_insert(
&self,
b: Object,
i: RawVal,
u: RawVal
) -> Result<Object, <T as CheckedEnv>::Error>
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,
b1: Object,
b2: Object
) -> Result<Object, <T as CheckedEnv>::Error>
fn bytes_append(
&self,
b1: Object,
b2: Object
) -> Result<Object, <T as CheckedEnv>::Error>
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,
b: Object,
start: RawVal,
end: RawVal
) -> Result<Object, <T as CheckedEnv>::Error>
fn bytes_slice(
&self,
b: Object,
start: RawVal,
end: RawVal
) -> Result<Object, <T as CheckedEnv>::Error>
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.fn hash_from_bytes(&self, x: Object) -> Result<Object, <T as CheckedEnv>::Error>
fn hash_to_bytes(&self, x: Object) -> Result<Object, <T as CheckedEnv>::Error>
fn public_key_from_bytes(
&self,
x: Object
) -> Result<Object, <T as CheckedEnv>::Error>
fn public_key_to_bytes(
&self,
x: Object
) -> Result<Object, <T as CheckedEnv>::Error>
fn compute_hash_sha256(
&self,
x: Object
) -> Result<Object, <T as CheckedEnv>::Error>
fn verify_sig_ed25519(
&self,
x: Object,
k: Object,
s: Object
) -> Result<RawVal, <T as CheckedEnv>::Error>
source§fn account_get_low_threshold(
&self,
a: Object
) -> Result<RawVal, <T as CheckedEnv>::Error>
fn account_get_low_threshold(
&self,
a: Object
) -> Result<RawVal, <T as CheckedEnv>::Error>
a (a is AccountId). Traps if no such account exists.source§fn account_get_medium_threshold(
&self,
a: Object
) -> Result<RawVal, <T as CheckedEnv>::Error>
fn account_get_medium_threshold(
&self,
a: Object
) -> Result<RawVal, <T as CheckedEnv>::Error>
a (a is AccountId). Traps if no such account exists.source§fn account_get_high_threshold(
&self,
a: Object
) -> Result<RawVal, <T as CheckedEnv>::Error>
fn account_get_high_threshold(
&self,
a: Object
) -> Result<RawVal, <T as CheckedEnv>::Error>
a (a is AccountId). Traps if no such account exists.source§fn account_get_signer_weight(
&self,
a: Object,
s: Object
) -> Result<RawVal, <T as CheckedEnv>::Error>
fn account_get_signer_weight(
&self,
a: Object,
s: Object
) -> Result<RawVal, <T as CheckedEnv>::Error>
s (s is Bytes) on the account with ID a (a is AccountId). Returns the master weight if the signer is the master, and returns 0 if no such signer exists. Traps if no such account exists.source§fn account_exists(&self, a: Object) -> Result<RawVal, <T as CheckedEnv>::Error>
fn account_exists(&self, a: Object) -> Result<RawVal, <T as CheckedEnv>::Error>
a (a is AccountId) of an account, check if it exists. Returns (SCStatic) TRUE/FALSE.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, 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<E> Compare<Object> for Ewhere
E: CheckedEnv,
impl<E> Compare<Object> for Ewhere
E: CheckedEnv,
source§impl<E> Compare<RawVal> for Ewhere
E: CheckedEnv,
impl<E> Compare<RawVal> for Ewhere
E: CheckedEnv,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
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 + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.source§impl<T> Env for Twhere
T: CheckedEnv + EnvBase,
impl<T> Env for Twhere
T: CheckedEnv + EnvBase,
source§fn log_value(&self, v: RawVal) -> RawVal
fn log_value(&self, v: RawVal) -> RawVal
source§fn get_invoking_contract(&self) -> Object
fn get_invoking_contract(&self) -> Object
Bytes of the contract which invoked the running contract. Traps if the running contract was not invoked by a contract.fn obj_cmp(&self, a: RawVal, b: RawVal) -> i64
source§fn contract_event(&self, topics: Object, data: RawVal) -> RawVal
fn contract_event(&self, topics: Object, data: RawVal) -> RawVal
topics is expected to be a SCVec with length <= 4 that cannot contain Vec, Map, or Bytes with length > 32 On success, returns an SCStatus::Ok.source§fn get_current_contract(&self) -> Object
fn get_current_contract(&self) -> Object
Bytes of the contract which invoked the running contract. Traps if the running contract was not invoked by a contract.source§fn get_ledger_version(&self) -> RawVal
fn get_ledger_version(&self) -> RawVal
source§fn get_ledger_sequence(&self) -> RawVal
fn get_ledger_sequence(&self) -> RawVal
source§fn get_ledger_timestamp(&self) -> Object
fn get_ledger_timestamp(&self) -> Object
source§fn get_ledger_network_passphrase(&self) -> Object
fn get_ledger_network_passphrase(&self) -> Object
Bytes.source§fn get_current_call_stack(&self) -> Object
fn get_current_call_stack(&self) -> Object
source§fn fail_with_status(&self, status: Status) -> RawVal
fn fail_with_status(&self, status: Status) -> RawVal
ScStatusType::ContractError. Does not actually return.source§fn log_fmt_values(&self, fmt: Object, args: Object) -> RawVal
fn log_fmt_values(&self, fmt: Object, args: Object) -> RawVal
source§fn get_invoker_type(&self) -> u64
fn get_invoker_type(&self) -> u64
source§fn get_invoking_account(&self) -> Object
fn get_invoking_account(&self) -> Object
source§fn get_ledger_network_id(&self) -> Object
fn get_ledger_network_id(&self) -> Object
Bytes. The value is always 32 bytes in length.source§fn obj_from_u64(&self, v: u64) -> Object
fn obj_from_u64(&self, v: u64) -> Object
source§fn obj_to_u64(&self, obj: Object) -> u64
fn obj_to_u64(&self, obj: Object) -> u64
source§fn obj_from_i64(&self, v: i64) -> Object
fn obj_from_i64(&self, v: i64) -> Object
source§fn obj_to_i64(&self, obj: Object) -> i64
fn obj_to_i64(&self, obj: Object) -> i64
source§fn obj_from_u128_pieces(&self, lo: u64, hi: u64) -> Object
fn obj_from_u128_pieces(&self, lo: u64, hi: u64) -> Object
source§fn obj_to_u128_lo64(&self, obj: Object) -> u64
fn obj_to_u128_lo64(&self, obj: Object) -> u64
source§fn obj_to_u128_hi64(&self, obj: Object) -> u64
fn obj_to_u128_hi64(&self, obj: Object) -> u64
source§fn obj_from_i128_pieces(&self, lo: u64, hi: u64) -> Object
fn obj_from_i128_pieces(&self, lo: u64, hi: u64) -> Object
source§fn obj_to_i128_lo64(&self, obj: Object) -> u64
fn obj_to_i128_lo64(&self, obj: Object) -> u64
source§fn obj_to_i128_hi64(&self, obj: Object) -> u64
fn obj_to_i128_hi64(&self, obj: Object) -> u64
source§fn map_put(&self, m: Object, k: RawVal, v: RawVal) -> Object
fn map_put(&self, m: Object, k: RawVal, v: RawVal) -> Object
source§fn map_get(&self, m: Object, k: RawVal) -> RawVal
fn map_get(&self, m: Object, k: RawVal) -> RawVal
source§fn map_del(&self, m: Object, k: RawVal) -> Object
fn map_del(&self, m: Object, k: RawVal) -> Object
source§fn map_has(&self, m: Object, k: RawVal) -> RawVal
fn map_has(&self, m: Object, k: RawVal) -> RawVal
source§fn map_prev_key(&self, m: Object, k: RawVal) -> RawVal
fn map_prev_key(&self, m: Object, k: RawVal) -> RawVal
source§fn map_next_key(&self, m: Object, k: RawVal) -> RawVal
fn map_next_key(&self, m: Object, k: RawVal) -> RawVal
source§fn map_min_key(&self, m: Object) -> RawVal
fn map_min_key(&self, m: Object) -> RawVal
source§fn map_max_key(&self, m: Object) -> RawVal
fn map_max_key(&self, m: Object) -> RawVal
source§fn map_keys(&self, m: Object) -> Object
fn map_keys(&self, m: Object) -> Object
source§fn map_values(&self, m: Object) -> Object
fn map_values(&self, m: Object) -> Object
source§fn vec_new(&self, c: RawVal) -> Object
fn vec_new(&self, c: RawVal) -> Object
c. If c is ScStatic::Void, no hint is assumed and the new vector is empty. Otherwise, c is parsed as an u32 that represents the initial capacity of the new vector.source§fn vec_put(&self, v: Object, i: RawVal, x: RawVal) -> Object
fn vec_put(&self, v: Object, i: RawVal, x: RawVal) -> Object
i in the vector. Return the new vector. Trap if the index is out of bounds.source§fn vec_get(&self, v: Object, i: RawVal) -> RawVal
fn vec_get(&self, v: Object, i: RawVal) -> RawVal
i of the vector. Traps if the index is out of bound.source§fn vec_del(&self, v: Object, i: RawVal) -> Object
fn vec_del(&self, v: Object, i: RawVal) -> Object
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, v: Object, x: RawVal) -> Object
fn vec_push_front(&self, v: Object, x: RawVal) -> Object
source§fn vec_pop_front(&self, v: Object) -> Object
fn vec_pop_front(&self, v: Object) -> Object
source§fn vec_push_back(&self, v: Object, x: RawVal) -> Object
fn vec_push_back(&self, v: Object, x: RawVal) -> Object
source§fn vec_pop_back(&self, v: Object) -> Object
fn vec_pop_back(&self, v: Object) -> Object
source§fn vec_front(&self, v: Object) -> RawVal
fn vec_front(&self, v: Object) -> RawVal
source§fn vec_back(&self, v: Object) -> RawVal
fn vec_back(&self, v: Object) -> RawVal
source§fn vec_insert(&self, v: Object, i: RawVal, x: RawVal) -> Object
fn vec_insert(&self, v: Object, i: RawVal, x: RawVal) -> Object
i within the vector, shifting all elements after it to the right. Traps if the index is out of boundsource§fn vec_append(&self, v1: Object, v2: Object) -> Object
fn vec_append(&self, v1: Object, v2: Object) -> Object
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, v: Object, start: RawVal, end: RawVal) -> Object
fn vec_slice(&self, v: Object, start: RawVal, end: RawVal) -> Object
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, v: Object, x: RawVal) -> RawVal
fn vec_first_index_of(&self, v: Object, x: RawVal) -> RawVal
ScStatic::Void.source§fn vec_last_index_of(&self, v: Object, x: RawVal) -> RawVal
fn vec_last_index_of(&self, v: Object, x: RawVal) -> RawVal
ScStatic::Void.source§fn vec_binary_search(&self, v: Object, x: RawVal) -> u64
fn vec_binary_search(&self, v: Object, x: RawVal) -> u64
fn put_contract_data(&self, k: RawVal, v: RawVal) -> RawVal
fn has_contract_data(&self, k: RawVal) -> RawVal
fn get_contract_data(&self, k: RawVal) -> RawVal
fn del_contract_data(&self, k: RawVal) -> RawVal
source§fn create_contract_from_contract(&self, wasm_hash: Object, salt: Object) -> Object
fn create_contract_from_contract(&self, wasm_hash: Object, salt: Object) -> Object
wasm_hash must be a hash of the contract code that has already been installed on this network. salt is used to create a unique contract id.source§fn call(&self, contract: Object, func: Symbol, args: Object) -> RawVal
fn call(&self, contract: Object, func: Symbol, args: Object) -> RawVal
args. If the call is successful, forwards the result of the called function. Traps otherwise.source§fn try_call(&self, contract: Object, func: Symbol, args: Object) -> RawVal
fn try_call(&self, contract: Object, func: Symbol, args: Object) -> RawVal
args. Returns: - if successful, result of the called function. - otherwise, an SCStatus containing the error status code.source§fn serialize_to_bytes(&self, v: RawVal) -> Object
fn serialize_to_bytes(&self, v: RawVal) -> Object
Bytes object.source§fn deserialize_from_bytes(&self, b: Object) -> RawVal
fn deserialize_from_bytes(&self, b: Object) -> RawVal
Bytes object to get back the (SC)Val.source§fn bytes_copy_to_linear_memory(
&self,
b: Object,
b_pos: RawVal,
lm_pos: RawVal,
len: RawVal
) -> RawVal
fn bytes_copy_to_linear_memory(
&self,
b: Object,
b_pos: RawVal,
lm_pos: RawVal,
len: RawVal
) -> RawVal
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,
b: Object,
b_pos: RawVal,
lm_pos: RawVal,
len: RawVal
) -> Object
fn bytes_copy_from_linear_memory(
&self,
b: Object,
b_pos: RawVal,
lm_pos: RawVal,
len: RawVal
) -> Object
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, lm_pos: RawVal, len: RawVal) -> Object
fn bytes_new_from_linear_memory(&self, lm_pos: RawVal, len: RawVal) -> Object
Bytes object initialized with bytes copied from a linear memory slice specified at position lm_pos with length len.source§fn bytes_put(&self, b: Object, i: RawVal, u: RawVal) -> Object
fn bytes_put(&self, b: Object, i: RawVal, u: RawVal) -> Object
i in the Bytes object. Return the new Bytes. Trap if the index is out of bounds.source§fn bytes_get(&self, b: Object, i: RawVal) -> RawVal
fn bytes_get(&self, b: Object, i: RawVal) -> RawVal
i of the Bytes object. Traps if the index is out of bound.source§fn bytes_del(&self, b: Object, i: RawVal) -> Object
fn bytes_del(&self, b: Object, i: RawVal) -> Object
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_push(&self, b: Object, u: RawVal) -> Object
fn bytes_push(&self, b: Object, u: RawVal) -> Object
Bytes object.source§fn bytes_pop(&self, b: Object) -> Object
fn bytes_pop(&self, b: Object) -> Object
Bytes object and returns the new Bytes. Traps if original Bytes is empty.source§fn bytes_front(&self, b: Object) -> RawVal
fn bytes_front(&self, b: Object) -> RawVal
Bytes object. Traps if the Bytes is emptysource§fn bytes_back(&self, b: Object) -> RawVal
fn bytes_back(&self, b: Object) -> RawVal
Bytes object. Traps if the Bytes is emptysource§fn bytes_insert(&self, b: Object, i: RawVal, u: RawVal) -> Object
fn bytes_insert(&self, b: Object, i: RawVal, u: RawVal) -> Object
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, b1: Object, b2: Object) -> Object
fn bytes_append(&self, b1: Object, b2: Object) -> Object
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, b: Object, start: RawVal, end: RawVal) -> Object
fn bytes_slice(&self, b: Object, start: RawVal, end: RawVal) -> Object
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.fn hash_from_bytes(&self, x: Object) -> Object
fn hash_to_bytes(&self, x: Object) -> Object
fn public_key_from_bytes(&self, x: Object) -> Object
fn public_key_to_bytes(&self, x: Object) -> Object
fn compute_hash_sha256(&self, x: Object) -> Object
fn verify_sig_ed25519(&self, x: Object, k: Object, s: Object) -> RawVal
source§fn account_get_low_threshold(&self, a: Object) -> RawVal
fn account_get_low_threshold(&self, a: Object) -> RawVal
a (a is AccountId). Traps if no such account exists.source§fn account_get_medium_threshold(&self, a: Object) -> RawVal
fn account_get_medium_threshold(&self, a: Object) -> RawVal
a (a is AccountId). Traps if no such account exists.source§fn account_get_high_threshold(&self, a: Object) -> RawVal
fn account_get_high_threshold(&self, a: Object) -> RawVal
a (a is AccountId). Traps if no such account exists.source§fn account_get_signer_weight(&self, a: Object, s: Object) -> RawVal
fn account_get_signer_weight(&self, a: Object, s: Object) -> RawVal
s (s is Bytes) on the account with ID a (a is AccountId). Returns the master weight if the signer is the master, and returns 0 if no such signer exists. Traps if no such account exists.source§fn account_exists(&self, a: Object) -> RawVal
fn account_exists(&self, a: Object) -> RawVal
a (a is AccountId) of an account, check if it exists. Returns (SCStatic) TRUE/FALSE.