pub enum Base {
Binary = 2,
Octal = 8,
Decimal = 10,
Hexadecimal = 16,
}Expand description
Base of numeric literal encoding according to its prefix.
Variants§
Binary = 2
Literal starts with “0b”.
Octal = 8
Literal starts with “0o”.
Decimal = 10
Literal doesn’t contain a prefix.
Hexadecimal = 16
Literal starts with “0x”.
Implementations§
Source§impl Base
impl Base
pub fn is_binary(&self) -> bool
pub fn is_not_binary(&self) -> bool
pub fn and_binary(self, and: Self) -> Self
pub fn or_binary(self, or: Self) -> Self
pub fn is_octal(&self) -> bool
pub fn is_not_octal(&self) -> bool
pub fn and_octal(self, and: Self) -> Self
pub fn or_octal(self, or: Self) -> Self
pub fn is_decimal(&self) -> bool
pub fn is_not_decimal(&self) -> bool
pub fn and_decimal(self, and: Self) -> Self
pub fn or_decimal(self, or: Self) -> Self
pub fn is_hexadecimal(&self) -> bool
pub fn is_not_hexadecimal(&self) -> bool
pub fn and_hexadecimal(self, and: Self) -> Self
pub fn or_hexadecimal(self, or: Self) -> Self
Trait Implementations§
impl Copy for Base
impl Eq for Base
Source§impl Ord for Base
impl Ord for Base
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Base
impl PartialOrd for Base
impl StructuralPartialEq for Base
Auto Trait Implementations§
impl Freeze for Base
impl RefUnwindSafe for Base
impl Send for Base
impl Sync for Base
impl Unpin for Base
impl UnsafeUnpin for Base
impl UnwindSafe for Base
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§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more