Struct linera_execution::ResourceControlPolicy
source · pub struct ResourceControlPolicy {Show 13 fields
pub block: Amount,
pub fuel_unit: Amount,
pub read_operation: Amount,
pub write_operation: Amount,
pub byte_read: Amount,
pub byte_written: Amount,
pub byte_stored: Amount,
pub operation: Amount,
pub operation_byte: Amount,
pub message: Amount,
pub message_byte: Amount,
pub maximum_bytes_read_per_block: u64,
pub maximum_bytes_written_per_block: u64,
}Expand description
A collection of prices and limits associated with block execution.
Fields§
§block: AmountThe base price for creating a new block.
fuel_unit: AmountThe price per unit of fuel (aka gas) for VM execution.
read_operation: AmountThe price of one read operation.
write_operation: AmountThe price of one write operation.
byte_read: AmountThe price of reading a byte.
byte_written: AmountThe price of writing a byte
byte_stored: AmountThe price of increasing storage by a byte.
operation: AmountThe base price of adding an operation to a block.
operation_byte: AmountThe additional price for each byte in the argument of a user operation.
message: AmountThe base price of sending a message from a block.
message_byte: AmountThe additional price for each byte in the argument of a user message.
maximum_bytes_read_per_block: u64The maximum data to read per block
maximum_bytes_written_per_block: u64The maximum data to write per block
Implementations§
source§impl ResourceControlPolicy
impl ResourceControlPolicy
pub fn block_price(&self) -> Amount
pub fn total_price( &self, resources: &Resources ) -> Result<Amount, ArithmeticError>
Trait Implementations§
source§impl Clone for ResourceControlPolicy
impl Clone for ResourceControlPolicy
source§fn clone(&self) -> ResourceControlPolicy
fn clone(&self) -> ResourceControlPolicy
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 moresource§impl Debug for ResourceControlPolicy
impl Debug for ResourceControlPolicy
source§impl Default for ResourceControlPolicy
impl Default for ResourceControlPolicy
source§impl<'de> Deserialize<'de> for ResourceControlPolicy
impl<'de> Deserialize<'de> for ResourceControlPolicy
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
source§impl Hash for ResourceControlPolicy
impl Hash for ResourceControlPolicy
source§impl InputType for ResourceControlPolicy
impl InputType for ResourceControlPolicy
§type RawValueType = ResourceControlPolicy
type RawValueType = ResourceControlPolicy
The raw type used for validator. Read more
source§fn create_type_info(registry: &mut Registry) -> String
fn create_type_info(registry: &mut Registry) -> String
Create type information in the registry and return qualified typename.
source§fn parse(value: Option<Value>) -> InputValueResult<Self>
fn parse(value: Option<Value>) -> InputValueResult<Self>
Parse from
Value. None represents undefined.source§fn as_raw_value(&self) -> Option<&Self::RawValueType>
fn as_raw_value(&self) -> Option<&Self::RawValueType>
Returns a reference to the raw value.
source§fn qualified_type_name() -> String
fn qualified_type_name() -> String
Qualified typename.
source§impl PartialEq for ResourceControlPolicy
impl PartialEq for ResourceControlPolicy
source§fn eq(&self, other: &ResourceControlPolicy) -> bool
fn eq(&self, other: &ResourceControlPolicy) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl Serialize for ResourceControlPolicy
impl Serialize for ResourceControlPolicy
impl Eq for ResourceControlPolicy
impl InputObjectType for ResourceControlPolicy
impl StructuralPartialEq for ResourceControlPolicy
Auto Trait Implementations§
impl Freeze for ResourceControlPolicy
impl RefUnwindSafe for ResourceControlPolicy
impl Send for ResourceControlPolicy
impl Sync for ResourceControlPolicy
impl Unpin for ResourceControlPolicy
impl UnwindSafe for ResourceControlPolicy
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.