pub struct DiscriminatorDisplay(/* private fields */);
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§
source§impl DiscriminatorDisplay
impl DiscriminatorDisplay
Trait Implementations§
source§impl Clone for DiscriminatorDisplay
impl Clone for DiscriminatorDisplay
source§fn clone(&self) -> DiscriminatorDisplay
fn clone(&self) -> DiscriminatorDisplay
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for DiscriminatorDisplay
impl Debug for DiscriminatorDisplay
source§impl Display for DiscriminatorDisplay
impl Display for DiscriminatorDisplay
source§impl Hash for DiscriminatorDisplay
impl Hash for DiscriminatorDisplay
source§impl PartialEq for DiscriminatorDisplay
impl PartialEq for DiscriminatorDisplay
impl Copy for DiscriminatorDisplay
impl Eq for DiscriminatorDisplay
impl StructuralPartialEq for DiscriminatorDisplay
Auto Trait Implementations§
impl Freeze for DiscriminatorDisplay
impl RefUnwindSafe for DiscriminatorDisplay
impl Send for DiscriminatorDisplay
impl Sync for DiscriminatorDisplay
impl Unpin for DiscriminatorDisplay
impl UnwindSafe for DiscriminatorDisplay
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)