pub struct Resolution(/* private fields */);Expand description
Resolution
Implementations§
Source§impl Resolution
impl Resolution
Sourcepub fn as_timestamp(self) -> Timestamp
pub fn as_timestamp(self) -> Timestamp
Translates the resolution to a Timestamp.
Sourcepub fn as_idx(self) -> Result<u32, TryFromIntError>
pub fn as_idx(self) -> Result<u32, TryFromIntError>
trues to convert the secs into a u32 index
Sourcepub fn secs(s: u64) -> Result<Self, ResolutionError>
pub fn secs(s: u64) -> Result<Self, ResolutionError>
Creates a new Resolution from a number of seconds.
Sourcepub fn align_up_to(&self, align_up_to: Resolution) -> Self
pub fn align_up_to(&self, align_up_to: Resolution) -> Self
Aligns this resolution up to match the given Resolution.
Trait Implementations§
Source§impl Add<Resolution> for Timestamp
impl Add<Resolution> for Timestamp
Source§impl AddAssign<Resolution> for Timestamp
impl AddAssign<Resolution> for Timestamp
Source§fn add_assign(&mut self, rhs: Resolution)
fn add_assign(&mut self, rhs: Resolution)
Performs the
+= operation. Read moreSource§impl<'__de, __Context> BorrowDecode<'__de, __Context> for Resolution
impl<'__de, __Context> BorrowDecode<'__de, __Context> for Resolution
Source§fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>(
decoder: &mut __D,
) -> Result<Self, DecodeError>
fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>( decoder: &mut __D, ) -> Result<Self, DecodeError>
Attempt to decode this type with the given BorrowDecode.
Source§impl Clone for Resolution
impl Clone for Resolution
Source§fn clone(&self) -> Resolution
fn clone(&self) -> Resolution
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 Resolution
impl Debug for Resolution
Source§impl<__Context> Decode<__Context> for Resolution
impl<__Context> Decode<__Context> for Resolution
Source§impl Default for Resolution
impl Default for Resolution
Source§impl<'de> Deserialize<'de> for Resolution
impl<'de> Deserialize<'de> for Resolution
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 Resolution
impl Display for Resolution
Source§impl Div<Resolution> for Timestamp
impl Div<Resolution> for Timestamp
Source§impl Div for Resolution
impl Div for Resolution
Source§impl Encode for Resolution
impl Encode for Resolution
Source§impl From<Resolution> for NonZeroU64
impl From<Resolution> for NonZeroU64
Source§fn from(value: Resolution) -> Self
fn from(value: Resolution) -> Self
Converts to this type from the input type.
Source§impl Mul<NonZero<u32>> for Resolution
impl Mul<NonZero<u32>> for Resolution
Source§type Output = Resolution
type Output = Resolution
The resulting type after applying the
* operator.Source§impl Mul<Resolution> for Timestamp
impl Mul<Resolution> for Timestamp
Source§impl Ord for Resolution
impl Ord for Resolution
Source§fn cmp(&self, other: &Resolution) -> Ordering
fn cmp(&self, other: &Resolution) -> Ordering
1.21.0 · 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<Resolution> for Timestamp
impl PartialEq<Resolution> for Timestamp
Source§impl PartialEq<Timestamp> for Resolution
impl PartialEq<Timestamp> for Resolution
Source§impl PartialEq<u64> for Resolution
impl PartialEq<u64> for Resolution
Source§impl PartialEq for Resolution
impl PartialEq for Resolution
Source§impl PartialOrd<Resolution> for Timestamp
impl PartialOrd<Resolution> for Timestamp
Source§impl PartialOrd<Timestamp> for Resolution
impl PartialOrd<Timestamp> for Resolution
Source§impl PartialOrd for Resolution
impl PartialOrd for Resolution
Source§impl Rem<Resolution> for Timestamp
impl Rem<Resolution> for Timestamp
Source§impl Rem for Resolution
impl Rem for Resolution
Source§impl Serialize for Resolution
impl Serialize for Resolution
Source§impl TryFrom<Resolution> for NonZeroU32
impl TryFrom<Resolution> for NonZeroU32
Source§type Error = TryFromIntError
type Error = TryFromIntError
The type returned in the event of a conversion error.
Source§impl TryInto<i64> for Resolution
impl TryInto<i64> for Resolution
Source§impl TryInto<u32> for Resolution
impl TryInto<u32> for Resolution
impl Copy for Resolution
impl Eq for Resolution
impl StructuralPartialEq for Resolution
Auto Trait Implementations§
impl Freeze for Resolution
impl RefUnwindSafe for Resolution
impl Send for Resolution
impl Sync for Resolution
impl Unpin for Resolution
impl UnsafeUnpin for Resolution
impl UnwindSafe for Resolution
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