Struct kdb::Symbol[][src]

#[repr(transparent)]pub struct Symbol(_);

Represents a KDB Symbol (interned string) Implements basic symbol operations for efficiency Can be converted to/from strings

Implementations

impl Symbol[src]

pub fn new<T: AsRef<str>>(st: T) -> Result<Symbol, SymbolError>[src]

Create a new symbol from the specified string. If the string is too long, or contains an embedded nul character, then it returns an error.

pub unsafe fn new_unchecked<T: AsRef<str>>(st: T) -> Symbol[src]

Creates a new symbol, skipping the safety checks for length

Safety

Any string passed in must not contain embedded nul characters (\0). It's length must be less than or equal to isize::MAX.

pub fn try_as_str(&self) -> Result<&'static str, ConversionError>[src]

Attempts to convert to a valid utf-8 string. This will return an error if the string contains invalid utf-8 characters. This function does not allocate.

pub unsafe fn as_str_unchecked(&self) -> &'static str[src]

Converts the symbol to a rust str without checking if it is valid.

Safety

The string must be valid UTF-8. It's length must be less than or equal to isize::MAX.

Trait Implementations

impl Clone for Symbol[src]

impl Copy for Symbol[src]

impl Debug for Symbol[src]

impl Display for Symbol[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Display for symbol will always render a string representation of the symbol. If the string contains invalid characters it will strip them from the string. This function will allocate only if the string conatins invalid utf-8 characters.

impl Eq for Symbol[src]

impl From<Atom<Symbol>> for Symbol[src]

impl Hash for Symbol[src]

impl PartialEq<Symbol> for Symbol[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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> 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.