Struct twilight_model::gateway::payload::outgoing::update_presence::UpdatePresence
source · pub struct UpdatePresence {
pub d: UpdatePresencePayload,
pub op: OpCode,
}
Fields§
§d: UpdatePresencePayload
§op: OpCode
Implementations§
source§impl UpdatePresence
impl UpdatePresence
sourcepub fn new(
activities: impl Into<Vec<Activity>>,
afk: bool,
since: impl Into<Option<u64>>,
status: impl Into<Status>
) -> Result<Self, UpdatePresenceError>
pub fn new(
activities: impl Into<Vec<Activity>>,
afk: bool,
since: impl Into<Option<u64>>,
status: impl Into<Status>
) -> Result<Self, UpdatePresenceError>
Create a new, valid UpdatePresence
payload.
Errors
Returns an error of type UpdatePresenceErrorType::MissingActivity
if
an empty set of activities is provided.
Trait Implementations§
source§impl Clone for UpdatePresence
impl Clone for UpdatePresence
source§fn clone(&self) -> UpdatePresence
fn clone(&self) -> UpdatePresence
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 UpdatePresence
impl Debug for UpdatePresence
source§impl<'de> Deserialize<'de> for UpdatePresence
impl<'de> Deserialize<'de> for UpdatePresence
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 Hash for UpdatePresence
impl Hash for UpdatePresence
source§impl PartialEq<UpdatePresence> for UpdatePresence
impl PartialEq<UpdatePresence> for UpdatePresence
source§fn eq(&self, other: &UpdatePresence) -> bool
fn eq(&self, other: &UpdatePresence) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.