pub enum StringValue {
Intern(StringSymbol),
Inline(InlineStr),
Gc(Gc<str>),
}
Variants§
Implementations§
Source§impl StringValue
impl StringValue
pub fn new_maybe_interned<S>(s: S) -> Self
pub fn new_uninterned<S>(s: S) -> Self
pub fn new_interned<S>(s: S) -> Self
Source§impl StringValue
impl StringValue
pub fn trace(&self)
pub fn write(&self, buf: &mut impl Write) -> Result
Sourcepub fn as_intern(&self) -> StringSymbol
pub fn as_intern(&self) -> StringSymbol
Interns the string, producing a StringSymbol
Sourcepub fn make_intern(&mut self)
pub fn make_intern(&mut self)
Interns the string in place.
pub fn with_str<R>(&self, f: impl FnOnce(&str) -> R) -> R
pub fn len(&self) -> usize
pub fn char_count(&self) -> usize
pub fn concat(&self, other: &StringValue) -> ExecResult<StringValue>
Trait Implementations§
Source§impl Clone for StringValue
impl Clone for StringValue
Source§fn clone(&self) -> StringValue
fn clone(&self) -> StringValue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for StringValue
impl Debug for StringValue
Source§impl Display for StringValue
impl Display for StringValue
Source§impl From<StrBuffer<14>> for StringValue
impl From<StrBuffer<14>> for StringValue
Source§impl From<StringSymbol> for StringValue
impl From<StringSymbol> for StringValue
Source§fn from(symbol: StringSymbol) -> Self
fn from(symbol: StringSymbol) -> Self
Converts to this type from the input type.
Source§impl From<StringValue> for Variant
impl From<StringValue> for Variant
Source§fn from(value: StringValue) -> Self
fn from(value: StringValue) -> Self
Converts to this type from the input type.
Source§impl Hash for StringValue
impl Hash for StringValue
Source§impl MetaObject for StringValue
impl MetaObject for StringValue
fn type_tag(&self) -> Type
fn len(&self) -> Option<ExecResult<usize>>
fn op_add(&self, rhs: &Variant) -> Option<ExecResult<Variant>>
fn op_radd(&self, lhs: &Variant) -> Option<ExecResult<Variant>>
fn cmp_eq(&self, other: &Variant) -> Option<ExecResult<bool>>
fn cmp_lt(&self, other: &Variant) -> Option<ExecResult<bool>>
fn cmp_le(&self, other: &Variant) -> Option<ExecResult<bool>>
fn fmt_repr(&self) -> ExecResult<StringValue>
fn type_name(&self) -> ExecResult<StringValue>
fn as_bool(&self) -> ExecResult<bool>
fn as_bits(&self) -> Option<ExecResult<IntType>>
fn as_int(&self) -> Option<ExecResult<IntType>>
fn as_float(&self) -> Option<ExecResult<FloatType>>
fn iter_init(&self) -> Option<ExecResult<IterState>>
fn iter_next(&self, state: &Variant) -> Option<ExecResult<Variant>>
fn iter_get(&self, state: &Variant) -> Option<ExecResult<Variant>>
fn invoke(&self, args: &[Variant]) -> Option<ExecResult<Call>>
fn op_neg(&self) -> Option<ExecResult<Variant>>
fn op_pos(&self) -> Option<ExecResult<Variant>>
fn op_inv(&self) -> Option<ExecResult<Variant>>
fn op_mul(&self, rhs: &Variant) -> Option<ExecResult<Variant>>
fn op_rmul(&self, lhs: &Variant) -> Option<ExecResult<Variant>>
fn op_div(&self, rhs: &Variant) -> Option<ExecResult<Variant>>
fn op_rdiv(&self, lhs: &Variant) -> Option<ExecResult<Variant>>
fn op_mod(&self, rhs: &Variant) -> Option<ExecResult<Variant>>
fn op_rmod(&self, lhs: &Variant) -> Option<ExecResult<Variant>>
fn op_sub(&self, rhs: &Variant) -> Option<ExecResult<Variant>>
fn op_rsub(&self, lhs: &Variant) -> Option<ExecResult<Variant>>
fn op_and(&self, rhs: &Variant) -> Option<ExecResult<Variant>>
fn op_rand(&self, lhs: &Variant) -> Option<ExecResult<Variant>>
fn op_xor(&self, rhs: &Variant) -> Option<ExecResult<Variant>>
fn op_rxor(&self, lhs: &Variant) -> Option<ExecResult<Variant>>
fn op_or(&self, rhs: &Variant) -> Option<ExecResult<Variant>>
fn op_ror(&self, lhs: &Variant) -> Option<ExecResult<Variant>>
fn op_shl(&self, rhs: &Variant) -> Option<ExecResult<Variant>>
fn op_rshl(&self, lhs: &Variant) -> Option<ExecResult<Variant>>
fn op_shr(&self, rhs: &Variant) -> Option<ExecResult<Variant>>
fn op_rshr(&self, lhs: &Variant) -> Option<ExecResult<Variant>>
Source§impl Ord for StringValue
impl Ord for StringValue
Source§impl PartialEq for StringValue
impl PartialEq for StringValue
Source§impl PartialOrd for StringValue
impl PartialOrd for StringValue
impl Copy for StringValue
impl Eq for StringValue
Auto Trait Implementations§
impl Freeze for StringValue
impl !RefUnwindSafe for StringValue
impl !Send for StringValue
impl !Sync for StringValue
impl Unpin for StringValue
impl !UnwindSafe for StringValue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more