[−][src]Struct discord_game_sdk::Activity
Activity (also known as Rich Presence)
To enable players to join or spectate via invites and requests, some fields are required:
- Joining
- Spectating
discord.update_activity( &Activity::empty() .with_state("On Main Menu") .with_start_time(now), |discord, result| { if let Err(error) = result { eprintln!("failed to update activity: {}", error); } }, );
Implementations
impl Activity
[src]
pub fn empty() -> Self
[src]
Create a new Activity with empty fields
pub fn is_empty(&self) -> bool
[src]
Check if an Activity is completely blank
pub fn kind(&self) -> ActivityKind
[src]
Type of Activty
pub fn application_id(&self) -> ClientID
[src]
The unique ID of the application
pub fn name(&self) -> &str
[src]
The name of the application
pub fn state(&self) -> &str
[src]
The player's current party status
pub fn details(&self) -> &str
[src]
What the player is currently doing
pub fn start_time(&self) -> UnixTimestamp
[src]
When the current activity has started, in UNIX Time
pub fn end_time(&self) -> UnixTimestamp
[src]
When the current activity will end, in UNIX Time
pub fn large_image_key(&self) -> &str
[src]
The key of an asset to display
pub fn large_image_tooltip(&self) -> &str
[src]
The tooltip displayed when hovering over the large image
pub fn small_image_key(&self) -> &str
[src]
The key of an asset to display
pub fn small_image_tooltip(&self) -> &str
[src]
The tooltip displayed when hovering over the small image
pub fn party_id(&self) -> &str
[src]
The unique identifier for the party
pub fn party_amount(&self) -> u32
[src]
The number of players currently in the party
pub fn party_capacity(&self) -> u32
[src]
The maximum capacity of the party
pub fn instance(&self) -> bool
[src]
Whether this activity is an instanced context, like a match
pub fn match_secret(&self) -> &str
[src]
The unique hash for the given match context
pub fn join_secret(&self) -> &str
[src]
The unique hash for chat invites and Ask to Join
pub fn spectate_secret(&self) -> &str
[src]
The unique hash for Spectate button
pub fn with_state(&mut self, value: &str) -> &mut Self
[src]
The player's current party status
Only the first 128 bytes will be written.
pub fn with_details(&mut self, value: &str) -> &mut Self
[src]
What the player is currently doing
Only the first 128 bytes will be written.
pub fn with_start_time(&mut self, value: UnixTimestamp) -> &mut Self
[src]
When the current activity has started, in UNIX time
pub fn with_end_time(&mut self, value: UnixTimestamp) -> &mut Self
[src]
When the current activity will end, in UNIX time
pub fn with_large_image_key(&mut self, value: &str) -> &mut Self
[src]
The key of an asset to display
Only the first 128 bytes will be written.
pub fn with_large_image_tooltip(&mut self, value: &str) -> &mut Self
[src]
The tooltip displayed when hovering over the large image
Only the first 128 bytes will be written.
pub fn with_small_image_key(&mut self, value: &str) -> &mut Self
[src]
The key of an asset to display
Only the first 128 bytes will be written.
pub fn with_small_image_tooltip(&mut self, value: &str) -> &mut Self
[src]
The tooltip displayed when hovering over the small image
Only the first 128 bytes will be written.
pub fn with_party_id(&mut self, value: &str) -> &mut Self
[src]
The unique identifier for the party
Only the first 128 bytes will be written.
pub fn with_party_amount(&mut self, value: u32) -> &mut Self
[src]
The number of players currently in the party
pub fn with_party_capacity(&mut self, value: u32) -> &mut Self
[src]
The maximum capacity of the party
pub fn with_instance(&mut self, value: bool) -> &mut Self
[src]
Whether this activity is an instanced context, like a match
pub fn with_match_secret(&mut self, value: &str) -> &mut Self
[src]
The unique hash for the given match context
Only the first 128 bytes will be written.
pub fn with_join_secret(&mut self, value: &str) -> &mut Self
[src]
The unique hash for chat invites and Ask to Join
Only the first 128 bytes will be written.
pub fn with_spectate_secret(&mut self, value: &str) -> &mut Self
[src]
The unique hash for Spectate button
Only the first 128 bytes will be written.
Trait Implementations
impl Clone for Activity
[src]
impl Debug for Activity
[src]
impl Display for Activity
[src]
impl Eq for Activity
[src]
impl PartialEq<Activity> for Activity
[src]
impl StructuralEq for Activity
[src]
impl StructuralPartialEq for Activity
[src]
Auto Trait Implementations
impl RefUnwindSafe for Activity
impl Send for Activity
impl Sync for Activity
impl Unpin for Activity
impl UnwindSafe for Activity
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,