Struct SystemService

Source
pub struct SystemService<'a, Y>{ /* private fields */ }
Expand description

A wrapper offering a comprehensive system api to callers. It is built on top of a SystemBasedKernelApi, and you are free to access it. You can also construct a SystemService from the api with api.system_service().

Like [SystemModuleApiImpl], we use a wrapper type rather than implementing this functionality directly on a SystemBasedKernelApi for a few reasons:

  • Trait coherence - the System traits aren’t defined in this crate, so it prevents us from implementing them on any type implementing SystemBasedKernelApi.
  • Separation of APIs - we avoid exposing the methods of a [SystemServiceApi] directly if someone happens to have a SystemBasedKernelApi, which prevents some possible confusion.

Implementations§

Source§

impl<'a, Y> SystemService<'a, Y>

Source

pub fn new(api: &'a mut Y) -> SystemService<'a, Y>

Source

pub fn api(&mut self) -> &mut Y

Source

pub fn system( &mut self, ) -> &mut System<<Y as SystemBasedKernelApi>::SystemCallback>

Source§

impl<'a, Y> SystemService<'a, Y>

Source

pub fn get_blueprint_default_definition( &mut self, blueprint_id: BlueprintId, ) -> Result<Rc<BlueprintDefinition>, RuntimeError>

Source

pub fn load_blueprint_definition( &mut self, package_address: PackageAddress, bp_version_key: &BlueprintVersionKey, ) -> Result<Rc<BlueprintDefinition>, RuntimeError>

Source

pub fn prepare_global_address( &mut self, blueprint_id: BlueprintId, global_address: GlobalAddress, ) -> Result<GlobalAddressReservation, RuntimeError>

Source

pub fn get_node_type_info( &mut self, node_id: &NodeId, ) -> Result<TypeInfoSubstate, RuntimeError>

Source

pub fn get_blueprint_info( &mut self, node_id: &NodeId, module_id: Option<AttachedModuleId>, ) -> Result<BlueprintInfo, RuntimeError>

Source

pub fn get_actor_type_target( &mut self, ) -> Result<BlueprintTypeTarget, RuntimeError>

Source

pub fn current_actor(&mut self) -> Actor

Source

pub fn get_object_info( &mut self, node_id: &NodeId, ) -> Result<ObjectInfo, RuntimeError>

Source

pub fn is_feature_enabled( &mut self, node_id: &NodeId, module_id: Option<AttachedModuleId>, feature: &str, ) -> Result<bool, RuntimeError>

Source§

impl<'a, Y> SystemService<'a, Y>

Source

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

Source

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

Source

pub fn get_payload_schema( &mut self, target: &BlueprintTypeTarget, payload_identifier: &BlueprintPayloadIdentifier, ) -> Result<(Rc<VersionedSchema<ScryptoCustomSchema>>, LocalTypeId, bool, bool, SchemaOrigin), RuntimeError>

Source

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

Source

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

Source

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

Source

pub fn get_blueprint_type_schema( &mut self, type_id: &BlueprintTypeIdentifier, ) -> Result<(Rc<VersionedSchema<ScryptoCustomSchema>>, ScopedTypeId), RuntimeError>

Trait Implementations§

Source§

impl<'a, Y> KernelInternalApi for SystemService<'a, Y>

Source§

type System = <Y as KernelApi>::CallbackObject

Source§

fn kernel_get_system_state( &mut self, ) -> SystemState<'_, <Y as KernelApi>::CallbackObject>

Returns the system state.
Source§

fn kernel_get_current_stack_depth_uncosted(&self) -> usize

Returns the current stack depth. Read more
Source§

fn kernel_get_current_stack_id_uncosted(&self) -> usize

Returns the current stack id. Read more
Source§

fn kernel_get_node_visibility_uncosted( &self, node_id: &NodeId, ) -> NodeVisibility

Returns the visibility of a node. Read more
Source§

fn kernel_read_substate_uncosted( &self, node_id: &NodeId, partition_num: PartitionNumber, substate_key: &SubstateKey, ) -> Option<&IndexedScryptoValue>

Returns the value of a substate. Read more
Source§

fn kernel_get_system(&mut self) -> &mut Self::System

Returns the system.
Source§

impl<'a, Y> KernelNodeApi for SystemService<'a, Y>

Source§

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>

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>

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>

Creates a new RENode
Source§

fn kernel_create_node_from( &mut self, node_id: NodeId, partitions: BTreeMap<PartitionNumber, (NodeId, PartitionNumber)>, ) -> Result<(), RuntimeError>

Source§

impl<'a, Y> KernelSubstateApi<SystemLockData> for SystemService<'a, Y>

Source§

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>

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>

Retrieves info related to a lock
Source§

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>

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>

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>

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>

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>

Reads substates under a node in sorted lexicographical order Read more
Source§

fn kernel_scan_keys<K>( &mut self, node_id: &NodeId, partition_num: PartitionNumber, limit: u32, ) -> Result<Vec<SubstateKey>, RuntimeError>

Source§

fn kernel_drain_substates<K>( &mut self, node_id: &NodeId, partition_num: PartitionNumber, limit: u32, ) -> Result<Vec<(SubstateKey, IndexedScryptoValue)>, RuntimeError>

Source§

fn kernel_open_substate( &mut self, node_id: &NodeId, partition_num: PartitionNumber, substate_key: &SubstateKey, flags: LockFlags, lock_data: L, ) -> Result<u32, RuntimeError>

Source§

impl<'a, Y> SystemActorApi<RuntimeError> for SystemService<'a, Y>

Source§

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>

Retrieve the current method actor’s node id
Source§

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>

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>

Emits an event of the current actor
Source§

impl<'a, Y> SystemActorIndexApi<RuntimeError> for SystemService<'a, Y>

Source§

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>

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>

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>

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>

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,

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,

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>

Removes and returns arbitrary elements of count from an index
Source§

impl<'a, Y> SystemActorKeyValueEntryApi<RuntimeError> for SystemService<'a, Y>

Source§

fn actor_open_key_value_entry( &mut self, object_handle: u32, collection_index: u8, key: &Vec<u8>, flags: LockFlags, ) -> Result<u32, RuntimeError>

Returns a handle for a specified key value entry in a collection. If an invalid collection index or key is passed an error is returned.
Source§

fn actor_remove_key_value_entry( &mut self, object_handle: u32, collection_index: u8, key: &Vec<u8>, ) -> Result<Vec<u8>, RuntimeError>

Removes an entry from a collection. If an invalid collection index or key is passed an error is returned, otherwise the encoding of a value of the entry is returned.
Source§

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,

Removes an entry from a collection. If an invalid collection index or key is passed an error is returned, otherwise the value of the entry is returned.
Source§

impl<'a, Y> SystemActorSortedIndexApi<RuntimeError> for SystemService<'a, Y>

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>

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>

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>

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,

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,

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>

Scans the first elements of count from a sorted index
Source§

impl<'a, Y> SystemBlueprintApi<RuntimeError> for SystemService<'a, Y>

Source§

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
Source§

fn resolve_blueprint_type( &mut self, blueprint_type_id: &BlueprintTypeIdentifier, ) -> Result<(Rc<VersionedSchema<ScryptoCustomSchema>>, ScopedTypeId), RuntimeError>

Retrieves the schema of type under a blueprint
Source§

impl<'a, Y> SystemCostingApi<RuntimeError> for SystemService<'a, Y>

Source§

fn consume_cost_units( &mut self, costing_entry: ClientCostingEntry<'_>, ) -> Result<(), RuntimeError>

Consume an amount of cost units.
Source§

fn start_lock_fee( &mut self, amount: Decimal, contingent: bool, ) -> Result<bool, RuntimeError>

Check if costing is enabled.
Source§

fn lock_fee(&mut self, locked_fee: LiquidFungibleResource, contingent: bool)

Add cost units to the reserve. This should never fail.
Source§

fn execution_cost_unit_limit(&mut self) -> Result<u32, RuntimeError>

Retrieve the cost unit limit for the transaction
Source§

fn execution_cost_unit_price(&mut self) -> Result<Decimal, RuntimeError>

Retrieve the cost unit price in XRD
Source§

fn finalization_cost_unit_limit(&mut self) -> Result<u32, RuntimeError>

Retrieve the finalization cost unit limit
Source§

fn finalization_cost_unit_price(&mut self) -> Result<Decimal, RuntimeError>

Retrieve the finalization cost unit price in XRD
Source§

fn usd_price(&mut self) -> Result<Decimal, RuntimeError>

Retrieve the usd price of XRD
Source§

fn max_per_function_royalty_in_xrd(&mut self) -> Result<Decimal, RuntimeError>

Retrieve the maximum allowable royalty per function
Source§

fn tip_percentage_truncated(&mut self) -> Result<u32, RuntimeError>

Retrieve the tip percentage of the transaction
Source§

fn fee_balance(&mut self) -> Result<Decimal, RuntimeError>

Retrieve the current fee balance in XRD
Source§

impl<'a, Y> SystemExecutionTraceApi<RuntimeError> for SystemService<'a, Y>

Source§

fn update_instruction_index( &mut self, new_index: usize, ) -> Result<(), RuntimeError>

Source§

impl<'a, Y> SystemFieldApi<RuntimeError> for SystemService<'a, Y>

Source§

fn field_read(&mut self, handle: u32) -> Result<Vec<u8>, RuntimeError>

Retrieve the value of a field
Source§

fn field_write( &mut self, handle: u32, buffer: Vec<u8>, ) -> Result<(), RuntimeError>

Write a value to a field
Source§

fn field_lock(&mut self, handle: u32) -> Result<(), RuntimeError>

Lock a field such that it becomes immutable
Source§

fn field_close(&mut self, handle: u32) -> Result<(), RuntimeError>

Close a field handle so that it is no longer usable
Source§

fn field_read_typed<S>(&mut self, handle: u32) -> Result<S, E>
where S: ScryptoDecode,

Retrieve the value of a field
Source§

fn field_write_typed<S>(&mut self, handle: u32, substate: &S) -> Result<(), E>
where S: ScryptoEncode,

Write a value to a field
Source§

impl<'a, Y> SystemKeyValueEntryApi<RuntimeError> for SystemService<'a, Y>

Source§

fn key_value_entry_get(&mut self, handle: u32) -> Result<Vec<u8>, RuntimeError>

Reads the value of a key value entry
Source§

fn key_value_entry_lock(&mut self, handle: u32) -> Result<(), RuntimeError>

Lock the value of a key value entry making the value immutable
Source§

fn key_value_entry_remove( &mut self, handle: u32, ) -> Result<Vec<u8>, RuntimeError>

Remove the value of a key value entry
Source§

fn key_value_entry_set( &mut self, handle: u32, buffer: Vec<u8>, ) -> Result<(), RuntimeError>

Set the value of a key value entry
Source§

fn key_value_entry_close(&mut self, handle: u32) -> Result<(), RuntimeError>

Close the handle into the key value entry rendering it unusable after close
Source§

fn key_value_entry_get_typed<S>(&mut self, handle: u32) -> Result<Option<S>, E>
where S: ScryptoDecode,

Reads the value of a key value entry and decodes it into a specific type
Source§

fn key_value_entry_set_typed<S>( &mut self, handle: u32, value: S, ) -> Result<(), E>
where S: ScryptoEncode,

Set the value of a key value entry
Source§

impl<'a, Y> SystemKeyValueStoreApi<RuntimeError> for SystemService<'a, Y>

Source§

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>

Open a key value store entry for reading/writing
Source§

fn key_value_store_remove_entry( &mut self, node_id: &NodeId, key: &Vec<u8>, ) -> Result<Vec<u8>, RuntimeError>

Removes an entry from a key value store
Source§

impl<'a, Y> SystemObjectApi<RuntimeError> for SystemService<'a, Y>

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>

Creates a new object of a given blueprint type
Source§

fn allocate_global_address( &mut self, blueprint_id: BlueprintId, ) -> Result<(GlobalAddressReservation, GlobalAddress), RuntimeError>

Allocates a global address, for a future globalization.
Source§

fn allocate_virtual_global_address( &mut self, blueprint_id: BlueprintId, global_address: GlobalAddress, ) -> Result<GlobalAddressReservation, RuntimeError>

Allocates a specific virtual global address
Source§

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.
Source§

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>

Globalizes with a new inner object and emits an event
Source§

fn call_method( &mut self, receiver: &NodeId, method_name: &str, args: Vec<u8>, ) -> Result<Vec<u8>, RuntimeError>

Calls a method on an object
Source§

fn call_direct_access_method( &mut self, receiver: &NodeId, method_name: &str, args: Vec<u8>, ) -> Result<Vec<u8>, RuntimeError>

Calls a direct access method on an object
Source§

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>

Get the blueprint id of a visible object
Source§

fn get_outer_object( &mut self, node_id: &NodeId, ) -> Result<GlobalAddress, RuntimeError>

Get the outer object of a visible object
Source§

fn get_reservation_address( &mut self, node_id: &NodeId, ) -> Result<GlobalAddress, RuntimeError>

Retrieve the global address of a given address reservation
Source§

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>

Creates a new simple blueprint object of a given blueprint type
Source§

impl<'a, Y> SystemTransactionRuntimeApi<RuntimeError> for SystemService<'a, Y>

Source§

fn get_transaction_hash(&mut self) -> Result<Hash, RuntimeError>

Retrieve the hash of the current transaction which is running.
Source§

fn generate_ruid(&mut self) -> Result<[u8; 32], RuntimeError>

Generate a unique id
Source§

fn bech32_encode_address( &mut self, address: GlobalAddress, ) -> Result<String, RuntimeError>

Encode an address into Bech32. The HRP part is dependent on the network which is running.
Source§

fn emit_log( &mut self, level: Level, message: String, ) -> Result<(), RuntimeError>

Emit a log message which will be available in the transaction receipt
Source§

fn panic(&mut self, message: String) -> Result<(), RuntimeError>

End the transaction immediately with a given message to be included in the transaction receipt
Source§

impl<'a, Y> SystemApi<RuntimeError> for SystemService<'a, Y>

Auto Trait Implementations§

§

impl<'a, Y> Freeze for SystemService<'a, Y>
where Y: ?Sized,

§

impl<'a, Y> RefUnwindSafe for SystemService<'a, Y>
where Y: RefUnwindSafe + ?Sized,

§

impl<'a, Y> Send for SystemService<'a, Y>
where Y: Send + ?Sized,

§

impl<'a, Y> Sync for SystemService<'a, Y>
where Y: Sync + ?Sized,

§

impl<'a, Y> Unpin for SystemService<'a, Y>
where Y: ?Sized,

§

impl<'a, Y> !UnwindSafe for SystemService<'a, Y>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<U> As for U

Source§

fn as_<T>(self) -> T
where 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 more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T, U> ContextualTryInto<U> for T
where U: ContextualTryFrom<T>,

Source§

impl<T> Downcast for T
where T: Any,

Source§

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.
Source§

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.
Source§

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.
Source§

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.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromBits<T> for T

Source§

fn from_bits(other: T) -> T

Convert other to Self, preserving bitwise representation
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<X, Y> LabelledResolve<Y> for X
where Y: LabelledResolveFrom<X>,

Source§

fn labelled_resolve( self, resolver: &impl LabelResolver<<Y as LabelledResolvable>::ResolverOutput>, ) -> Y

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<X, Y> Resolve<Y> for X
where Y: ResolveFrom<X>,

Source§

fn resolve(self) -> Y

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<V, K> SystemBasedKernelInternalApi for K
where V: SystemCallbackObject, K: KernelInternalApi<System = System<V>>,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.