Struct gstd::Config

source ·
pub struct Config {
    pub wait_up_to: BlockCount,
    pub wait_for: BlockCount,
    pub mx_lock_duration: BlockCount,
    pub system_reserve: u64,
    /* private fields */
}
Expand description

The set of broadly used internal parameters.

These parameters have various predefined values that the program developer can override.

Fields§

§wait_up_to: BlockCount

Default wait duration for wait_up_to messages expressed in block count.

Initial value: 100 blocks

§wait_for: BlockCount

Default wait duration for wait_for messages expressed in block count.

Initial value: 100 blocks

§mx_lock_duration: BlockCount

Default amount of blocks a mutex lock can be owned for by a message.

Initial value: 100 blocks

§system_reserve: u64

Default gas amount reserved for system purposes.

Initial value: 1_000_000_000

Implementations§

source§

impl Config

source

pub fn wait_for() -> BlockCount

Get the wait_for duration (in blocks).

source

pub fn wait_up_to() -> BlockCount

Get the wait_up_to duration (in blocks).

source

pub fn mx_lock_duration() -> BlockCount

Get the mx_lock_duration duration (in blocks).

source

pub fn system_reserve() -> u64

Get the system_reserve gas amount.

source

pub fn set_wait_for(duration: BlockCount) -> Result<()>

Set wait_for duration (in blocks).

source

pub fn set_default_wait_for(duration: BlockCount) -> Result<()>

Set wait_for as the default wait type with duration.

Calling this function forces all async functions that wait for some condition to wait exactly for duration blocks.

source

pub fn set_wait_up_to(duration: BlockCount) -> Result<()>

Set the wait_up_to duration (in blocks).

source

pub fn set_default_wait_up_to(duration: BlockCount) -> Result<()>

Set wait_up_to as the default wait type with duration.

Calling this function forces all async functions that wait for some condition to wait not more than duration blocks.

source

pub fn set_mx_lock_duration(duration: BlockCount) -> Result<()>

Set mx_lock_duration_max duration (in blocks).

source

pub fn set_system_reserve(amount: u64) -> Result<()>

Set system_reserve gas amount.

Auto Trait Implementations§

§

impl Freeze for Config

§

impl RefUnwindSafe for Config

§

impl Send for Config

§

impl Sync for Config

§

impl Unpin for Config

§

impl UnwindSafe for Config

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

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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

impl<T> JsonSchemaMaybe for T