Struct twilight_model::user::DiscriminatorDisplay
source · [−]pub struct DiscriminatorDisplay(_);Expand description
Display formatter for a user discriminator.
When formatted this will pad a discriminator with zeroes.
This may be preferable to use instead of using format! to avoid a String
allocation, and may also be preferable to use rather than defining your own
implementations via format_args!("{discriminator:04}").
Examples
Display the discriminator value 16 as a string:
use twilight_model::user::DiscriminatorDisplay;
let display = DiscriminatorDisplay::new(16);
assert_eq!("0016", display.to_string());Implementations
sourceimpl DiscriminatorDisplay
impl DiscriminatorDisplay
Trait Implementations
sourceimpl Clone for DiscriminatorDisplay
impl Clone for DiscriminatorDisplay
sourcefn clone(&self) -> DiscriminatorDisplay
fn clone(&self) -> DiscriminatorDisplay
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for DiscriminatorDisplay
impl Debug for DiscriminatorDisplay
sourceimpl Display for DiscriminatorDisplay
impl Display for DiscriminatorDisplay
sourceimpl Hash for DiscriminatorDisplay
impl Hash for DiscriminatorDisplay
sourceimpl PartialEq<DiscriminatorDisplay> for DiscriminatorDisplay
impl PartialEq<DiscriminatorDisplay> for DiscriminatorDisplay
sourcefn eq(&self, other: &DiscriminatorDisplay) -> bool
fn eq(&self, other: &DiscriminatorDisplay) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
impl Copy for DiscriminatorDisplay
impl Eq for DiscriminatorDisplay
impl StructuralEq for DiscriminatorDisplay
impl StructuralPartialEq for DiscriminatorDisplay
Auto Trait Implementations
impl RefUnwindSafe for DiscriminatorDisplay
impl Send for DiscriminatorDisplay
impl Sync for DiscriminatorDisplay
impl Unpin for DiscriminatorDisplay
impl UnwindSafe for DiscriminatorDisplay
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more