Type Alias twitch_types::UserName

source ·
pub type UserName = Nickname;
Expand description

A username, also specified as login. Should not be capitalized.

Aliased Type§

struct UserName(/* private fields */);

Implementations§

source§

impl Nickname

source

pub const fn new(raw: String) -> Self

Constructs a new Nickname

source

pub fn from_static(raw: &'static str) -> Self

Constructs a newNicknamefrom a static reference

source

pub fn into_boxed_ref(self) -> Box<NicknameRef>

Converts this Nickname into a Box<NicknameRef>

This will drop any excess capacity.

source

pub fn take(self) -> String

Unwraps the underlying String value

Methods from Deref<Target = NicknameRef>§

source

pub fn as_str(&self) -> &str

Provides access to the underlying value as a string slice.

source

pub fn as_cow(&self) -> Cow<'_, NicknameRef>

Trait Implementations§

source§

impl<'a> Arbitrary<'a> for Nickname

Available on crate feature arbitrary only.
source§

fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self, Error>

Generate an arbitrary value of Self from the given unstructured data. Read more
source§

fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>

Generate an arbitrary value of Self from the entirety of the given unstructured data. Read more
source§

fn size_hint(depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
source§

impl AsRef<NicknameRef> for Nickname

source§

fn as_ref(&self) -> &NicknameRef

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<str> for Nickname

source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Borrow<NicknameRef> for Nickname

source§

fn borrow(&self) -> &NicknameRef

Immutably borrows from an owned value. Read more
source§

impl Borrow<str> for Nickname

source§

fn borrow(&self) -> &str

Immutably borrows from an owned value. Read more
source§

impl Clone for Nickname

source§

fn clone(&self) -> Nickname

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Nickname

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Deref for Nickname

§

type Target = NicknameRef

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<'de> Deserialize<'de> for Nickname

Available on crate feature serde only.
source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for Nickname

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<&NicknameRef> for Nickname

source§

fn from(s: &NicknameRef) -> Self

Converts to this type from the input type.
source§

impl From<&str> for Nickname

source§

fn from(s: &str) -> Self

Converts to this type from the input type.
source§

impl From<Box<NicknameRef, Global>> for Nickname

source§

fn from(r: Box<NicknameRef>) -> Self

Converts to this type from the input type.
source§

impl From<Box<str, Global>> for Nickname

source§

fn from(s: Box<str>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Cow<'a, NicknameRef>> for Nickname

source§

fn from(r: Cow<'a, NicknameRef>) -> Self

Converts to this type from the input type.
source§

impl From<String> for Nickname

source§

fn from(s: String) -> Self

Converts to this type from the input type.
source§

impl FromStr for Nickname

§

type Err = Infallible

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl Hash for Nickname

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<'a> IntoCow<'a, NicknameRef> for Nickname

source§

fn into_cow(self) -> Cow<'a, NicknameRef>

Make the cow with proper ownership, muu
source§

impl Ord for Nickname

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<&NicknameRef> for Nickname

source§

fn eq(&self, other: &&NicknameRef) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<Nickname> for Nickname

source§

fn eq(&self, other: &Nickname) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<NicknameRef> for Nickname

source§

fn eq(&self, other: &NicknameRef) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<Nickname> for Nickname

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Serialize for Nickname

Available on crate feature serde only.
source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for Nickname

source§

impl StructuralEq for Nickname

source§

impl StructuralPartialEq for Nickname