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>

source

pub fn get_hashed(self) -> Hashed<Self>

Get self along with the hash.

source

pub fn get_hashed_value(self) -> Hashed<FrozenValue>

Get the FrozenValue along with the hash.

source

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>

source

pub unsafe fn new_unchecked(value: FrozenValue) -> FrozenValueTyped<'v, T>

Construct FrozenValueTyped without checking that the value is of correct type.

source

pub fn new(value: FrozenValue) -> Option<FrozenValueTyped<'v, T>>

Downcast.

source

pub fn to_frozen_value(self) -> FrozenValue

Erase the type.

source

pub fn to_value(self) -> Value<'v>

Convert to the value.

source

pub fn to_value_typed(self) -> ValueTyped<'v, T>

Convert to the value.

source

pub fn as_ref(self) -> &'v T

Get the reference to the pointed value.

source§

impl<'v> FrozenValueTyped<'v, StarlarkStr>

source

pub fn as_str(self) -> &'v str

Get the Rust string reference.

Trait Implementations§

source§

impl<'v, T: StarlarkValue<'v>> AllocFrozenValue for FrozenValueTyped<'v, T>

source§

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>

source§

fn alloc_value(self, _heap: &'v Heap) -> Value<'v>

Allocate the value on a heap and return a reference to the allocated value. Read more
source§

impl<'v, T: StarlarkValue<'v>> Allocative for FrozenValueTyped<'v, T>

source§

fn visit<'allocative_a, 'allocative_b: 'allocative_a>( &self, visitor: &'allocative_a mut Visitor<'allocative_b> )

source§

impl<'v, T: StarlarkValue<'v>> Clone for FrozenValueTyped<'v, T>

source§

fn clone(&self) -> Self

Returns a copy 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<'v, T: StarlarkValue<'v>> Debug for FrozenValueTyped<'v, T>

source§

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

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

impl<'v, T: StarlarkValue<'v>> Deref for FrozenValueTyped<'v, T>

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &T

Dereferences the value.
source§

impl<'v, T: StarlarkValue<'v>> Display for FrozenValueTyped<'v, T>

source§

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

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

impl<'v, T: StarlarkValue<'v>> Dupe for FrozenValueTyped<'v, T>

source§

fn dupe(&self) -> Self

source§

impl<'v> Equivalent<FrozenValueTyped<'static, StarlarkStr>> for StringValue<'v>

source§

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>

§

type Frozen = FrozenValueTyped<'static, T>

When type is frozen, it is frozen into this type.
source§

fn freeze(self, _freezer: &Freezer) -> Result<Self::Frozen>

Freeze a value. The frozen value must be equal to the original, and produce the same hash. Read more
source§

impl<'v> PartialEq<FrozenValueTyped<'static, StarlarkStr>> for StringValue<'v>

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'v, T: StarlarkValue<'v>> PartialEq for FrozenValueTyped<'v, T>

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'v, T: StarlarkValue<'v> + ProvidesStaticType<'v> + Sized> ProvidesStaticType<'v> for FrozenValueTyped<'v, T>
where T::StaticType: StarlarkValue<'static> + Sized,

§

type StaticType = FrozenValueTyped<'static, <T as ProvidesStaticType<'v>>::StaticType>

Same type as Self but with lifetimes dropped to 'static. Read more
source§

impl<'v, T: StarlarkValue<'v>> Serialize for FrozenValueTyped<'v, T>

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<'v, T: StarlarkValue<'v>> StarlarkTypeRepr for FrozenValueTyped<'v, T>

source§

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>

source§

fn trace(&mut self, _tracer: &Tracer<'v>)

Recursively “trace” the value. Read more
source§

impl<'v, T: StarlarkValue<'v>> Coerce<FrozenValueTyped<'v, T>> for FrozenValueTyped<'v, T>

source§

impl<'v, T: StarlarkValue<'v>> Coerce<Value<'v>> for FrozenValueTyped<'v, T>

source§

impl<'v, T: StarlarkValue<'v>> CoerceKey<FrozenValueTyped<'v, T>> for FrozenValueTyped<'v, T>

source§

impl<'v, T: StarlarkValue<'v>> CoerceKey<Value<'v>> for FrozenValueTyped<'v, T>

source§

impl<'v, T: StarlarkValue<'v>> Copy for FrozenValueTyped<'v, T>

source§

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<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<'a, T> AnyLifetime<'a> for T
where T: ProvidesStaticType<'a> + 'a + ?Sized,

source§

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

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

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> Serialize for T
where T: Serialize + ?Sized,

source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>

source§

impl<T> ToAst for T

source§

fn ast(self, begin: usize, end: usize) -> Spanned<Self>

source§

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

§

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§

default 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>,

§

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>,

§

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.