Trait scrypto::prelude::object_api::ClientObjectApi
source · pub trait ClientObjectApi<E> {
Show 13 methods
// Required methods
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, E>;
fn drop_object(&mut self, node_id: &NodeId) -> Result<Vec<Vec<u8>>, E>;
fn get_blueprint_id(&mut self, node_id: &NodeId) -> Result<BlueprintId, E>;
fn get_outer_object(&mut self, node_id: &NodeId) -> Result<GlobalAddress, E>;
fn allocate_global_address(
&mut self,
blueprint_id: BlueprintId
) -> Result<(GlobalAddressReservation, GlobalAddress), E>;
fn allocate_virtual_global_address(
&mut self,
blueprint_id: BlueprintId,
global_address: GlobalAddress
) -> Result<GlobalAddressReservation, E>;
fn get_reservation_address(
&mut self,
node_id: &NodeId
) -> Result<GlobalAddress, E>;
fn globalize(
&mut self,
node_id: NodeId,
modules: IndexMap<AttachedModuleId, NodeId>,
address_reservation: Option<GlobalAddressReservation>
) -> Result<GlobalAddress, E>;
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), E>;
fn call_method(
&mut self,
receiver: &NodeId,
method_name: &str,
args: Vec<u8>
) -> Result<Vec<u8>, E>;
fn call_direct_access_method(
&mut self,
receiver: &NodeId,
method_name: &str,
args: Vec<u8>
) -> Result<Vec<u8>, E>;
fn call_module_method(
&mut self,
receiver: &NodeId,
module_id: AttachedModuleId,
method_name: &str,
args: Vec<u8>
) -> Result<Vec<u8>, E>;
// Provided method
fn new_simple_object(
&mut self,
blueprint_ident: &str,
fields: IndexMap<u8, FieldValue>
) -> Result<NodeId, E> { ... }
}
Expand description
A high level interface to manipulate objects in the actor’s call frame
Required Methods§
sourcefn 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, E>
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, E>
Creates a new object of a given blueprint type
sourcefn drop_object(&mut self, node_id: &NodeId) -> Result<Vec<Vec<u8>>, E>
fn drop_object(&mut self, node_id: &NodeId) -> Result<Vec<Vec<u8>>, E>
Drops an owned object, returns the fields of the object
sourcefn get_blueprint_id(&mut self, node_id: &NodeId) -> Result<BlueprintId, E>
fn get_blueprint_id(&mut self, node_id: &NodeId) -> Result<BlueprintId, E>
Get the blueprint id of a visible object
sourcefn get_outer_object(&mut self, node_id: &NodeId) -> Result<GlobalAddress, E>
fn get_outer_object(&mut self, node_id: &NodeId) -> Result<GlobalAddress, E>
Get the outer object of a visible object
sourcefn allocate_global_address(
&mut self,
blueprint_id: BlueprintId
) -> Result<(GlobalAddressReservation, GlobalAddress), E>
fn allocate_global_address( &mut self, blueprint_id: BlueprintId ) -> Result<(GlobalAddressReservation, GlobalAddress), E>
Pre-allocates a global address, for a future globalization.
fn allocate_virtual_global_address( &mut self, blueprint_id: BlueprintId, global_address: GlobalAddress ) -> Result<GlobalAddressReservation, E>
fn get_reservation_address( &mut self, node_id: &NodeId ) -> Result<GlobalAddress, E>
sourcefn globalize(
&mut self,
node_id: NodeId,
modules: IndexMap<AttachedModuleId, NodeId>,
address_reservation: Option<GlobalAddressReservation>
) -> Result<GlobalAddress, E>
fn globalize( &mut self, node_id: NodeId, modules: IndexMap<AttachedModuleId, NodeId>, address_reservation: Option<GlobalAddressReservation> ) -> Result<GlobalAddress, E>
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), E>
sourcefn call_method(
&mut self,
receiver: &NodeId,
method_name: &str,
args: Vec<u8>
) -> Result<Vec<u8>, E>
fn call_method( &mut self, receiver: &NodeId, method_name: &str, args: Vec<u8> ) -> Result<Vec<u8>, E>
Calls a method on an object
fn call_direct_access_method( &mut self, receiver: &NodeId, method_name: &str, args: Vec<u8> ) -> Result<Vec<u8>, E>
sourcefn call_module_method(
&mut self,
receiver: &NodeId,
module_id: AttachedModuleId,
method_name: &str,
args: Vec<u8>
) -> Result<Vec<u8>, E>
fn call_module_method( &mut self, receiver: &NodeId, module_id: AttachedModuleId, method_name: &str, args: Vec<u8> ) -> Result<Vec<u8>, E>
Calls a method on an object module
Provided Methods§
sourcefn 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