pub enum StringValue {
Intern(StringSymbol),
Inline(InlineStr),
Gc(Gc<str>),
}
Variants
Intern(StringSymbol)
Inline(InlineStr)
Gc(Gc<str>)
Implementations
sourceimpl StringValue
impl StringValue
pub fn new_maybe_interned<S>(s: S) -> Self where
S: AsRef<str>,
pub fn new_uninterned<S>(s: S) -> Self where
S: AsRef<str>,
pub fn new_interned<S>(s: S) -> Self where
S: AsRef<str>,
sourceimpl 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
sourceimpl Clone for StringValue
impl Clone for StringValue
sourcefn clone(&self) -> StringValue
fn clone(&self) -> StringValue
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for StringValue
impl Debug for StringValue
sourceimpl Display for StringValue
impl Display for StringValue
sourceimpl From<Gc<str>> for StringValue
impl From<Gc<str>> for StringValue
sourceimpl From<StrBuffer<22_usize>> for StringValue
impl From<StrBuffer<22_usize>> for StringValue
sourceimpl From<StringSymbol> for StringValue
impl From<StringSymbol> for StringValue
sourcefn from(symbol: StringSymbol) -> Self
fn from(symbol: StringSymbol) -> Self
Converts to this type from the input type.
sourceimpl From<StringValue> for Variant
impl From<StringValue> for Variant
sourcefn from(value: StringValue) -> Self
fn from(value: StringValue) -> Self
Converts to this type from the input type.
sourceimpl Hash for StringValue
impl Hash for StringValue
sourceimpl 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_str(&self) -> ExecResult<StringValue>
fn fmt_echo(&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 next(&self) -> Option<ExecResult<Variant>>
fn iter(&self) -> 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>>
sourceimpl Ord for StringValue
impl Ord for StringValue
sourceimpl PartialEq<StringValue> for StringValue
impl PartialEq<StringValue> for StringValue
sourceimpl PartialOrd<StringValue> for StringValue
impl PartialOrd<StringValue> for StringValue
sourcefn partial_cmp(&self, other: &StringValue) -> Option<Ordering>
fn partial_cmp(&self, other: &StringValue) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for StringValue
impl Eq for StringValue
Auto Trait Implementations
impl RefUnwindSafe for StringValue
impl !Send for StringValue
impl !Sync for StringValue
impl Unpin for StringValue
impl UnwindSafe for StringValue
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CallHasher for T where
T: Hash + ?Sized,
impl<T> CallHasher for T where
T: Hash + ?Sized,
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more