Skip to main content

EstimatedRuntime

Struct EstimatedRuntime 

Source
pub struct EstimatedRuntime { /* private fields */ }

Implementations§

Source§

impl EstimatedRuntime

Source

pub fn new() -> Self

Creates a new EstimatedRuntime with the default values.

Source

pub fn with_min_runtime_secs(self, min_runtime_secs: u64) -> Self

Sets the estimated runtime in seconds to fund the canister if it is below it.

Source

pub fn with_fallback_min_cycles(self, fallback_min_cycles: u128) -> Self

Sets the fallback min cycles to trigger the funding operation when the estimated runtime is not available.

Source

pub fn with_fallback_fund_cycles(self, fallback_fund_cycles: u128) -> Self

Sets the fallback cycles to fund the canister with when the estimated runtime is not available.

Source

pub fn with_fund_runtime_secs(self, fund_runtime_secs: u64) -> Self

Sets the runtime seconds to add to the estimated runtime.

Source

pub fn with_max_runtime_cycles_fund(self, max_runtime_cycles_fund: u128) -> Self

Sets the maximum cycles to fund the canister with, only used when the estimated runtime is available.

Source

pub fn min_runtime_secs(&self) -> u64

Get the estimated min runtime in seconds to trigger the funding operation.

Source

pub fn fund_runtime_secs(&self) -> u64

Get the runtime seconds to add to the estimated runtime.

Source

pub fn max_runtime_cycles_fund(&self) -> u128

Get the maximum cycles to fund the canister with, only used when the estimated runtime is available.

Source

pub fn fallback_min_cycles(&self) -> u128

Get the fallback min cycles to trigger the funding operation when the estimated runtime is not available.

Source

pub fn fallback_fund_cycles(&self) -> u128

Get the fallback cycles to fund the canister with when the estimated runtime is not available.

Trait Implementations§

Source§

impl Clone for EstimatedRuntime

Source§

fn clone(&self) -> EstimatedRuntime

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EstimatedRuntime

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for EstimatedRuntime

Source§

fn default() -> Self

The default is to fund the canister when the estimated runtime is 2 days.

When the estimated runtime is not available, the fallback threshold is 250B cycles.

Source§

impl Eq for EstimatedRuntime

Source§

impl PartialEq for EstimatedRuntime

Source§

fn eq(&self, other: &EstimatedRuntime) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for EstimatedRuntime

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.