pub struct Duration(_);Expand description
i32 in stored bytes (seconds)
Implementations
sourceimpl Duration
impl Duration
pub fn new(td: TimeDuration) -> Self
pub fn get_native_duration(&self) -> TimeDuration
pub fn from_number(value: i64) -> Self
pub fn from_json(value: JsonValue) -> Result<Self, DatetimeError>
pub fn to_number(&self) -> i64
pub fn to_json(&self) -> JsonValue
Methods from Deref<Target = TimeDuration>
pub const ZERO: Duration = Self::seconds(0)
pub const NANOSECOND: Duration = Self::nanoseconds(1)
pub const MICROSECOND: Duration = Self::microseconds(1)
pub const MILLISECOND: Duration = Self::milliseconds(1)
pub const SECOND: Duration = Self::seconds(1)
pub const MINUTE: Duration = Self::minutes(1)
pub const HOUR: Duration = Self::hours(1)
pub const DAY: Duration = Self::days(1)
pub const WEEK: Duration = Self::weeks(1)
pub const MIN: Duration = Self::new_unchecked(i64::MIN, -999999999)
pub const MAX: Duration = Self::new_unchecked(i64::MAX, 999999999)
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Duration
impl<'de> Deserialize<'de> for Duration
sourcefn 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
sourceimpl Rapira for Duration
impl Rapira for Duration
const STATIC_SIZE: Option<usize> = _
fn from_slice(slice: &mut &[u8]) -> Result<Self, RapiraError> where
Self: Sized,
fn check_bytes(slice: &mut &[u8]) -> Result<(), RapiraError> where
Self: Sized,
sourceunsafe fn from_slice_unsafe(slice: &mut &[u8]) -> Result<Self, RapiraError> where
Self: Sized,
unsafe fn from_slice_unsafe(slice: &mut &[u8]) -> Result<Self, RapiraError> where
Self: Sized,
Safety Read more
fn convert_to_bytes(&self, slice: &mut [u8], cursor: &mut usize)
fn size(&self) -> usize
fn from_slice_unchecked(slice: &mut &[u8]) -> Result<Self, RapiraError>
fn try_convert_to_bytes(
&self,
slice: &mut [u8],
cursor: &mut usize
) -> Result<(), RapiraError>
fn serialize(&self) -> Vec<u8, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
fn deserialize(bytes: &[u8]) -> Result<Self, RapiraError>
fn deser_unchecked(bytes: &[u8]) -> Result<Self, RapiraError>
sourceunsafe fn deser_unsafe(bytes: &[u8]) -> Result<Self, RapiraError>
unsafe fn deser_unsafe(bytes: &[u8]) -> Result<Self, RapiraError>
Safety Read more
sourceimpl TryFromValue for Duration
impl TryFromValue for Duration
fn try_from(value: Value) -> Result<Self, FromValueError>
impl Copy for Duration
impl Eq for Duration
impl StructuralEq for Duration
impl StructuralPartialEq for Duration
Auto Trait Implementations
impl RefUnwindSafe for Duration
impl Send for Duration
impl Sync for Duration
impl Unpin for Duration
impl UnwindSafe for Duration
Blanket Implementations
sourceimpl<'de, T> BorrowDecode<'de> for T where
T: Decode,
impl<'de, T> BorrowDecode<'de> for T where
T: Decode,
sourcefn borrow_decode<D>(decoder: &mut D) -> Result<T, DecodeError> where
D: Decoder,
fn borrow_decode<D>(decoder: &mut D) -> Result<T, DecodeError> where
D: Decoder,
Attempt to decode this type with the given BorrowDecode.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more