[−][src]Struct serenity::model::id::UserId
An identifier for a User
Methods
impl UserId
[src]
pub fn created_at(&self) -> NaiveDateTime
[src]
Retrieves the time that the Id was created at.
pub fn as_u64(&self) -> &u64
[src]
Immutably borrow inner Id.
pub fn as_mut_u64(&mut self) -> &mut u64
[src]
Mutably borrow inner Id.
impl UserId
[src]
pub fn create_dm_channel(&self) -> Result<PrivateChannel>
[src]
Creates a direct message channel between the current user and the user. This can also retrieve the channel if one already exists.
pub fn find(&self) -> Option<Arc<RwLock<User>>>
[src]
Use the to_user_cached
-method instead.
Search the cache for the user with the Id.
pub fn to_user_cached(self) -> Option<Arc<RwLock<User>>>
[src]
Attempts to find a User
by its Id in the cache.
pub fn get(&self) -> Result<User>
[src]
Use the to_user
-method instead.
Gets a user by its Id from either the cache or the REST API.
Searches the cache for the user first, if the cache is enabled. If the user was not found, then the user is searched via the REST API.
pub fn to_user(self) -> Result<User>
[src]
First attempts to find a User
by its Id in the cache,
upon failure requests it via the REST API.
Note: If the cache is not enabled, REST API will be used only.
Trait Implementations
impl Mentionable for UserId
[src]
impl Default for UserId
[src]
impl Clone for UserId
[src]
fn clone(&self) -> UserId
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Ord for UserId
[src]
fn cmp(&self, other: &UserId) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
impl<'a> From<&'a UserId> for UserId
[src]
impl From<u64> for UserId
[src]
impl From<UserId> for u64
[src]
impl From<UserId> for i64
[src]
impl From<CurrentUser> for UserId
[src]
fn from(current_user: CurrentUser) -> UserId
[src]
Gets the Id of a CurrentUser
struct.
impl<'a> From<&'a CurrentUser> for UserId
[src]
fn from(current_user: &CurrentUser) -> UserId
[src]
Gets the Id of a CurrentUser
struct.
impl From<Member> for UserId
[src]
impl<'a> From<&'a Member> for UserId
[src]
impl From<User> for UserId
[src]
impl<'a> From<&'a User> for UserId
[src]
impl Eq for UserId
[src]
impl Copy for UserId
[src]
impl PartialOrd<UserId> for UserId
[src]
fn partial_cmp(&self, other: &UserId) -> Option<Ordering>
[src]
fn lt(&self, other: &UserId) -> bool
[src]
fn le(&self, other: &UserId) -> bool
[src]
fn gt(&self, other: &UserId) -> bool
[src]
fn ge(&self, other: &UserId) -> bool
[src]
impl PartialEq<UserId> for UserId
[src]
fn eq(&self, other: &Self) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl PartialEq<u64> for UserId
[src]
fn eq(&self, u: &u64) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl AsRef<UserId> for UserId
[src]
impl Display for UserId
[src]
impl Debug for UserId
[src]
impl FromStr for UserId
[src]
type Err = UserIdParseError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> StdResult<Self, Self::Err>
[src]
impl Hash for UserId
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Serialize for UserId
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for UserId
[src]
fn deserialize<D: Deserializer<'de>>(
deserializer: D
) -> StdResult<Self, D::Error>
[src]
deserializer: D
) -> StdResult<Self, D::Error>
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> Erased for T
impl<T> Typeable for T where
T: Any,
T: Any,
impl<T> DebugAny for T where
T: Any + Debug,
[src]
T: Any + Debug,
impl<T> CloneAny for T where
T: Clone + Any,
[src]
T: Clone + Any,
fn clone_any(&self) -> Box<dyn CloneAny + 'static>
[src]
fn clone_any_send(&self) -> Box<dyn CloneAny + 'static + Send> where
T: Send,
[src]
T: Send,
fn clone_any_sync(&self) -> Box<dyn CloneAny + 'static + Sync> where
T: Sync,
[src]
T: Sync,
fn clone_any_send_sync(&self) -> Box<dyn CloneAny + 'static + Send + Sync> where
T: Send + Sync,
[src]
T: Send + Sync,
impl<T> UnsafeAny for T where
T: Any,
T: Any,