pub struct ValueClassification {
pub entity_type: Option<EntityType>,
pub impls: Vec<PointerAddress>,
pub tag: Option<ValueTag>,
}Fields§
§entity_type: Option<EntityType>a nominal (entity) type associated with the value (e.g. Example {…})
impls: Vec<PointerAddress>list of impls that are associated with the value (e.g. null + $1234 + $5678)
tag: Option<ValueTag>a value tag, e.g. #Tagged(42)
Implementations§
Source§impl ValueClassification
impl ValueClassification
Sourcepub fn new_unclassified() -> Self
pub fn new_unclassified() -> Self
Creates a new ValueClassification with no entity, no impls, and no tag.
Sourcepub fn new_with_entity(entity: EntityType) -> Self
pub fn new_with_entity(entity: EntityType) -> Self
Creates a new []ValueClassification with the specified entity type.
Sourcepub fn new_with_impls(impls: Vec<PointerAddress>) -> Self
pub fn new_with_impls(impls: Vec<PointerAddress>) -> Self
Creates a new ValueClassification with the specified impls.
Sourcepub fn new_with_tag(tag: impl Into<ValueTag>) -> Self
pub fn new_with_tag(tag: impl Into<ValueTag>) -> Self
Creates a new ValueClassification with the specified tag.
Sourcepub fn new_with_maybe_tag(tag: Option<impl Into<ValueTag>>) -> Self
pub fn new_with_maybe_tag(tag: Option<impl Into<ValueTag>>) -> Self
Creates a new ValueClassification with an optional tag. If the tag is None, the classification will be unclassified.
Sourcepub fn merge(&self, other: ValueClassification) -> ValueClassification
pub fn merge(&self, other: ValueClassification) -> ValueClassification
Merges the current ValueClassification with another one, combining their entity, impls, and tag. Prioritizes the current entity and tag if they exist; otherwise, uses the other classification’s values.
Sourcepub fn tag_str(&self) -> Option<&str>
pub fn tag_str(&self) -> Option<&str>
Returns the tag string if it exists, otherwise returns None.
pub fn is_unclassified(&self) -> bool
Trait Implementations§
Source§impl Clone for ValueClassification
impl Clone for ValueClassification
Source§impl Debug for ValueClassification
impl Debug for ValueClassification
Source§impl Default for ValueClassification
impl Default for ValueClassification
Source§impl<'de> DeserializeWithSerdeContext<'de> for ValueClassification
impl<'de> DeserializeWithSerdeContext<'de> for ValueClassification
fn deserialize_with_ctx<D>(
ctx: &SerdeContext<'_>,
deserializer: D,
) -> Result<Self, D::Error>where
D: Deserializer<'de>,
impl Eq for ValueClassification
Source§impl From<EntityType> for ValueClassification
impl From<EntityType> for ValueClassification
Source§fn from(entity_type: EntityType) -> Self
fn from(entity_type: EntityType) -> Self
Source§impl From<Option<EntityType>> for ValueClassification
impl From<Option<EntityType>> for ValueClassification
Source§fn from(entity_type: Option<EntityType>) -> Self
fn from(entity_type: Option<EntityType>) -> Self
Source§impl From<String> for ValueClassification
impl From<String> for ValueClassification
Source§impl From<ValueClassification> for UnresolvedValueClassification
impl From<ValueClassification> for UnresolvedValueClassification
Source§fn from(classification: ValueClassification) -> Self
fn from(classification: ValueClassification) -> Self
Source§impl From<Vec<PointerAddress>> for ValueClassification
impl From<Vec<PointerAddress>> for ValueClassification
Source§fn from(impls: Vec<PointerAddress>) -> Self
fn from(impls: Vec<PointerAddress>) -> Self
Source§impl Hash for ValueClassification
impl Hash for ValueClassification
Source§impl PartialEq for ValueClassification
impl PartialEq for ValueClassification
Source§impl SerializeWithSerdeContext for ValueClassification
Serialization for ValueClassification.
impl SerializeWithSerdeContext for ValueClassification
Serialization for ValueClassification.
fn serialize_with_ctx<S>(
&self,
ctx: &SerdeContext<'_>,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
Source§impl StructuralEq for ValueClassification
impl StructuralEq for ValueClassification
Source§fn structural_eq(&self, other: &Self) -> bool
fn structural_eq(&self, other: &Self) -> bool
impl StructuralPartialEq for ValueClassification
Auto Trait Implementations§
impl !RefUnwindSafe for ValueClassification
impl !Send for ValueClassification
impl !Sync for ValueClassification
impl !UnwindSafe for ValueClassification
impl Forget for ValueClassification
impl Freeze for ValueClassification
impl Move for ValueClassification
impl Unpin for ValueClassification
impl UnsafeUnpin for ValueClassification
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DeserializeWithSerdeContextDyn for Twhere
T: for<'de> DeserializeWithSerdeContext<'de>,
impl<T> DeserializeWithSerdeContextDyn for Twhere
T: for<'de> DeserializeWithSerdeContext<'de>,
fn deserialize_with_ctx_dyn<'de>( ctx: &SerdeContext<'_>, deserializer: &mut dyn Deserializer<'de>, ) -> Result<T, Error>
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> ⓘ
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> ⓘ
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