Type Alias starlark::values::FrozenStringValue
source · pub type FrozenStringValue = FrozenValueTyped<'static, StarlarkStr>;
Expand description
Convenient type alias.
We use FrozenValueTyped<StarlarkStr>
often, but also we define more operations
on FrozenValueTyped<StarlarkStr>
than on generic FrozenValueTyped<T>
.
Note there’s a macro const_frozen_string!
to statically allocate FrozenStringValue
:
use starlark::const_frozen_string;
use starlark::values::FrozenStringValue;
use starlark::values::FrozenValue;
let fv: FrozenStringValue = const_frozen_string!("magic");
assert_eq!("magic", fv.as_str());
Aliased Type§
struct FrozenStringValue(/* private fields */);
Implementations§
source§impl FrozenStringValue
impl FrozenStringValue
sourcepub fn get_hashed(self) -> Hashed<Self>
pub fn get_hashed(self) -> Hashed<Self>
Get self along with the hash.
sourcepub fn get_hashed_value(self) -> Hashed<FrozenValue>
pub fn get_hashed_value(self) -> Hashed<FrozenValue>
Get the FrozenValue
along with the hash.
sourcepub fn get_hashed_str(self) -> Hashed<&'static str>
pub fn get_hashed_str(self) -> Hashed<&'static str>
Get the string reference along with the hash.
Trait Implementations§
source§impl Borrow<str> for FrozenStringValue
impl Borrow<str> for FrozenStringValue
source§impl Default for FrozenStringValue
impl Default for FrozenStringValue
source§impl<'v> Equivalent<ValueTyped<'v, StarlarkStr>> for FrozenStringValue
impl<'v> Equivalent<ValueTyped<'v, StarlarkStr>> for FrozenStringValue
source§fn equivalent(&self, key: &StringValue<'v>) -> bool
fn equivalent(&self, key: &StringValue<'v>) -> bool
Compare self to
key
and return true
if they are equal.source§impl Hash for FrozenStringValue
impl Hash for FrozenStringValue
source§impl Ord for FrozenStringValue
impl Ord for FrozenStringValue
source§impl<'v> PartialEq<ValueTyped<'v, StarlarkStr>> for FrozenStringValue
impl<'v> PartialEq<ValueTyped<'v, StarlarkStr>> for FrozenStringValue
source§fn eq(&self, other: &StringValue<'v>) -> bool
fn eq(&self, other: &StringValue<'v>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for FrozenStringValue
impl PartialOrd for FrozenStringValue
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 FrozenStringValue
impl<'v> StringValueLike<'v> for FrozenStringValue
source§fn to_string_value(self) -> StringValue<'v>
fn to_string_value(self) -> StringValue<'v>
Convert to a
StringValue
.