[][src]Struct serenity::model::id::UserId

pub struct UserId(pub u64);

An identifier for a User

Implementations

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]

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 AsRef<UserId> for UserId[src]

impl Clone for UserId[src]

impl Copy for UserId[src]

impl Debug for UserId[src]

impl Default for UserId[src]

impl<'de> Deserialize<'de> for UserId[src]

impl Display for UserId[src]

impl Eq for UserId[src]

impl<'a> From<&'a CurrentUser> for UserId[src]

fn from(current_user: &CurrentUser) -> UserId[src]

Gets the Id of a CurrentUser struct.

impl<'a> From<&'a Member> for UserId[src]

fn from(member: &Member) -> UserId[src]

Gets the Id of a Member.

impl<'a> From<&'a User> for UserId[src]

fn from(user: &User) -> UserId[src]

Gets the Id of a User.

impl<'a> From<&'a UserId> for UserId[src]

impl From<CurrentUser> for UserId[src]

fn from(current_user: CurrentUser) -> UserId[src]

Gets the Id of a CurrentUser struct.

impl From<Member> for UserId[src]

fn from(member: Member) -> UserId[src]

Gets the Id of a Member.

impl From<User> for UserId[src]

fn from(user: User) -> UserId[src]

Gets the Id of a User.

impl From<UserId> for u64[src]

impl From<UserId> for i64[src]

impl From<u64> for UserId[src]

impl FromStr for UserId[src]

type Err = UserIdParseError

The associated error which can be returned from parsing.

impl Hash for UserId[src]

impl Mentionable for UserId[src]

impl Ord for UserId[src]

impl PartialEq<UserId> for UserId[src]

impl PartialEq<u64> for UserId[src]

impl PartialOrd<UserId> for UserId[src]

impl Serialize for UserId[src]

impl StructuralEq for UserId[src]

impl StructuralPartialEq for UserId[src]

Auto Trait Implementations

impl RefUnwindSafe for UserId

impl Send for UserId

impl Sync for UserId

impl Unpin for UserId

impl UnwindSafe for UserId

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CloneAny for T where
    T: Clone + Any
[src]

impl<T> DebugAny for T where
    T: Any + Debug
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<F> FromStrAndCache for F where
    F: FromStr
[src]

type Err = <F as FromStr>::Err

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> UnsafeAny for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,