Struct move_core_types::gas_schedule::GasCost
source · pub struct GasCost {
pub instruction_gas: InternalGasUnits<GasCarrier>,
pub memory_gas: InternalGasUnits<GasCarrier>,
}
Expand description
The GasCost
tracks:
- instruction cost: how much time/computational power is needed to perform the instruction
- memory cost: how much memory is required for the instruction, and storage overhead
Fields§
§instruction_gas: InternalGasUnits<GasCarrier>
§memory_gas: InternalGasUnits<GasCarrier>
Implementations§
source§impl GasCost
impl GasCost
pub fn new(instr_gas: GasCarrier, mem_gas: GasCarrier) -> Self
sourcepub fn total(&self) -> InternalGasUnits<GasCarrier>
pub fn total(&self) -> InternalGasUnits<GasCarrier>
Convert a GasCost to a total gas charge in InternalGasUnits
.
Trait Implementations§
source§impl<'de> Deserialize<'de> for GasCost
impl<'de> Deserialize<'de> for GasCost
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more