Struct scrypto_test::prelude::SystemService
source · pub struct SystemService<'a, Y, V>{
pub api: &'a mut Y,
pub phantom: PhantomData<V>,
}
Expand description
Provided to upper layer for invoking lower layer service
Fields§
§api: &'a mut Y
§phantom: PhantomData<V>
Implementations§
source§impl<'a, Y, V> SystemService<'a, Y, V>
impl<'a, Y, V> SystemService<'a, Y, V>
pub fn new(api: &'a mut Y) -> SystemService<'a, Y, V>
source§impl<'a, Y, V> SystemService<'a, Y, V>
impl<'a, Y, V> SystemService<'a, Y, V>
pub fn get_blueprint_default_definition( &mut self, blueprint_id: BlueprintId ) -> Result<Rc<BlueprintDefinition>, RuntimeError>
pub fn load_blueprint_definition( &mut self, package_address: PackageAddress, bp_version_key: &BlueprintVersionKey ) -> Result<Rc<BlueprintDefinition>, RuntimeError>
pub fn prepare_global_address( &mut self, blueprint_id: BlueprintId, global_address: GlobalAddress ) -> Result<GlobalAddressReservation, RuntimeError>
pub fn get_node_type_info( &mut self, node_id: &NodeId ) -> Result<TypeInfoSubstate, RuntimeError>
pub fn get_blueprint_info( &mut self, node_id: &NodeId, module_id: Option<AttachedModuleId> ) -> Result<BlueprintInfo, RuntimeError>
pub fn get_actor_type_target( &mut self ) -> Result<BlueprintTypeTarget, RuntimeError>
pub fn current_actor(&mut self) -> Actor
pub fn get_object_info( &mut self, node_id: &NodeId ) -> Result<ObjectInfo, RuntimeError>
pub fn is_feature_enabled( &mut self, node_id: &NodeId, module_id: Option<AttachedModuleId>, feature: &str ) -> Result<bool, RuntimeError>
source§impl<'a, Y, V> SystemService<'a, Y, V>
impl<'a, Y, V> SystemService<'a, Y, V>
sourcepub fn validate_bp_generic_args(
&mut self,
blueprint_interface: &BlueprintInterface,
schemas: &IndexMap<SchemaHash, VersionedSchema<ScryptoCustomSchema>>,
generic_substitutions: &Vec<GenericSubstitution>
) -> Result<(), TypeCheckError>
pub fn validate_bp_generic_args( &mut self, blueprint_interface: &BlueprintInterface, schemas: &IndexMap<SchemaHash, VersionedSchema<ScryptoCustomSchema>>, generic_substitutions: &Vec<GenericSubstitution> ) -> Result<(), TypeCheckError>
Validate that the type substitutions match the generic definition of a given blueprint
sourcepub fn validate_kv_store_generic_args(
&mut self,
schemas: &IndexMap<SchemaHash, VersionedSchema<ScryptoCustomSchema>>,
key: &GenericSubstitution,
value: &GenericSubstitution
) -> Result<(), TypeCheckError>
pub fn validate_kv_store_generic_args( &mut self, schemas: &IndexMap<SchemaHash, VersionedSchema<ScryptoCustomSchema>>, key: &GenericSubstitution, value: &GenericSubstitution ) -> Result<(), TypeCheckError>
Validate that the type substitutions for a kv store exist in a given schema
pub fn get_payload_schema( &mut self, target: &BlueprintTypeTarget, payload_identifier: &BlueprintPayloadIdentifier ) -> Result<(Rc<VersionedSchema<ScryptoCustomSchema>>, LocalTypeId, bool, bool, SchemaOrigin), RuntimeError>
sourcepub fn validate_blueprint_payload(
&mut self,
target: &BlueprintTypeTarget,
payload_identifier: BlueprintPayloadIdentifier,
payload: &[u8]
) -> Result<(), RuntimeError>
pub fn validate_blueprint_payload( &mut self, target: &BlueprintTypeTarget, payload_identifier: BlueprintPayloadIdentifier, payload: &[u8] ) -> Result<(), RuntimeError>
Validate that a blueprint payload matches the blueprint’s definition of that payload
sourcepub fn validate_blueprint_kv_collection(
&mut self,
target: &BlueprintTypeTarget,
collection_index: u8,
payloads: &[(&Vec<u8>, &Vec<u8>)]
) -> Result<PartitionDescription, RuntimeError>
pub fn validate_blueprint_kv_collection( &mut self, target: &BlueprintTypeTarget, collection_index: u8, payloads: &[(&Vec<u8>, &Vec<u8>)] ) -> Result<PartitionDescription, RuntimeError>
Validate that a blueprint kv collection payloads match the blueprint’s definition
sourcepub fn validate_kv_store_payload(
&mut self,
target: &KVStoreTypeTarget,
payload_identifier: KeyOrValue,
payload: &[u8]
) -> Result<(), RuntimeError>
pub fn validate_kv_store_payload( &mut self, target: &KVStoreTypeTarget, payload_identifier: KeyOrValue, payload: &[u8] ) -> Result<(), RuntimeError>
Validate that a key value payload matches the key value store’s definition of that payload
pub fn get_blueprint_type_schema( &mut self, type_id: &BlueprintTypeIdentifier ) -> Result<(Rc<VersionedSchema<ScryptoCustomSchema>>, ScopedTypeId), RuntimeError>
Trait Implementations§
source§impl<'a, Y, V> ClientActorApi<RuntimeError> for SystemService<'a, Y, V>
impl<'a, Y, V> ClientActorApi<RuntimeError> for SystemService<'a, Y, V>
source§fn actor_get_blueprint_id(&mut self) -> Result<BlueprintId, RuntimeError>
fn actor_get_blueprint_id(&mut self) -> Result<BlueprintId, RuntimeError>
Retrieve the current blueprint id
source§fn actor_get_node_id(&mut self, ref_handle: u32) -> Result<NodeId, RuntimeError>
fn actor_get_node_id(&mut self, ref_handle: u32) -> Result<NodeId, RuntimeError>
Retrieve the current method actor’s node id
source§fn actor_is_feature_enabled(
&mut self,
object_handle: u32,
feature: &str
) -> Result<bool, RuntimeError>
fn actor_is_feature_enabled( &mut self, object_handle: u32, feature: &str ) -> Result<bool, RuntimeError>
Check if a feature is enabled for a given object
source§fn actor_open_field(
&mut self,
object_handle: u32,
field_index: u8,
flags: LockFlags
) -> Result<u32, RuntimeError>
fn actor_open_field( &mut self, object_handle: u32, field_index: u8, flags: LockFlags ) -> Result<u32, RuntimeError>
Open a field in a given object for reading/writing
source§fn actor_emit_event(
&mut self,
event_name: String,
event_data: Vec<u8>,
event_flags: EventFlags
) -> Result<(), RuntimeError>
fn actor_emit_event( &mut self, event_name: String, event_data: Vec<u8>, event_flags: EventFlags ) -> Result<(), RuntimeError>
Emits an event of the current actor
source§impl<'a, Y, V> ClientActorIndexApi<RuntimeError> for SystemService<'a, Y, V>
impl<'a, Y, V> ClientActorIndexApi<RuntimeError> for SystemService<'a, Y, V>
source§fn actor_index_insert(
&mut self,
object_handle: u32,
collection_index: u8,
key: Vec<u8>,
buffer: Vec<u8>
) -> Result<(), RuntimeError>
fn actor_index_insert( &mut self, object_handle: u32, collection_index: u8, key: Vec<u8>, buffer: Vec<u8> ) -> Result<(), RuntimeError>
Inserts an entry into an index
source§fn actor_index_remove(
&mut self,
object_handle: u32,
collection_index: u8,
key: Vec<u8>
) -> Result<Option<Vec<u8>>, RuntimeError>
fn actor_index_remove( &mut self, object_handle: u32, collection_index: u8, key: Vec<u8> ) -> Result<Option<Vec<u8>>, RuntimeError>
Removes an entry from an index
source§fn actor_index_scan_keys(
&mut self,
object_handle: u32,
collection_index: u8,
limit: u32
) -> Result<Vec<Vec<u8>>, RuntimeError>
fn actor_index_scan_keys( &mut self, object_handle: u32, collection_index: u8, limit: u32 ) -> Result<Vec<Vec<u8>>, RuntimeError>
Scans arbitrary elements of count from an index
source§fn actor_index_drain(
&mut self,
object_handle: u32,
collection_index: u8,
limit: u32
) -> Result<Vec<(Vec<u8>, Vec<u8>)>, RuntimeError>
fn actor_index_drain( &mut self, object_handle: u32, collection_index: u8, limit: u32 ) -> Result<Vec<(Vec<u8>, Vec<u8>)>, RuntimeError>
Removes and returns arbitrary elements of count from an index
source§fn actor_index_insert_typed<K, V>(
&mut self,
object_handle: u32,
collection_index: u8,
key: K,
value: V
) -> Result<(), E>where
K: ScryptoEncode,
V: ScryptoEncode,
fn actor_index_insert_typed<K, V>(
&mut self,
object_handle: u32,
collection_index: u8,
key: K,
value: V
) -> Result<(), E>where
K: ScryptoEncode,
V: ScryptoEncode,
Inserts an entry into an index
source§fn actor_index_remove_typed<V>(
&mut self,
object_handle: u32,
collection_index: u8,
key: Vec<u8>
) -> Result<Option<V>, E>where
V: ScryptoDecode,
fn actor_index_remove_typed<V>(
&mut self,
object_handle: u32,
collection_index: u8,
key: Vec<u8>
) -> Result<Option<V>, E>where
V: ScryptoDecode,
Removes an entry from an index
source§fn actor_index_scan_keys_typed<K>(
&mut self,
object_handle: u32,
collection_index: u8,
limit: u32
) -> Result<Vec<K>, E>where
K: ScryptoDecode,
fn actor_index_scan_keys_typed<K>(
&mut self,
object_handle: u32,
collection_index: u8,
limit: u32
) -> Result<Vec<K>, E>where
K: ScryptoDecode,
Scans arbitrary elements of count from an index
source§fn actor_index_drain_typed<K, V>(
&mut self,
object_handle: u32,
collection_index: u8,
limit: u32
) -> Result<Vec<(K, V)>, E>where
K: ScryptoDecode,
V: ScryptoDecode,
fn actor_index_drain_typed<K, V>(
&mut self,
object_handle: u32,
collection_index: u8,
limit: u32
) -> Result<Vec<(K, V)>, E>where
K: ScryptoDecode,
V: ScryptoDecode,
Removes and returns arbitrary elements of count from an index
source§impl<'a, Y, V> ClientActorKeyValueEntryApi<RuntimeError> for SystemService<'a, Y, V>
impl<'a, Y, V> ClientActorKeyValueEntryApi<RuntimeError> for SystemService<'a, Y, V>
source§fn actor_open_key_value_entry(
&mut self,
object_handle: u32,
collection_index: u8,
key: &Vec<u8>,
flags: LockFlags
) -> Result<u32, RuntimeError>
fn actor_open_key_value_entry( &mut self, object_handle: u32, collection_index: u8, key: &Vec<u8>, flags: LockFlags ) -> Result<u32, RuntimeError>
If the key value entry doesn’t exist, it uses the default “Option::None”
fn actor_remove_key_value_entry( &mut self, object_handle: u32, collection_index: u8, key: &Vec<u8> ) -> Result<Vec<u8>, RuntimeError>
fn actor_remove_key_value_entry_typed<V>(
&mut self,
object_handle: u32,
collection_index: u8,
key: &Vec<u8>
) -> Result<Option<V>, E>where
V: ScryptoDecode,
source§impl<'a, Y, V> ClientActorSortedIndexApi<RuntimeError> for SystemService<'a, Y, V>
impl<'a, Y, V> ClientActorSortedIndexApi<RuntimeError> for SystemService<'a, Y, V>
source§fn actor_sorted_index_insert(
&mut self,
object_handle: u32,
collection_index: u8,
sorted_key: ([u8; 2], Vec<u8>),
buffer: Vec<u8>
) -> Result<(), RuntimeError>
fn actor_sorted_index_insert( &mut self, object_handle: u32, collection_index: u8, sorted_key: ([u8; 2], Vec<u8>), buffer: Vec<u8> ) -> Result<(), RuntimeError>
Inserts an entry into a sorted index
source§fn actor_sorted_index_remove(
&mut self,
object_handle: u32,
collection_index: u8,
sorted_key: &([u8; 2], Vec<u8>)
) -> Result<Option<Vec<u8>>, RuntimeError>
fn actor_sorted_index_remove( &mut self, object_handle: u32, collection_index: u8, sorted_key: &([u8; 2], Vec<u8>) ) -> Result<Option<Vec<u8>>, RuntimeError>
Removes an entry from a sorted index
source§fn actor_sorted_index_scan(
&mut self,
object_handle: u32,
collection_index: u8,
limit: u32
) -> Result<Vec<(([u8; 2], Vec<u8>), Vec<u8>)>, RuntimeError>
fn actor_sorted_index_scan( &mut self, object_handle: u32, collection_index: u8, limit: u32 ) -> Result<Vec<(([u8; 2], Vec<u8>), Vec<u8>)>, RuntimeError>
Scans the first elements of count from a sorted index
source§fn actor_sorted_index_insert_typed<V>(
&mut self,
object_handle: u32,
collection_index: u8,
sorted_key: ([u8; 2], Vec<u8>),
value: V
) -> Result<(), E>where
V: ScryptoEncode,
fn actor_sorted_index_insert_typed<V>(
&mut self,
object_handle: u32,
collection_index: u8,
sorted_key: ([u8; 2], Vec<u8>),
value: V
) -> Result<(), E>where
V: ScryptoEncode,
Inserts an entry into a sorted index
source§fn actor_sorted_index_remove_typed<V>(
&mut self,
object_handle: u32,
collection_index: u8,
sorted_key: &([u8; 2], Vec<u8>)
) -> Result<Option<V>, E>where
V: ScryptoDecode,
fn actor_sorted_index_remove_typed<V>(
&mut self,
object_handle: u32,
collection_index: u8,
sorted_key: &([u8; 2], Vec<u8>)
) -> Result<Option<V>, E>where
V: ScryptoDecode,
Removes an entry from a sorted index
source§fn actor_sorted_index_scan_typed<K, V>(
&mut self,
object_handle: u32,
collection_index: u8,
count: u32
) -> Result<Vec<(K, V)>, E>where
K: ScryptoDecode,
V: ScryptoDecode,
fn actor_sorted_index_scan_typed<K, V>(
&mut self,
object_handle: u32,
collection_index: u8,
count: u32
) -> Result<Vec<(K, V)>, E>where
K: ScryptoDecode,
V: ScryptoDecode,
Scans the first elements of count from a sorted index
source§impl<'a, Y, V> ClientBlueprintApi<RuntimeError> for SystemService<'a, Y, V>
impl<'a, Y, V> ClientBlueprintApi<RuntimeError> for SystemService<'a, Y, V>
source§fn call_function(
&mut self,
package_address: PackageAddress,
blueprint_name: &str,
function_name: &str,
args: Vec<u8>
) -> Result<Vec<u8>, RuntimeError>
fn call_function( &mut self, package_address: PackageAddress, blueprint_name: &str, function_name: &str, args: Vec<u8> ) -> Result<Vec<u8>, RuntimeError>
Calls a function on a blueprint
fn resolve_blueprint_type( &mut self, blueprint_type_id: &BlueprintTypeIdentifier ) -> Result<(Rc<VersionedSchema<ScryptoCustomSchema>>, ScopedTypeId), RuntimeError>
source§impl<'a, Y, V> ClientCostingApi<RuntimeError> for SystemService<'a, Y, V>
impl<'a, Y, V> ClientCostingApi<RuntimeError> for SystemService<'a, Y, V>
fn consume_cost_units( &mut self, costing_entry: ClientCostingEntry<'_> ) -> Result<(), RuntimeError>
source§fn start_lock_fee(&mut self, amount: Decimal) -> Result<bool, RuntimeError>
fn start_lock_fee(&mut self, amount: Decimal) -> Result<bool, RuntimeError>
Check if costing is enabled.
source§fn lock_fee(&mut self, locked_fee: LiquidFungibleResource, contingent: bool)
fn lock_fee(&mut self, locked_fee: LiquidFungibleResource, contingent: bool)
Add cost units to the reserve. This should never fail.
fn execution_cost_unit_limit(&mut self) -> Result<u32, RuntimeError>
fn execution_cost_unit_price(&mut self) -> Result<Decimal, RuntimeError>
fn finalization_cost_unit_limit(&mut self) -> Result<u32, RuntimeError>
fn finalization_cost_unit_price(&mut self) -> Result<Decimal, RuntimeError>
fn usd_price(&mut self) -> Result<Decimal, RuntimeError>
fn max_per_function_royalty_in_xrd(&mut self) -> Result<Decimal, RuntimeError>
fn tip_percentage(&mut self) -> Result<u32, RuntimeError>
fn fee_balance(&mut self) -> Result<Decimal, RuntimeError>
source§impl<'a, Y, V> ClientCryptoUtilsApi<RuntimeError> for SystemService<'a, Y, V>
impl<'a, Y, V> ClientCryptoUtilsApi<RuntimeError> for SystemService<'a, Y, V>
fn bls12381_v1_verify( &mut self, message: &[u8], public_key: &Bls12381G1PublicKey, signature: &Bls12381G2Signature ) -> Result<u32, RuntimeError>
fn bls12381_v1_aggregate_verify( &mut self, pub_keys_and_msgs: &[(Bls12381G1PublicKey, Vec<u8>)], signature: &Bls12381G2Signature ) -> Result<u32, RuntimeError>
fn bls12381_v1_fast_aggregate_verify( &mut self, message: &[u8], public_keys: &[Bls12381G1PublicKey], signature: &Bls12381G2Signature ) -> Result<u32, RuntimeError>
fn bls12381_g2_signature_aggregate( &mut self, signatures: &[Bls12381G2Signature] ) -> Result<Bls12381G2Signature, RuntimeError>
fn keccak256_hash(&mut self, data: &[u8]) -> Result<Hash, RuntimeError>
source§impl<'a, Y, V> ClientExecutionTraceApi<RuntimeError> for SystemService<'a, Y, V>
impl<'a, Y, V> ClientExecutionTraceApi<RuntimeError> for SystemService<'a, Y, V>
fn update_instruction_index( &mut self, new_index: usize ) -> Result<(), RuntimeError>
source§impl<'a, Y, V> ClientFieldApi<RuntimeError> for SystemService<'a, Y, V>
impl<'a, Y, V> ClientFieldApi<RuntimeError> for SystemService<'a, Y, V>
fn field_read(&mut self, handle: u32) -> Result<Vec<u8>, RuntimeError>
fn field_write( &mut self, handle: u32, buffer: Vec<u8> ) -> Result<(), RuntimeError>
fn field_lock(&mut self, handle: u32) -> Result<(), RuntimeError>
fn field_close(&mut self, handle: u32) -> Result<(), RuntimeError>
fn field_read_typed<S>(&mut self, handle: u32) -> Result<S, E>where
S: ScryptoDecode,
fn field_write_typed<S>(&mut self, handle: u32, substate: &S) -> Result<(), E>where
S: ScryptoEncode,
source§impl<'a, Y, V> ClientKeyValueEntryApi<RuntimeError> for SystemService<'a, Y, V>
impl<'a, Y, V> ClientKeyValueEntryApi<RuntimeError> for SystemService<'a, Y, V>
fn key_value_entry_get(&mut self, handle: u32) -> Result<Vec<u8>, RuntimeError>
fn key_value_entry_lock(&mut self, handle: u32) -> Result<(), RuntimeError>
fn key_value_entry_remove( &mut self, handle: u32 ) -> Result<Vec<u8>, RuntimeError>
fn key_value_entry_set( &mut self, handle: u32, buffer: Vec<u8> ) -> Result<(), RuntimeError>
fn key_value_entry_close(&mut self, handle: u32) -> Result<(), RuntimeError>
fn key_value_entry_get_typed<S>(&mut self, handle: u32) -> Result<Option<S>, E>where
S: ScryptoDecode,
fn key_value_entry_set_typed<S>(
&mut self,
handle: u32,
value: S
) -> Result<(), E>where
S: ScryptoEncode,
source§impl<'a, Y, V> ClientKeyValueStoreApi<RuntimeError> for SystemService<'a, Y, V>
impl<'a, Y, V> ClientKeyValueStoreApi<RuntimeError> for SystemService<'a, Y, V>
source§fn key_value_store_new(
&mut self,
data_schema: KeyValueStoreDataSchema
) -> Result<NodeId, RuntimeError>
fn key_value_store_new( &mut self, data_schema: KeyValueStoreDataSchema ) -> Result<NodeId, RuntimeError>
Creates a new key value store with a given schema
source§fn key_value_store_open_entry(
&mut self,
node_id: &NodeId,
key: &Vec<u8>,
flags: LockFlags
) -> Result<u32, RuntimeError>
fn key_value_store_open_entry( &mut self, node_id: &NodeId, key: &Vec<u8>, flags: LockFlags ) -> Result<u32, RuntimeError>
Lock a key value store entry for reading/writing
fn key_value_store_remove_entry( &mut self, node_id: &NodeId, key: &Vec<u8> ) -> Result<Vec<u8>, RuntimeError>
source§impl<'a, Y, V> ClientObjectApi<RuntimeError> for SystemService<'a, Y, V>
impl<'a, Y, V> ClientObjectApi<RuntimeError> for SystemService<'a, Y, V>
source§fn new_object(
&mut self,
blueprint_ident: &str,
features: Vec<&str>,
generic_args: GenericArgs,
fields: IndexMap<u8, FieldValue>,
kv_entries: IndexMap<u8, IndexMap<Vec<u8>, KVEntry>>
) -> Result<NodeId, RuntimeError>
fn new_object( &mut self, blueprint_ident: &str, features: Vec<&str>, generic_args: GenericArgs, fields: IndexMap<u8, FieldValue>, kv_entries: IndexMap<u8, IndexMap<Vec<u8>, KVEntry>> ) -> Result<NodeId, RuntimeError>
Creates a new object of a given blueprint type
source§fn allocate_global_address(
&mut self,
blueprint_id: BlueprintId
) -> Result<(GlobalAddressReservation, GlobalAddress), RuntimeError>
fn allocate_global_address( &mut self, blueprint_id: BlueprintId ) -> Result<(GlobalAddressReservation, GlobalAddress), RuntimeError>
Pre-allocates a global address, for a future globalization.
fn allocate_virtual_global_address( &mut self, blueprint_id: BlueprintId, global_address: GlobalAddress ) -> Result<GlobalAddressReservation, RuntimeError>
source§fn globalize(
&mut self,
node_id: NodeId,
modules: IndexMap<AttachedModuleId, NodeId>,
address_reservation: Option<GlobalAddressReservation>
) -> Result<GlobalAddress, RuntimeError>
fn globalize( &mut self, node_id: NodeId, modules: IndexMap<AttachedModuleId, NodeId>, address_reservation: Option<GlobalAddressReservation> ) -> Result<GlobalAddress, RuntimeError>
Moves an object currently in the heap into the global space making
it accessible to all with the provided global address.
fn globalize_with_address_and_create_inner_object_and_emit_event( &mut self, node_id: NodeId, modules: IndexMap<AttachedModuleId, NodeId>, address_reservation: GlobalAddressReservation, inner_object_blueprint: &str, inner_object_fields: IndexMap<u8, FieldValue>, event_name: &str, event_data: Vec<u8> ) -> Result<(GlobalAddress, NodeId), RuntimeError>
source§fn call_method(
&mut self,
receiver: &NodeId,
method_name: &str,
args: Vec<u8>
) -> Result<Vec<u8>, RuntimeError>
fn call_method( &mut self, receiver: &NodeId, method_name: &str, args: Vec<u8> ) -> Result<Vec<u8>, RuntimeError>
Calls a method on an object
fn call_direct_access_method( &mut self, receiver: &NodeId, method_name: &str, args: Vec<u8> ) -> Result<Vec<u8>, RuntimeError>
source§fn call_module_method(
&mut self,
receiver: &NodeId,
module_id: AttachedModuleId,
method_name: &str,
args: Vec<u8>
) -> Result<Vec<u8>, RuntimeError>
fn call_module_method( &mut self, receiver: &NodeId, module_id: AttachedModuleId, method_name: &str, args: Vec<u8> ) -> Result<Vec<u8>, RuntimeError>
Calls a method on an object module
source§fn get_blueprint_id(
&mut self,
node_id: &NodeId
) -> Result<BlueprintId, RuntimeError>
fn get_blueprint_id( &mut self, node_id: &NodeId ) -> Result<BlueprintId, RuntimeError>
Get the blueprint id of a visible object
source§fn get_outer_object(
&mut self,
node_id: &NodeId
) -> Result<GlobalAddress, RuntimeError>
fn get_outer_object( &mut self, node_id: &NodeId ) -> Result<GlobalAddress, RuntimeError>
Get the outer object of a visible object
fn get_reservation_address( &mut self, node_id: &NodeId ) -> Result<GlobalAddress, RuntimeError>
source§fn drop_object(
&mut self,
node_id: &NodeId
) -> Result<Vec<Vec<u8>>, RuntimeError>
fn drop_object( &mut self, node_id: &NodeId ) -> Result<Vec<Vec<u8>>, RuntimeError>
Drops an owned object, returns the fields of the object
source§fn new_simple_object(
&mut self,
blueprint_ident: &str,
fields: IndexMap<u8, FieldValue>
) -> Result<NodeId, E>
fn new_simple_object( &mut self, blueprint_ident: &str, fields: IndexMap<u8, FieldValue> ) -> Result<NodeId, E>
Creates a new simple blueprint object of a given blueprint type
source§impl<'a, Y, V> ClientTransactionRuntimeApi<RuntimeError> for SystemService<'a, Y, V>
impl<'a, Y, V> ClientTransactionRuntimeApi<RuntimeError> for SystemService<'a, Y, V>
fn get_transaction_hash(&mut self) -> Result<Hash, RuntimeError>
fn generate_ruid(&mut self) -> Result<[u8; 32], RuntimeError>
fn bech32_encode_address( &mut self, address: GlobalAddress ) -> Result<String, RuntimeError>
fn emit_log( &mut self, level: Level, message: String ) -> Result<(), RuntimeError>
fn panic(&mut self, message: String) -> Result<(), RuntimeError>
source§impl<'a, Y, V> KernelInternalApi<SystemConfig<V>> for SystemService<'a, Y, V>
impl<'a, Y, V> KernelInternalApi<SystemConfig<V>> for SystemService<'a, Y, V>
fn kernel_get_system_state(&mut self) -> SystemState<'_, SystemConfig<V>>
source§fn kernel_get_current_depth(&self) -> usize
fn kernel_get_current_depth(&self) -> usize
Gets the number of call frames that are currently in the call frame stack
source§fn kernel_get_node_visibility(&self, node_id: &NodeId) -> NodeVisibility
fn kernel_get_node_visibility(&self, node_id: &NodeId) -> NodeVisibility
Returns the visibility of a node
fn kernel_read_bucket(&mut self, bucket_id: &NodeId) -> Option<BucketSnapshot>
fn kernel_read_proof(&mut self, proof_id: &NodeId) -> Option<ProofSnapshot>
source§fn kernel_get_system(&mut self) -> &mut M
fn kernel_get_system(&mut self) -> &mut M
Retrieves data associated with the kernel upstream layer (system)
source§impl<'a, Y, V> KernelNodeApi for SystemService<'a, Y, V>
impl<'a, Y, V> KernelNodeApi for SystemService<'a, Y, V>
source§fn kernel_pin_node(&mut self, node_id: NodeId) -> Result<(), RuntimeError>
fn kernel_pin_node(&mut self, node_id: NodeId) -> Result<(), RuntimeError>
Pin a node to it’s current device.
source§fn kernel_drop_node(
&mut self,
node_id: &NodeId
) -> Result<DroppedNode, RuntimeError>
fn kernel_drop_node( &mut self, node_id: &NodeId ) -> Result<DroppedNode, RuntimeError>
Removes an RENode. Owned children will be possessed by the call frame. Read more
source§fn kernel_allocate_node_id(
&mut self,
entity_type: EntityType
) -> Result<NodeId, RuntimeError>
fn kernel_allocate_node_id( &mut self, entity_type: EntityType ) -> Result<NodeId, RuntimeError>
Allocates a new node id useable for create_node
source§fn kernel_create_node(
&mut self,
node_id: NodeId,
node_substates: BTreeMap<PartitionNumber, BTreeMap<SubstateKey, IndexedScryptoValue>>
) -> Result<(), RuntimeError>
fn kernel_create_node( &mut self, node_id: NodeId, node_substates: BTreeMap<PartitionNumber, BTreeMap<SubstateKey, IndexedScryptoValue>> ) -> Result<(), RuntimeError>
Creates a new RENode
fn kernel_create_node_from( &mut self, node_id: NodeId, partitions: BTreeMap<PartitionNumber, (NodeId, PartitionNumber)> ) -> Result<(), RuntimeError>
source§impl<'a, Y, V> KernelSubstateApi<SystemLockData> for SystemService<'a, Y, V>
impl<'a, Y, V> KernelSubstateApi<SystemLockData> for SystemService<'a, Y, V>
source§fn kernel_mark_substate_as_transient(
&mut self,
node_id: NodeId,
partition_num: PartitionNumber,
key: SubstateKey
) -> Result<(), RuntimeError>
fn kernel_mark_substate_as_transient( &mut self, node_id: NodeId, partition_num: PartitionNumber, key: SubstateKey ) -> Result<(), RuntimeError>
Marks a substate as transient, or a substate which was never and will never be persisted
source§fn kernel_open_substate_with_default<F>(
&mut self,
node_id: &NodeId,
partition_num: PartitionNumber,
substate_key: &SubstateKey,
flags: LockFlags,
default: Option<F>,
data: SystemLockData
) -> Result<u32, RuntimeError>where
F: FnOnce() -> IndexedScryptoValue,
fn kernel_open_substate_with_default<F>(
&mut self,
node_id: &NodeId,
partition_num: PartitionNumber,
substate_key: &SubstateKey,
flags: LockFlags,
default: Option<F>,
data: SystemLockData
) -> Result<u32, RuntimeError>where
F: FnOnce() -> IndexedScryptoValue,
Locks a substate to make available for reading and/or writing
source§fn kernel_get_lock_data(
&mut self,
lock_handle: u32
) -> Result<SystemLockData, RuntimeError>
fn kernel_get_lock_data( &mut self, lock_handle: u32 ) -> Result<SystemLockData, RuntimeError>
Retrieves info related to a lock
source§fn kernel_close_substate(
&mut self,
lock_handle: u32
) -> Result<(), RuntimeError>
fn kernel_close_substate( &mut self, lock_handle: u32 ) -> Result<(), RuntimeError>
Drops the handle on some substate, if the handle is a force write, updates are flushed.
No updates should occur if an error is returned.
source§fn kernel_read_substate(
&mut self,
lock_handle: u32
) -> Result<&IndexedScryptoValue, RuntimeError>
fn kernel_read_substate( &mut self, lock_handle: u32 ) -> Result<&IndexedScryptoValue, RuntimeError>
Reads the value of the substate locked by the given lock handle
source§fn kernel_write_substate(
&mut self,
lock_handle: u32,
value: IndexedScryptoValue
) -> Result<(), RuntimeError>
fn kernel_write_substate( &mut self, lock_handle: u32, value: IndexedScryptoValue ) -> Result<(), RuntimeError>
Writes a value to the substate locked by the given lock handle
source§fn kernel_set_substate(
&mut self,
node_id: &NodeId,
partition_num: PartitionNumber,
substate_key: SubstateKey,
value: IndexedScryptoValue
) -> Result<(), RuntimeError>
fn kernel_set_substate( &mut self, node_id: &NodeId, partition_num: PartitionNumber, substate_key: SubstateKey, value: IndexedScryptoValue ) -> Result<(), RuntimeError>
Sets a value to a substate without checking for the original value. Read more
source§fn kernel_remove_substate(
&mut self,
node_id: &NodeId,
partition_num: PartitionNumber,
substate_key: &SubstateKey
) -> Result<Option<IndexedScryptoValue>, RuntimeError>
fn kernel_remove_substate( &mut self, node_id: &NodeId, partition_num: PartitionNumber, substate_key: &SubstateKey ) -> Result<Option<IndexedScryptoValue>, RuntimeError>
Removes a substate from a node and returns the original value. Read more
source§fn kernel_scan_sorted_substates(
&mut self,
node_id: &NodeId,
partition_num: PartitionNumber,
limit: u32
) -> Result<Vec<(([u8; 2], Vec<u8>), IndexedScryptoValue)>, RuntimeError>
fn kernel_scan_sorted_substates( &mut self, node_id: &NodeId, partition_num: PartitionNumber, limit: u32 ) -> Result<Vec<(([u8; 2], Vec<u8>), IndexedScryptoValue)>, RuntimeError>
Reads substates under a node in sorted lexicographical order Read more
fn kernel_scan_keys<K>(
&mut self,
node_id: &NodeId,
partition_num: PartitionNumber,
limit: u32
) -> Result<Vec<SubstateKey>, RuntimeError>where
K: SubstateKeyContent + 'static,
fn kernel_drain_substates<K>(
&mut self,
node_id: &NodeId,
partition_num: PartitionNumber,
limit: u32
) -> Result<Vec<(SubstateKey, IndexedScryptoValue)>, RuntimeError>where
K: SubstateKeyContent + 'static,
fn kernel_open_substate( &mut self, node_id: &NodeId, partition_num: PartitionNumber, substate_key: &SubstateKey, flags: LockFlags, lock_data: L ) -> Result<u32, RuntimeError>
impl<'a, Y, V> ClientApi<RuntimeError> for SystemService<'a, Y, V>
Auto Trait Implementations§
impl<'a, Y, V> RefUnwindSafe for SystemService<'a, Y, V>where
V: RefUnwindSafe,
Y: RefUnwindSafe,
impl<'a, Y, V> Send for SystemService<'a, Y, V>
impl<'a, Y, V> Sync for SystemService<'a, Y, V>
impl<'a, Y, V> Unpin for SystemService<'a, Y, V>where
V: Unpin,
impl<'a, Y, V> !UnwindSafe for SystemService<'a, Y, V>
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
Casts
self
to type T
. The semantics of numeric casting with the as
operator are followed, so <T as As>::as_::<U>
can be used in the same way as T as U
for numeric conversions. Read moresource§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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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.