multiversx_sc::api

Trait StaticVarApiImpl

Source
pub trait StaticVarApiImpl {
    // Required methods
    fn with_lockable_static_buffer<R, F: FnOnce(&mut LockableStaticBuffer) -> R>(
        &self,
        f: F,
    ) -> R;
    fn set_external_view_target_address_handle(&self, handle: RawHandle);
    fn get_external_view_target_address_handle(&self) -> RawHandle;
    fn next_handle(&self) -> RawHandle;
    fn set_num_arguments(&self, num_arguments: i32);
    fn get_num_arguments(&self) -> i32;
    fn set_flags(&self, flags: StaticVarApiFlags);
    fn get_flags(&self) -> StaticVarApiFlags;
    fn is_scaling_factor_cached(&self, decimals: usize) -> bool;
    fn set_scaling_factor_cached(&self, decimals: usize);

    // Provided method
    fn flag_is_set_or_update(&self, flag: StaticVarApiFlags) -> bool { ... }
}
Expand description

A raw bytes buffer stored statically:

  • in wasm as a static variable
  • in debug mode on the thread local context

Required Methods§

Provided Methods§

Source

fn flag_is_set_or_update(&self, flag: StaticVarApiFlags) -> bool

Returns true if the flag is set, false if is default (false).

If the flag is unset (false), will set it.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§