pub struct Symbol(/* private fields */);Expand description
Ruby Symbol (interned string, immediate value).
Symbols are Ruby’s interned strings - immutable strings that are stored once and reused. They’re commonly used for hash keys and method names.
Symbol is an immediate value and does not require GC protection or pinning.
§Example
ⓘ
use solidus::types::Symbol;
let sym = Symbol::new("hello");
assert_eq!(sym.name().unwrap(), "hello");Implementations§
Trait Implementations§
Source§impl ReprValue for Symbol
impl ReprValue for Symbol
Source§unsafe fn from_value_unchecked(val: Value) -> Self
unsafe fn from_value_unchecked(val: Value) -> Self
Create from a Value without type checking. Read more
Source§impl TryConvert for Symbol
impl TryConvert for Symbol
impl Copy for Symbol
Auto Trait Implementations§
impl Freeze for Symbol
impl RefUnwindSafe for Symbol
impl Send for Symbol
impl Sync for Symbol
impl Unpin for Symbol
impl UnwindSafe for Symbol
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)