Enum StringValue

Source
pub enum StringValue {
    Intern(StringSymbol),
    Inline(InlineStr),
    Gc(Gc<str>),
}

Variants§

§

Intern(StringSymbol)

§

Inline(InlineStr)

§

Gc(Gc<str>)

Implementations§

Source§

impl StringValue

Source

pub fn new_maybe_interned<S>(s: S) -> Self
where S: AsRef<str>,

Source

pub fn new_uninterned<S>(s: S) -> Self
where S: AsRef<str>,

Source

pub fn new_interned<S>(s: S) -> Self
where S: AsRef<str>,

Source§

impl StringValue

Source

pub fn trace(&self)

Source

pub fn write(&self, buf: &mut impl Write) -> Result

Source

pub fn as_intern(&self) -> StringSymbol

Interns the string, producing a StringSymbol

Source

pub fn make_intern(&mut self)

Interns the string in place.

Source

pub fn with_str<R>(&self, f: impl FnOnce(&str) -> R) -> R

Source

pub fn len(&self) -> usize

Source

pub fn char_count(&self) -> usize

Source

pub fn concat(&self, other: &StringValue) -> ExecResult<StringValue>

Trait Implementations§

Source§

impl Clone for StringValue

Source§

fn clone(&self) -> StringValue

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StringValue

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Display for StringValue

Source§

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

Formats the value using the given formatter. Read more
Source§

impl From<Gc<str>> for StringValue

Source§

fn from(gc_str: Gc<str>) -> Self

Converts to this type from the input type.
Source§

impl From<StrBuffer<14>> for StringValue

Source§

fn from(inline: InlineStr) -> Self

Converts to this type from the input type.
Source§

impl From<StringSymbol> for StringValue

Source§

fn from(symbol: StringSymbol) -> Self

Converts to this type from the input type.
Source§

impl From<StringValue> for Variant

Source§

fn from(value: StringValue) -> Self

Converts to this type from the input type.
Source§

impl Hash for StringValue

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl MetaObject for StringValue

Source§

fn type_tag(&self) -> Type

Source§

fn len(&self) -> Option<ExecResult<usize>>

Source§

fn op_add(&self, rhs: &Variant) -> Option<ExecResult<Variant>>

Source§

fn op_radd(&self, lhs: &Variant) -> Option<ExecResult<Variant>>

Source§

fn cmp_eq(&self, other: &Variant) -> Option<ExecResult<bool>>

Source§

fn cmp_lt(&self, other: &Variant) -> Option<ExecResult<bool>>

Source§

fn cmp_le(&self, other: &Variant) -> Option<ExecResult<bool>>

Source§

fn fmt_repr(&self) -> ExecResult<StringValue>

Source§

fn type_name(&self) -> ExecResult<StringValue>

Source§

fn as_bool(&self) -> ExecResult<bool>

Source§

fn as_bits(&self) -> Option<ExecResult<IntType>>

Source§

fn as_int(&self) -> Option<ExecResult<IntType>>

Source§

fn as_float(&self) -> Option<ExecResult<FloatType>>

Source§

fn iter_init(&self) -> Option<ExecResult<IterState>>

Source§

fn iter_next(&self, state: &Variant) -> Option<ExecResult<Variant>>

Source§

fn iter_get(&self, state: &Variant) -> Option<ExecResult<Variant>>

Source§

fn invoke(&self, args: &[Variant]) -> Option<ExecResult<Call>>

Source§

fn op_neg(&self) -> Option<ExecResult<Variant>>

Source§

fn op_pos(&self) -> Option<ExecResult<Variant>>

Source§

fn op_inv(&self) -> Option<ExecResult<Variant>>

Source§

fn op_mul(&self, rhs: &Variant) -> Option<ExecResult<Variant>>

Source§

fn op_rmul(&self, lhs: &Variant) -> Option<ExecResult<Variant>>

Source§

fn op_div(&self, rhs: &Variant) -> Option<ExecResult<Variant>>

Source§

fn op_rdiv(&self, lhs: &Variant) -> Option<ExecResult<Variant>>

Source§

fn op_mod(&self, rhs: &Variant) -> Option<ExecResult<Variant>>

Source§

fn op_rmod(&self, lhs: &Variant) -> Option<ExecResult<Variant>>

Source§

fn op_sub(&self, rhs: &Variant) -> Option<ExecResult<Variant>>

Source§

fn op_rsub(&self, lhs: &Variant) -> Option<ExecResult<Variant>>

Source§

fn op_and(&self, rhs: &Variant) -> Option<ExecResult<Variant>>

Source§

fn op_rand(&self, lhs: &Variant) -> Option<ExecResult<Variant>>

Source§

fn op_xor(&self, rhs: &Variant) -> Option<ExecResult<Variant>>

Source§

fn op_rxor(&self, lhs: &Variant) -> Option<ExecResult<Variant>>

Source§

fn op_or(&self, rhs: &Variant) -> Option<ExecResult<Variant>>

Source§

fn op_ror(&self, lhs: &Variant) -> Option<ExecResult<Variant>>

Source§

fn op_shl(&self, rhs: &Variant) -> Option<ExecResult<Variant>>

Source§

fn op_rshl(&self, lhs: &Variant) -> Option<ExecResult<Variant>>

Source§

fn op_shr(&self, rhs: &Variant) -> Option<ExecResult<Variant>>

Source§

fn op_rshr(&self, lhs: &Variant) -> Option<ExecResult<Variant>>

Source§

impl Ord for StringValue

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for StringValue

Source§

fn eq(&self, other: &StringValue) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for StringValue

Source§

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 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Copy for StringValue

Source§

impl Eq for StringValue

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CallHasher for T
where T: Hash + ?Sized,

Source§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64
where H: Hash + ?Sized, B: BuildHasher,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.