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
impl ValueData
Sourcepub fn with_region(value: ValueEnum, region: WeakRegion) -> ValueData
pub fn with_region(value: ValueEnum, region: WeakRegion) -> ValueData
Create ValueData from a ValueEnum having a given region
Sourcepub fn add_dependent(&mut self, dependent: WeakNode<Self>)
pub fn add_dependent(&mut self, dependent: WeakNode<Self>)
Add a dependent to a value
Sourcepub fn dependencies(&self) -> Dependencies<'_> ⓘ
pub fn dependencies(&self) -> Dependencies<'_> ⓘ
Iterate over the direct dependencies for the given node
Sourcepub fn dependents(&self) -> &[WeakId] ⓘ
pub fn dependents(&self) -> &[WeakId] ⓘ
Get the direct dependents of a given node
Methods from Deref<Target = ValueEnum>§
Sourcepub fn applicable(&self) -> bool
pub fn applicable(&self) -> bool
Check whether this value enum variant can potentially be applied
Sourcepub fn name_print(
&self,
fmt: &mut Formatter<'_>,
name: Option<&str>,
) -> Result<(), Error>
pub fn name_print( &self, fmt: &mut Formatter<'_>, name: Option<&str>, ) -> Result<(), Error>
Print a value with a name
Sourcepub fn base_region(&self) -> Cow<'_, WeakRegion>
pub fn base_region(&self) -> Cow<'_, WeakRegion>
Get the base region of this ValueEnum
Trait Implementations§
Source§impl NodeData for ValueData
impl NodeData for ValueData
Source§type Error = ValueError
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>>
type CacheAcceptor = Entry<'static, u64, WeakNode<ValueData>, BuildHasherDefault<PassThroughHasher>>
An acceptor for cache entries
Source§fn backlink(
&mut self,
backlink: Backlink<'_, ValueData>,
) -> Result<(), ValueError>
fn backlink( &mut self, backlink: Backlink<'_, ValueData>, ) -> Result<(), ValueError>
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!Auto Trait Implementations§
impl Freeze for ValueData
impl !RefUnwindSafe for ValueData
impl Send for ValueData
impl Sync for ValueData
impl Unpin for ValueData
impl !UnwindSafe for ValueData
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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