Struct kdb::Symbol [−][src]
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]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<Symbol> for Symbol
[src]
Auto Trait Implementations
impl RefUnwindSafe for Symbol
[src]
impl !Send for Symbol
[src]
impl !Sync for Symbol
[src]
impl Unpin for Symbol
[src]
impl UnwindSafe for Symbol
[src]
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,
pub 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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,