[−][src]Enum egg_mode::list::ListID
Convenience enum to refer to a list via its owner and name or via numeric ID.
Any API call that needs to reference a specific list has a set of parameters that collectively
refer to it. Not only do lists have a unique numeric ID that refers to them, they have a "slug"
that stands in as the list's unique name. This slug is only unique when taken in combination
with the user that created it, though, so this leads to the raw API call having parameters that
refer to the user by screen name or ID, or the list as a whole by this pair of slug parameters
or the single ID parameter. egg-mode wraps this pattern with this ListID
enum.
Because the slug is formed from two variables instead of one, this enum foregoes the many
From
implementations that UserID
has and instead opts for two creation functions. If you
have a user/name combo, use ListID::from_slug
when looking for the list. If you have the
list's ID instead, then you can use ListID::from_id
.
Example
use egg_mode::list::ListID; //The following two ListIDs refer to the same list: let slug = ListID::from_slug("Twitter", "support"); let id = ListID::from_id(99924643);
Variants
Referring via the list's owner and its "slug" or name.
ID(u64)
Referring via the list's numeric ID.
Methods
impl ListID
[src]
pub fn from_slug<T: Into<UserID>>(
owner: T,
list_name: impl Into<Cow<'static, str>>
) -> ListID
[src]
owner: T,
list_name: impl Into<Cow<'static, str>>
) -> ListID
Make a new ListID
by supplying its owner and name.
pub fn from_id(list_id: u64) -> ListID
[src]
Make a new ListID
by supplying its numeric ID.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for ListID
impl Send for ListID
impl Sync for ListID
impl Unpin for ListID
impl UnwindSafe for ListID
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>,