Struct starlark::values::FrozenValueTyped
source · pub struct FrozenValueTyped<'v, T: StarlarkValue<'v>>(/* private fields */);
Expand description
FrozenValue
wrapper which asserts contained value is of type <T>
.
Implementations§
source§impl FrozenValueTyped<'static, StarlarkStr>
impl FrozenValueTyped<'static, StarlarkStr>
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.
source§impl<'v, T: StarlarkValue<'v>> FrozenValueTyped<'v, T>
impl<'v, T: StarlarkValue<'v>> FrozenValueTyped<'v, T>
sourcepub unsafe fn new_unchecked(value: FrozenValue) -> FrozenValueTyped<'v, T>
pub unsafe fn new_unchecked(value: FrozenValue) -> FrozenValueTyped<'v, T>
Construct FrozenValueTyped
without checking that the value is of correct type.
sourcepub fn new(value: FrozenValue) -> Option<FrozenValueTyped<'v, T>>
pub fn new(value: FrozenValue) -> Option<FrozenValueTyped<'v, T>>
Downcast.
sourcepub fn to_frozen_value(self) -> FrozenValue
pub fn to_frozen_value(self) -> FrozenValue
Erase the type.
sourcepub fn to_value_typed(self) -> ValueTyped<'v, T>
pub fn to_value_typed(self) -> ValueTyped<'v, T>
Convert to the value.
source§impl<'v> FrozenValueTyped<'v, StarlarkStr>
impl<'v> FrozenValueTyped<'v, StarlarkStr>
Trait Implementations§
source§impl<'v, T: StarlarkValue<'v>> AllocFrozenValue for FrozenValueTyped<'v, T>
impl<'v, T: StarlarkValue<'v>> AllocFrozenValue for FrozenValueTyped<'v, T>
source§fn alloc_frozen_value(self, _heap: &FrozenHeap) -> FrozenValue
fn alloc_frozen_value(self, _heap: &FrozenHeap) -> FrozenValue
Allocate a value in the frozen heap and return a reference to the allocated value.
source§impl<'v, 'f, T: StarlarkValue<'f>> AllocValue<'v> for FrozenValueTyped<'f, T>
impl<'v, 'f, T: StarlarkValue<'f>> AllocValue<'v> for FrozenValueTyped<'f, T>
source§impl<'v, T: StarlarkValue<'v>> Allocative for FrozenValueTyped<'v, T>
impl<'v, T: StarlarkValue<'v>> Allocative for FrozenValueTyped<'v, T>
source§impl<'v, T: StarlarkValue<'v>> Clone for FrozenValueTyped<'v, T>
impl<'v, T: StarlarkValue<'v>> Clone for FrozenValueTyped<'v, T>
source§impl<'v, T: StarlarkValue<'v>> Debug for FrozenValueTyped<'v, T>
impl<'v, T: StarlarkValue<'v>> Debug for FrozenValueTyped<'v, T>
source§impl<'v, T: StarlarkValue<'v>> Deref for FrozenValueTyped<'v, T>
impl<'v, T: StarlarkValue<'v>> Deref for FrozenValueTyped<'v, T>
source§impl<'v, T: StarlarkValue<'v>> Display for FrozenValueTyped<'v, T>
impl<'v, T: StarlarkValue<'v>> Display for FrozenValueTyped<'v, T>
source§impl<'v, T: StarlarkValue<'v>> Dupe for FrozenValueTyped<'v, T>
impl<'v, T: StarlarkValue<'v>> Dupe for FrozenValueTyped<'v, T>
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<T: StarlarkValue<'static>> Freeze for FrozenValueTyped<'static, T>
impl<T: StarlarkValue<'static>> Freeze for FrozenValueTyped<'static, T>
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, T: StarlarkValue<'v>> PartialEq for FrozenValueTyped<'v, T>
impl<'v, T: StarlarkValue<'v>> PartialEq for FrozenValueTyped<'v, T>
source§impl<'v, T: StarlarkValue<'v> + ProvidesStaticType<'v> + Sized> ProvidesStaticType<'v> for FrozenValueTyped<'v, T>
impl<'v, T: StarlarkValue<'v> + ProvidesStaticType<'v> + Sized> ProvidesStaticType<'v> for FrozenValueTyped<'v, T>
§type StaticType = FrozenValueTyped<'static, <T as ProvidesStaticType<'v>>::StaticType>
type StaticType = FrozenValueTyped<'static, <T as ProvidesStaticType<'v>>::StaticType>
source§impl<'v, T: StarlarkValue<'v>> Serialize for FrozenValueTyped<'v, T>
impl<'v, T: StarlarkValue<'v>> Serialize for FrozenValueTyped<'v, T>
source§impl<'v, T: StarlarkValue<'v>> StarlarkTypeRepr for FrozenValueTyped<'v, T>
impl<'v, T: StarlarkValue<'v>> StarlarkTypeRepr for FrozenValueTyped<'v, T>
source§fn starlark_type_repr() -> Ty
fn starlark_type_repr() -> Ty
The representation of a type that a user would use verbatim in starlark type annotations
source§impl<'v, 'f, T: StarlarkValue<'f>> Trace<'v> for FrozenValueTyped<'f, T>
impl<'v, 'f, T: StarlarkValue<'f>> Trace<'v> for FrozenValueTyped<'f, T>
impl<'v, T: StarlarkValue<'v>> Coerce<FrozenValueTyped<'v, T>> for FrozenValueTyped<'v, T>
impl<'v, T: StarlarkValue<'v>> Coerce<Value<'v>> for FrozenValueTyped<'v, T>
impl<'v, T: StarlarkValue<'v>> CoerceKey<FrozenValueTyped<'v, T>> for FrozenValueTyped<'v, T>
impl<'v, T: StarlarkValue<'v>> CoerceKey<Value<'v>> for FrozenValueTyped<'v, T>
impl<'v, T: StarlarkValue<'v>> Copy for FrozenValueTyped<'v, T>
impl<'v, T: StarlarkValue<'v>> Eq for FrozenValueTyped<'v, T>
Auto Trait Implementations§
impl<'v, T> RefUnwindSafe for FrozenValueTyped<'v, T>where
T: RefUnwindSafe,
impl<'v, T> Send for FrozenValueTyped<'v, T>where
T: Sync,
impl<'v, T> Sync for FrozenValueTyped<'v, T>where
T: Sync,
impl<'v, T> Unpin for FrozenValueTyped<'v, T>
impl<'v, T> UnwindSafe for FrozenValueTyped<'v, T>where
T: RefUnwindSafe,
Blanket Implementations§
source§impl<'a, T> AnyLifetime<'a> for Twhere
T: ProvidesStaticType<'a> + 'a + ?Sized,
impl<'a, T> AnyLifetime<'a> for Twhere
T: ProvidesStaticType<'a> + 'a + ?Sized,
source§fn static_type_id() -> TypeId
fn static_type_id() -> TypeId
Must return the
TypeId
of Self
but where the lifetimes are changed
to 'static
. Must be consistent with static_type_of
.source§fn static_type_of(&self) -> TypeId
fn static_type_of(&self) -> TypeId
Must return the
TypeId
of Self
but where the lifetimes are changed
to 'static
. Must be consistent with static_type_id
. Must not
consult the self
parameter in any way.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
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.