Struct ValueData

Source
pub struct ValueData {
    pub value: ValueEnum,
    pub name: Option<String>,
    pub region: WeakRegion,
    /* private fields */
}
Expand description

The data associated with a rain value

Fields§

§value: ValueEnum

The value itself

§name: Option<String>

The name associated with this value, if any

§region: WeakRegion

The region this value is defined in

Implementations§

Source§

impl ValueData

Source

pub fn with_region(value: ValueEnum, region: WeakRegion) -> ValueData

Create ValueData from a ValueEnum having a given region

Source

pub fn new(value: ValueEnum) -> ValueData

Create ValueData from a ValueEnum with no region

Source

pub fn add_dependent(&mut self, dependent: WeakNode<Self>)

Add a dependent to a value

Source

pub fn dependencies(&self) -> Dependencies<'_>

Iterate over the direct dependencies for the given node

Source

pub fn dependents(&self) -> &[WeakId]

Get the direct dependents of a given node

Methods from Deref<Target = ValueEnum>§

Source

pub fn applicable(&self) -> bool

Check whether this value enum variant can potentially be applied

Source

pub fn name_print( &self, fmt: &mut Formatter<'_>, name: Option<&str>, ) -> Result<(), Error>

Print a value with a name

Source

pub fn base_region(&self) -> Cow<'_, WeakRegion>

Get the base region of this ValueEnum

Trait Implementations§

Source§

impl<V> CacheBy<V> for ValueData
where V: ValueDesc + Hash,

Source§

type CacheError = <V as ValueDesc>::Err

Potential error when trying to cache a key type
Source§

fn node_to_cache(key: V) -> Result<ValId, V::Err>

Try to get the node to cache for a given key
Source§

impl Clone for ValueData

Source§

fn clone(&self) -> ValueData

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 ValueData

Source§

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

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

impl Display for ValueData

Source§

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

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

impl From<Binary> for ValueData

Source§

fn from(p: Binary) -> ValueData

Converts to this type from the input type.
Source§

impl From<Bool> for ValueData

Source§

fn from(p: Bool) -> ValueData

Converts to this type from the input type.
Source§

impl From<Lambda> for ValueData

Source§

fn from(lambda: Lambda) -> ValueData

Converts to this type from the input type.
Source§

impl From<LogicalOp> for ValueData

Source§

fn from(p: LogicalOp) -> ValueData

Converts to this type from the input type.
Source§

impl From<Parameter> for ValueData

Source§

fn from(param: Parameter) -> ValueData

Converts to this type from the input type.
Source§

impl From<Sexpr> for ValueData

Source§

fn from(sexpr: Sexpr) -> ValueData

Converts to this type from the input type.
Source§

impl From<Unary> for ValueData

Source§

fn from(p: Unary) -> ValueData

Converts to this type from the input type.
Source§

impl From<Unit> for ValueData

Source§

fn from(p: Unit) -> ValueData

Converts to this type from the input type.
Source§

impl From<ValueEnum> for ValueData

Source§

fn from(value: ValueEnum) -> ValueData

Converts to this type from the input type.
Source§

impl From<bool> for ValueData

Source§

fn from(p: bool) -> ValueData

Converts to this type from the input type.
Source§

impl Hash for ValueData

Source§

fn hash<H: Hasher>(&self, hasher: &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 NodeData for ValueData

Source§

type Error = ValueError

A possible error in placing an item into a node or deduplicating
Source§

type CacheAcceptor = Entry<'static, u64, WeakNode<ValueData>, BuildHasherDefault<PassThroughHasher>>

An acceptor for cache entries
Backlink this data to the given node. Warning: Any attempt to read the data of backlink in this function will lead to deadlock! Backlinking should not create new nodes if dedup obtains a lock on the cache table!
Source§

fn dedup(&mut self) -> Either<ValId, CacheEntry<'static, ValueData>>

Attempt to deduplicate this NodeData, either succeeding or returning a cache entry to place the newly created node in should backlinking succeed.
Source§

impl PartialEq for ValueData

Source§

fn eq(&self, other: &ValueData) -> 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 TryFrom<SexprArgs> for ValueData

Source§

type Error = ValueError

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

fn try_from(args: SexprArgs) -> Result<ValueData, ValueError>

Performs the conversion.
Source§

impl Deref for ValueData

Source§

type Target = ValueEnum

The resulting type after dereferencing.
Source§

fn deref(&self) -> &ValueEnum

Dereferences the value.

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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V