Syscall

Struct Syscall 

Source
pub struct Syscall;
Expand description

System call interface for accessing the runtime environment.

The Syscall struct provides a collection of methods that abstract lower-level operations, such as retrieving message metadata (ID, size, source, value), fetching the program identifier, obtaining the current block height, and accessing environment variables.

These methods are essential for enabling on-chain applications to interact with the Gear runtime in a consistent manner. Depending on the target environment, different implementations are provided:

  • For the WASM target, direct calls are made to gstd::msg and gstd::exec to fetch runtime data.
  • In standard (std) environments, a mock implementation uses thread-local state for testing purposes.
  • In no_std configurations without the std feature and not WASM target, the functions are marked as unimplemented.

Use these methods to retrieve contextual information about the current execution environment, ensuring that your program logic remains agnostic of the underlying platform specifics.

Implementations§

Auto Trait Implementations§

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<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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> JsonSchemaMaybe for T