pub struct UnixTimestamp(/* private fields */);Expand description
Block timestamp as Unix seconds.
Implementations§
Source§impl UnixTimestamp
impl UnixTimestamp
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 UnixTimestamp
impl UnixTimestamp
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§
Source§impl Clone for UnixTimestamp
impl Clone for UnixTimestamp
Source§fn clone(&self) -> UnixTimestamp
fn clone(&self) -> UnixTimestamp
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for UnixTimestamp
Source§impl Debug for UnixTimestamp
impl Debug for UnixTimestamp
impl Eq for UnixTimestamp
Source§impl From<UnixTimestamp> for u64
impl From<UnixTimestamp> for u64
Source§fn from(value: UnixTimestamp) -> Self
fn from(value: UnixTimestamp) -> Self
Converts to this type from the input type.
Source§impl From<u64> for UnixTimestamp
impl From<u64> for UnixTimestamp
Source§impl Hash for UnixTimestamp
impl Hash for UnixTimestamp
Source§impl Ord for UnixTimestamp
impl Ord for UnixTimestamp
Source§fn cmp(&self, other: &UnixTimestamp) -> Ordering
fn cmp(&self, other: &UnixTimestamp) -> Ordering
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 PartialEq for UnixTimestamp
impl PartialEq for UnixTimestamp
Source§fn eq(&self, other: &UnixTimestamp) -> bool
fn eq(&self, other: &UnixTimestamp) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for UnixTimestamp
impl PartialOrd for UnixTimestamp
Source§impl RlpDecode for UnixTimestamp
impl RlpDecode for UnixTimestamp
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 UnixTimestamp
impl RlpEncode for UnixTimestamp
Source§type Error = PrimitiveRlpError
type Error = PrimitiveRlpError
Error returned by this encoder.
impl StructuralPartialEq for UnixTimestamp
Auto Trait Implementations§
impl Freeze for UnixTimestamp
impl RefUnwindSafe for UnixTimestamp
impl Send for UnixTimestamp
impl Sync for UnixTimestamp
impl Unpin for UnixTimestamp
impl UnsafeUnpin for UnixTimestamp
impl UnwindSafe for UnixTimestamp
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