Type Alias starlark::values::StringValue
source · pub type StringValue<'v> = ValueTyped<'v, StarlarkStr>;
Expand description
Convenient type alias.
We use ValueTyped<StarlarkStr>
often, but also we define more operations
on ValueTyped<StarlarkStr>
than on generic ValueTyped<T>
.
Aliased Type§
struct StringValue<'v>(/* private fields */);
Implementations§
source§impl<'v> StringValue<'v>
impl<'v> StringValue<'v>
sourcepub fn freeze(self, freezer: &Freezer) -> Result<FrozenStringValue>
pub fn freeze(self, freezer: &Freezer) -> Result<FrozenStringValue>
Convert a value to a FrozenStringValue
using a supplied Freezer
.
sourcepub fn get_hashed(self) -> Hashed<Self>
pub fn get_hashed(self) -> Hashed<Self>
Get self along with the hash.
sourcepub fn get_hashed_str(self) -> Hashed<&'v str>
pub fn get_hashed_str(self) -> Hashed<&'v str>
Get the string reference along with the hash.
sourcepub fn get_hashed_value(self) -> Hashed<Value<'v>>
pub fn get_hashed_value(self) -> Hashed<Value<'v>>
Get the Value
along with the hash.
sourcepub fn unpack_frozen(self) -> Option<FrozenStringValue>
pub fn unpack_frozen(self) -> Option<FrozenStringValue>
If this string value is frozen, return it.
Trait Implementations§
source§impl<'v> Borrow<str> for StringValue<'v>
impl<'v> Borrow<str> for StringValue<'v>
source§impl<'v> Default for StringValue<'v>
impl<'v> Default for StringValue<'v>
source§impl<'v> Equivalent<FrozenValueTyped<'static, StarlarkStr>> for StringValue<'v>
impl<'v> Equivalent<FrozenValueTyped<'static, StarlarkStr>> for StringValue<'v>
source§fn equivalent(&self, key: &FrozenStringValue) -> bool
fn equivalent(&self, key: &FrozenStringValue) -> bool
Compare self to
key
and return true
if they are equal.source§impl<'v> Freeze for StringValue<'v>
impl<'v> Freeze for StringValue<'v>
§type Frozen = FrozenValueTyped<'static, StarlarkStr>
type Frozen = FrozenValueTyped<'static, StarlarkStr>
When type is frozen, it is frozen into this type.
source§impl<'v> Hash for StringValue<'v>
impl<'v> Hash for StringValue<'v>
source§impl<'v> Ord for StringValue<'v>
impl<'v> Ord for StringValue<'v>
source§impl<'v> PartialEq<FrozenValueTyped<'static, StarlarkStr>> for StringValue<'v>
impl<'v> PartialEq<FrozenValueTyped<'static, StarlarkStr>> for StringValue<'v>
source§fn eq(&self, other: &FrozenStringValue) -> bool
fn eq(&self, other: &FrozenStringValue) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<'v> PartialOrd for StringValue<'v>
impl<'v> PartialOrd for StringValue<'v>
1.0.0 · source§fn 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 moresource§impl<'v> StringValueLike<'v> for StringValue<'v>
impl<'v> StringValueLike<'v> for StringValue<'v>
source§fn to_string_value(self) -> StringValue<'v>
fn to_string_value(self) -> StringValue<'v>
Convert to a
StringValue
.