pub struct ActivityData {
pub name: String,
pub kind: ActivityType,
pub state: Option<String>,
pub url: Option<Url>,
}Available on crate feature
gateway only.Expand description
Activity data of the current user.
Fields§
§name: StringThe name of the activity
kind: ActivityTypeThe type of the activity
state: Option<String>The state of the activity, if the type is ActivityType::Custom
url: Option<Url>The url of the activity, if the type is ActivityType::Streaming
Implementations§
Source§impl ActivityData
impl ActivityData
Sourcepub fn playing(name: impl Into<String>) -> Self
pub fn playing(name: impl Into<String>) -> Self
Creates an activity that appears as Playing <name>.
Sourcepub fn streaming(name: impl Into<String>, url: impl IntoUrl) -> Result<Self>
Available on crate feature http only.
pub fn streaming(name: impl Into<String>, url: impl IntoUrl) -> Result<Self>
http only.Creates an activity that appears as Streaming <name>.
§Errors
Returns an error if the URL parsing fails.
Sourcepub fn listening(name: impl Into<String>) -> Self
pub fn listening(name: impl Into<String>) -> Self
Creates an activity that appears as Listening to <name>.
Sourcepub fn watching(name: impl Into<String>) -> Self
pub fn watching(name: impl Into<String>) -> Self
Creates an activity that appears as Watching <name>.
Trait Implementations§
Source§impl Clone for ActivityData
impl Clone for ActivityData
Source§fn clone(&self) -> ActivityData
fn clone(&self) -> ActivityData
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ActivityData
impl Debug for ActivityData
Source§impl From<Activity> for ActivityData
impl From<Activity> for ActivityData
Source§impl PartialEq for ActivityData
impl PartialEq for ActivityData
Source§impl Serialize for ActivityData
impl Serialize for ActivityData
impl Eq for ActivityData
impl StructuralPartialEq for ActivityData
Auto Trait Implementations§
impl Freeze for ActivityData
impl RefUnwindSafe for ActivityData
impl Send for ActivityData
impl Sync for ActivityData
impl Unpin for ActivityData
impl UnwindSafe for ActivityData
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
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.