pub struct Milliseconds(pub u64);
Expand description
Represents time in milliseconds.
Tuple Fields§
§0: u64
Implementations§
Source§impl Milliseconds
impl Milliseconds
pub fn is_expired(&self, block: &BlockInfo) -> bool
pub fn is_in_past(&self, block: &BlockInfo) -> bool
pub fn zero() -> Milliseconds
pub fn is_zero(&self) -> bool
pub fn from_seconds(seconds: u64) -> Milliseconds
pub fn from_nanos(nanos: u64) -> Milliseconds
pub fn milliseconds(&self) -> u64
pub fn seconds(&self) -> u64
pub fn nanos(&self) -> u64
pub fn add_milliseconds(&mut self, milliseconds: Milliseconds)
pub fn subtract_milliseconds(&mut self, milliseconds: Milliseconds)
pub fn plus_milliseconds(self, milliseconds: Milliseconds) -> Milliseconds
pub fn minus_milliseconds(self, milliseconds: Milliseconds) -> Milliseconds
pub fn add_seconds(&mut self, seconds: u64)
pub fn subtract_seconds(&mut self, seconds: u64)
pub fn plus_seconds(self, seconds: u64) -> Milliseconds
pub fn minus_seconds(self, seconds: u64) -> Milliseconds
Trait Implementations§
Source§impl Clone for Milliseconds
impl Clone for Milliseconds
Source§fn clone(&self) -> Milliseconds
fn clone(&self) -> Milliseconds
Returns a duplicate 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 Milliseconds
impl Debug for Milliseconds
Source§impl Default for Milliseconds
impl Default for Milliseconds
Source§fn default() -> Milliseconds
fn default() -> Milliseconds
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for Milliseconds
impl<'de> Deserialize<'de> for Milliseconds
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 Display for Milliseconds
impl Display for Milliseconds
Source§impl From<Milliseconds> for Expiration
impl From<Milliseconds> for Expiration
Source§fn from(time: Milliseconds) -> Expiration
fn from(time: Milliseconds) -> Expiration
Converts to this type from the input type.
Source§impl From<Milliseconds> for String
impl From<Milliseconds> for String
Source§fn from(time: Milliseconds) -> String
fn from(time: Milliseconds) -> String
Converts to this type from the input type.
Source§impl From<Milliseconds> for Timestamp
impl From<Milliseconds> for Timestamp
Source§fn from(time: Milliseconds) -> Timestamp
fn from(time: Milliseconds) -> Timestamp
Converts to this type from the input type.
Source§impl JsonSchema for Milliseconds
impl JsonSchema for Milliseconds
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moreSource§impl PartialEq for Milliseconds
impl PartialEq for Milliseconds
Source§impl PartialOrd for Milliseconds
impl PartialOrd for Milliseconds
Source§impl Serialize for Milliseconds
impl Serialize for Milliseconds
impl Copy for Milliseconds
impl Eq for Milliseconds
impl StructuralPartialEq for Milliseconds
Auto Trait Implementations§
impl Freeze for Milliseconds
impl RefUnwindSafe for Milliseconds
impl Send for Milliseconds
impl Sync for Milliseconds
impl Unpin for Milliseconds
impl UnwindSafe for Milliseconds
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