[][src]Struct simble::Printable

pub struct Printable(_);

Symbol that can be borrowed directly as a &str or &[u8]. Comparison is supported, but order is unspecified and must not be relied on (for predictable sorting, use Lexical).

Methods

impl Printable[src]

pub fn len(self) -> usize[src]

Return the length of this symbol.

pub fn into_bytes(self) -> [u8; 8][src]

Convert a Printable into a byte array. The result is right-padded with NUL bytes.

pub fn as_ptr(&self) -> *const u8[src]

Obtain a pointer to the first byte.

pub fn as_bytes(&self) -> &[u8][src]

Borrow as a byte slice.

pub fn as_str(&self) -> &str[src]

Borrow as a &str.

Important traits for Bytes
pub fn bytes(self) -> Bytes[src]

Obtain an iterator over the bytes.

pub fn to_lexical(self) -> Lexical[src]

Convert to a lexically-sortable symbol.

Trait Implementations

impl From<Lexical> for Printable[src]

impl From<Printable> for Lexical[src]

impl Display for Printable[src]

impl Debug for Printable[src]

impl PartialEq<Printable> for Printable[src]

impl PartialEq<str> for Printable[src]

impl PartialEq<Printable> for str[src]

impl Eq for Printable[src]

impl Ord for Printable[src]

impl PartialOrd<Printable> for Printable[src]

impl PartialOrd<str> for Printable[src]

impl PartialOrd<Printable> for str[src]

impl FromStr for Printable[src]

type Err = Error

The associated error which can be returned from parsing.

impl Hash for Printable[src]

impl Copy for Printable[src]

impl StructuralPartialEq for Printable[src]

impl StructuralEq for Printable[src]

impl AsRef<[u8]> for Printable[src]

impl AsRef<str> for Printable[src]

impl Clone for Printable[src]

Auto Trait Implementations

impl Unpin for Printable

impl Send for Printable

impl Sync for Printable

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]