[−][src]Enum egg_mode::user::UserID
Convenience enum to generalize between referring to an account by numeric ID or by screen name.
Many API calls ask for a user either by either screen name (e.g. rustlang
) or by a numeric ID
assigned to the account (e.g. 165262228
). In egg-mode, these calls are abstracted around this
enum, and can take any type that converts into it. This enum has From
implementations for the
following types:
u64
&u64
(convenient when used with iterators)&str
&&str
(convenient when used with iterators)&String
(to counteract the fact that deref coercion doesn't work with generics)&UserID
(convenient when used with iterators)
This way, when a function in egg-mode has a paremeter of type T: Into<UserID>
, you can
call it with any of these types, and it will be converted automatically. egg-mode will then use
the proper parameter when performing the call to Twitter.
Variants
ID(u64)
Referring via the account's numeric ID.
Referring via the account's screen name.
Trait Implementations
impl Clone for UserID
[src]
impl Debug for UserID
[src]
impl<'a> From<&'static str> for UserID
[src]
impl From<Cow<'static, str>> for UserID
[src]
impl From<String> for UserID
[src]
impl From<u64> 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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
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> 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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,