pub enum UserId {
Id(u32),
Name(Username),
}
Expand description
Either a user id as u32 or a username as String.
Use the From
implementations to create this enum
Example
use rosu_v2::request::UserId;
let user_id: UserId = 123_456.into();
let user_id: UserId = "my username".into();
Variants§
Id(u32)
Represents a user through their user id
Name(Username)
Represents a user through their username
Trait Implementations§
source§impl PartialEq<UserId> for UserId
impl PartialEq<UserId> for UserId
impl Eq for UserId
impl StructuralEq for UserId
impl StructuralPartialEq for UserId
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.