pub struct FormattedTimestamp { /* private fields */ }
Expand description
Represents a combination of a timestamp and a style for formatting time in messages.
Implementations§
Source§impl FormattedTimestamp
impl FormattedTimestamp
Sourcepub fn new(timestamp: Timestamp, style: Option<FormattedTimestampStyle>) -> Self
pub fn new(timestamp: Timestamp, style: Option<FormattedTimestampStyle>) -> Self
Creates a new FormattedTimestamp
instance from the given Timestamp
and
FormattedTimestampStyle
.
Sourcepub fn now() -> Self
pub fn now() -> Self
Creates a new FormattedTimestamp
instance representing the current timestamp with the
default style.
Sourcepub fn timestamp(&self) -> i64
pub fn timestamp(&self) -> i64
Returns the timestamp of this FormattedTimestamp
.
Sourcepub fn style(&self) -> Option<FormattedTimestampStyle>
pub fn style(&self) -> Option<FormattedTimestampStyle>
Returns the style of this FormattedTimestamp
.
Trait Implementations§
Source§impl Clone for FormattedTimestamp
impl Clone for FormattedTimestamp
Source§fn clone(&self) -> FormattedTimestamp
fn clone(&self) -> FormattedTimestamp
Returns a copy 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 FormattedTimestamp
impl Debug for FormattedTimestamp
Source§impl Default for FormattedTimestamp
impl Default for FormattedTimestamp
Source§fn default() -> FormattedTimestamp
fn default() -> FormattedTimestamp
Returns the “default value” for a type. Read more
Source§impl Display for FormattedTimestamp
impl Display for FormattedTimestamp
Source§impl From<Timestamp> for FormattedTimestamp
impl From<Timestamp> for FormattedTimestamp
Source§impl FromStr for FormattedTimestamp
impl FromStr for FormattedTimestamp
Source§impl PartialEq for FormattedTimestamp
impl PartialEq for FormattedTimestamp
impl Copy for FormattedTimestamp
impl Eq for FormattedTimestamp
impl StructuralPartialEq for FormattedTimestamp
Auto Trait Implementations§
impl Freeze for FormattedTimestamp
impl RefUnwindSafe for FormattedTimestamp
impl Send for FormattedTimestamp
impl Sync for FormattedTimestamp
impl Unpin for FormattedTimestamp
impl UnwindSafe for FormattedTimestamp
Blanket Implementations§
Source§impl<T> ArgumentConvert for Twhere
T: FromStr,
impl<T> ArgumentConvert for Twhere
T: FromStr,
Source§fn convert<'life0, 'async_trait>(
__arg0: impl CacheHttp + 'async_trait,
__arg1: Option<GuildId>,
__arg2: Option<ChannelId>,
s: &'life0 str,
) -> Pin<Box<dyn Future<Output = Result<T, <T as ArgumentConvert>::Err>> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait,
fn convert<'life0, 'async_trait>(
__arg0: impl CacheHttp + 'async_trait,
__arg1: Option<GuildId>,
__arg2: Option<ChannelId>,
s: &'life0 str,
) -> Pin<Box<dyn Future<Output = Result<T, <T as ArgumentConvert>::Err>> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait,
Parses a string
s
as a command parameter of this type.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
Source§impl<T> CloneDebuggableStorage for Twhere
T: DebuggableStorage + Clone,
impl<T> CloneDebuggableStorage for Twhere
T: DebuggableStorage + Clone,
fn clone_storage(&self) -> Box<dyn CloneDebuggableStorage>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> CloneableStorage for T
impl<T> CloneableStorage for T
fn clone_storage(&self) -> Box<dyn CloneableStorage>
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.