Struct gstd::GasMultiplier
#[repr(C, packed(1))]pub struct GasMultiplier { /* private fields */ }
Expand description
Type representing converter between gas and value.
Implementations§
§impl GasMultiplier
impl GasMultiplier
pub const fn one() -> GasMultiplier
pub const fn one() -> GasMultiplier
Creates GasMultiplier with gas == value.
pub fn from_gas_per_value(gas_per_value: u64) -> GasMultiplier
pub fn from_gas_per_value(gas_per_value: u64) -> GasMultiplier
Creates GasMultiplier from gas per value multiplier.
pub fn from_value_per_gas(value_per_gas: u128) -> GasMultiplier
pub fn from_value_per_gas(value_per_gas: u128) -> GasMultiplier
Creates GasMultiplier from value per gas multiplier.
pub fn gas_to_value(&self, gas: u64) -> u128
pub fn gas_to_value(&self, gas: u64) -> u128
Converts given gas amount into its value equivalent.
pub fn value_to_gas(&self, value: u128) -> u64
pub fn value_to_gas(&self, value: u128) -> u64
Converts given value amount into its gas equivalent, rounding to lower.
Trait Implementations§
§impl Clone for GasMultiplier
impl Clone for GasMultiplier
§fn clone(&self) -> GasMultiplier
fn clone(&self) -> GasMultiplier
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl Debug for GasMultiplier
impl Debug for GasMultiplier
impl Copy for GasMultiplier
Auto Trait Implementations§
impl Freeze for GasMultiplier
impl RefUnwindSafe for GasMultiplier
impl Send for GasMultiplier
impl Sync for GasMultiplier
impl Unpin for GasMultiplier
impl UnwindSafe for GasMultiplier
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)