#[non_exhaustive]pub struct TypeFact {
pub ty: PerlType,
pub confidence: Confidence,
pub evidence: Vec<TypeEvidence>,
pub dynamic_boundary: Option<DynamicBoundary>,
pub shape: Option<ShapeFact>,
}Expand description
A type with confidence, evidence, dynamic-boundary, and shape metadata.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.ty: PerlTypeThe erased coarse Perl type represented by this fact.
confidence: ConfidenceConfidence assigned to this fact.
evidence: Vec<TypeEvidence>Evidence that produced or refined this fact.
dynamic_boundary: Option<DynamicBoundary>Dynamic boundary that prevented precise inference, when applicable.
shape: Option<ShapeFact>Optional structural shape information for aggregate or object values.
Implementations§
Source§impl TypeFact
impl TypeFact
Sourcepub fn new(ty: PerlType, confidence: Confidence) -> TypeFact
pub fn new(ty: PerlType, confidence: Confidence) -> TypeFact
Creates a type fact with the supplied coarse type and confidence.
Sourcepub fn from_type(ty: PerlType) -> TypeFact
pub fn from_type(ty: PerlType) -> TypeFact
Creates a high-confidence fact for an existing erased type.
Sourcepub fn dynamic(boundary: DynamicBoundary) -> TypeFact
pub fn dynamic(boundary: DynamicBoundary) -> TypeFact
Creates a low-confidence unknown fact with a dynamic-boundary marker.
Sourcepub fn any_low_confidence(reason: impl Into<String>) -> TypeFact
pub fn any_low_confidence(reason: impl Into<String>) -> TypeFact
Creates a low-confidence unknown fact with heuristic evidence.
Sourcepub fn unknown_hash() -> TypeFact
pub fn unknown_hash() -> TypeFact
Creates an unknown hash fact suitable for uninitialized hash variables.
Sourcepub fn erased_type(&self) -> PerlType
pub fn erased_type(&self) -> PerlType
Returns the coarse compatibility type for existing APIs.
Trait Implementations§
impl StructuralPartialEq for TypeFact
Auto Trait Implementations§
impl Freeze for TypeFact
impl RefUnwindSafe for TypeFact
impl Send for TypeFact
impl Sync for TypeFact
impl Unpin for TypeFact
impl UnsafeUnpin for TypeFact
impl UnwindSafe for TypeFact
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