pub struct Gas(/* private fields */);Expand description
Gas quantity.
Implementations§
Source§impl Gas
impl Gas
Sourcepub fn encoded_rlp_len(self) -> Result<usize, PrimitiveRlpError>
pub fn encoded_rlp_len(self) -> Result<usize, PrimitiveRlpError>
Returns the canonical RLP encoded length.
Sourcepub fn encode_rlp(self, output: &mut [u8]) -> Result<usize, PrimitiveRlpError>
pub fn encode_rlp(self, output: &mut [u8]) -> Result<usize, PrimitiveRlpError>
Canonically encodes this value into output.
Returns the number of bytes written. output is not modified
unless this function returns Ok.
Sourcepub fn try_from_rlp(
input: &[u8],
limits: DecodeLimits,
) -> Result<Self, PrimitiveRlpError>
pub fn try_from_rlp( input: &[u8], limits: DecodeLimits, ) -> Result<Self, PrimitiveRlpError>
Decodes exactly one canonical RLP integer into this domain.
Source§impl Gas
impl Gas
Sourcepub fn try_from_canonical_be_slice(bytes: &[u8]) -> Result<Self, PrimitiveError>
pub fn try_from_canonical_be_slice(bytes: &[u8]) -> Result<Self, PrimitiveError>
Creates a value from a canonical RLP integer payload.
The empty payload represents zero. Non-empty payloads must be shortest-form unsigned big-endian bytes without a leading zero.
Trait Implementations§
impl Copy for Gas
impl Eq for Gas
Source§impl Ord for Gas
impl Ord for Gas
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Gas
impl PartialOrd for Gas
Source§impl RlpDecode for Gas
impl RlpDecode for Gas
Source§type Error = PrimitiveRlpError
type Error = PrimitiveRlpError
Error returned by this decoder.
Source§fn decode_rlp(input: &[u8], limits: DecodeLimits) -> Result<Self, Self::Error>
fn decode_rlp(input: &[u8], limits: DecodeLimits) -> Result<Self, Self::Error>
Decodes exactly one canonical RLP item from
input.Source§impl RlpEncode for Gas
impl RlpEncode for Gas
Source§type Error = PrimitiveRlpError
type Error = PrimitiveRlpError
Error returned by this encoder.
impl StructuralPartialEq for Gas
Auto Trait Implementations§
impl Freeze for Gas
impl RefUnwindSafe for Gas
impl Send for Gas
impl Sync for Gas
impl Unpin for Gas
impl UnsafeUnpin for Gas
impl UnwindSafe for Gas
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