pub struct ActivityData {
pub name: String,
pub kind: ActivityType,
pub state: Option<String>,
pub url: Option<Url>,
}
Expand description
Activity data of the current user.
Fields§
§name: String
The name of the activity
kind: ActivityType
The 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>
pub fn streaming(name: impl Into<String>, url: impl IntoUrl) -> Result<Self>
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 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 ActivityData
impl Debug for ActivityData
Source§impl From<Activity> for ActivityData
impl From<Activity> 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