[−][src]Struct serenity::model::id::UserId
An identifier for a User
Methods
impl UserId
[src]
pub fn created_at(&self) -> DateTime<FixedOffset>
[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, http: impl AsRef<Http>) -> 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 to_user_cached(
self,
cache: impl AsRef<CacheRwLock>
) -> Option<Arc<RwLock<User>>>
[src]
self,
cache: impl AsRef<CacheRwLock>
) -> Option<Arc<RwLock<User>>>
Attempts to find a User
by its Id in the cache.
pub fn to_user(self, cache_http: impl CacheHttp) -> 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 Eq for UserId
[src]
impl Default for UserId
[src]
impl Clone for UserId
[src]
impl AsRef<UserId> 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]
impl PartialEq<u64> for UserId
[src]
impl Ord for UserId
[src]
fn cmp(&self, other: &UserId) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
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 Copy for UserId
[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,
impl Debug for UserId
[src]
impl Display 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 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
impl Send for UserId
impl Unpin for UserId
impl Sync for UserId
impl UnwindSafe for UserId
impl RefUnwindSafe for UserId
Blanket Implementations
impl<F> FromStrAndCache for F where
F: FromStr,
[src]
F: FromStr,
type Err = <F as FromStr>::Err
fn from_str(
impl AsRef<CacheRwLock>,
&str
) -> Result<F, <F as FromStrAndCache>::Err>
[src]
impl AsRef<CacheRwLock>,
&str
) -> Result<F, <F as FromStrAndCache>::Err>
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, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> Erased for T
impl<'a, T> TryFrom<&'a str> for T where
T: FromStr,
T: FromStr,
type Err = <T as FromStr>::Err
fn try_from(string: &'a str) -> Result<T, <T as TryFrom<&'a str>>::Err>
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,
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 + Sync + Send> where
T: Send + Sync,
[src]
T: Send + Sync,
impl<T> UnsafeAny for T where
T: Any,
T: Any,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,