[−][src]Struct eosio::Symbol
Stores information about a symbol, the symbol can be 7 characters long.
Methods
impl Symbol
[src]
#[must_use]
pub const fn new(value: u64) -> Self
[src]
Construct a new symbol given a value.
#[must_use]
pub const fn new_with_code(precision: u8, code: SymbolCode) -> Self
[src]
Construct a new symbol given a u8
precision and SymbolCode
.
#[must_use]
pub const fn precision(&self) -> u8
[src]
This symbol's precision
#[must_use]
pub const fn code(&self) -> SymbolCode
[src]
Returns representation of symbol name
Examples
use eosio::{Symbol, s}; let symbol: Symbol = s!(4, "EOS").into(); let code = symbol.code(); assert_eq!(code.to_string(), "EOS");
#[must_use]
pub const fn as_u64(&self) -> u64
[src]
TODO docs
#[must_use]
pub fn is_valid(&self) -> bool
[src]
Is this symbol valid
Trait Implementations
impl Clone for Symbol
[src]
fn clone(&self) -> Symbol
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for Symbol
[src]
impl Debug for Symbol
[src]
impl Default for Symbol
[src]
impl Display for Symbol
[src]
impl Eq for Symbol
[src]
impl From<Symbol> for u64
[src]
impl From<Symbol> for SecondaryKey
[src]
impl From<Symbol> for ScopeName
[src]
impl From<u64> for Symbol
[src]
impl Hash for Symbol
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl NumBytes for Symbol
[src]
impl Ord for Symbol
[src]
fn cmp(&self, other: &Symbol) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Symbol> for Symbol
[src]
impl PartialEq<u64> for Symbol
[src]
#[must_use]
fn eq(&self, other: &u64) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<Symbol> for Symbol
[src]
fn partial_cmp(&self, other: &Symbol) -> Option<Ordering>
[src]
fn lt(&self, other: &Symbol) -> bool
[src]
fn le(&self, other: &Symbol) -> bool
[src]
fn gt(&self, other: &Symbol) -> bool
[src]
fn ge(&self, other: &Symbol) -> bool
[src]
impl Read for Symbol
[src]
fn read(bytes: &[u8], pos: &mut usize) -> Result<Self, ReadError>
[src]
fn unpack<T: AsRef<[u8]>>(bytes: T) -> Result<Self, ReadError>
[src]
impl StructuralEq for Symbol
[src]
impl StructuralPartialEq for Symbol
[src]
impl Write for Symbol
[src]
fn write(&self, bytes: &mut [u8], pos: &mut usize) -> Result<(), WriteError>
[src]
fn pack(&self) -> Result<Vec<u8>, WriteError>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,