[][src]Enum demostf_client::UserRef

pub enum UserRef {
    User(User),
    Id(u32),
}

Reference to a user, either contains the full user information or only the user id

Variants

User(User)
Id(u32)

Implementations

impl UserRef[src]

pub fn id(&self) -> u32[src]

pub fn user(&self) -> Option<&User>[src]

Return the stored user info if available

pub async fn resolve<'a, '_>(
    &'a self,
    client: &'_ ApiClient
) -> Result<Cow<'a, User>, Error>
[src]

Return either the stored user info or get the user information from the api

Trait Implementations

impl Clone for UserRef[src]

impl Debug for UserRef[src]

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

Auto Trait Implementations

impl RefUnwindSafe for UserRef

impl Send for UserRef

impl Sync for UserRef

impl Unpin for UserRef

impl UnwindSafe for UserRef

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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.