pub enum Radix {
Binary,
Octal,
Decimal,
Hexadecimal,
}Expand description
Specify the base for a number.
Variants§
Binary
A base 2 number.
§Example: Using action!
use editor_types::prelude::*;
use editor_types::{action, Action};
let style = WordStyle::Number(Radix::Binary);
let kw: Action = Action::KeywordLookup(style.into());
// All of these are equivalent:
assert_eq!(kw, action!("keyword-lookup -t (word radix 2)"));
assert_eq!(kw, action!("keyword-lookup -t (word radix bin)"));
assert_eq!(kw, action!("keyword-lookup -t (word radix binary)"));Octal
A base 8 number.
§Example: Using action!
use editor_types::prelude::*;
use editor_types::{action, Action};
let style = WordStyle::Number(Radix::Octal);
let kw: Action = Action::KeywordLookup(style.into());
// All of these are equivalent:
assert_eq!(kw, action!("keyword-lookup -t (word radix 8)"));
assert_eq!(kw, action!("keyword-lookup -t (word radix oct)"));
assert_eq!(kw, action!("keyword-lookup -t (word radix octal)"));Decimal
A base 10 number.
§Example: Using action!
use editor_types::prelude::*;
use editor_types::{action, Action};
let style = WordStyle::Number(Radix::Decimal);
let kw: Action = Action::KeywordLookup(style.into());
// All of these are equivalent:
assert_eq!(kw, action!("keyword-lookup -t (word radix 10)"));
assert_eq!(kw, action!("keyword-lookup -t (word radix dec)"));
assert_eq!(kw, action!("keyword-lookup -t (word radix decimal)"));Hexadecimal
A base 16 number.
§Example: Using action!
use editor_types::prelude::*;
use editor_types::{action, Action};
let style = WordStyle::Number(Radix::Hexadecimal);
let kw: Action = Action::KeywordLookup(style.into());
// All of these are equivalent:
assert_eq!(kw, action!("keyword-lookup -t (word radix 16)"));
assert_eq!(kw, action!("keyword-lookup -t (word radix hex)"));
assert_eq!(kw, action!("keyword-lookup -t (word radix hexadecimal)"));Implementations§
Trait Implementations§
impl Copy for Radix
impl Eq for Radix
impl StructuralPartialEq for Radix
Auto Trait Implementations§
impl Freeze for Radix
impl RefUnwindSafe for Radix
impl Send for Radix
impl Sync for Radix
impl Unpin for Radix
impl UnwindSafe for Radix
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