pub struct InferenceError {
pub id: u64,
pub variable: String,
pub source_file: String,
pub source_line: u32,
pub predicted: InferredOwnership,
pub expected: InferredOwnership,
pub confidence: f64,
pub c_features: Vec<String>,
pub rust_error: Option<String>,
pub defect: OwnershipDefect,
pub timestamp: u64,
}Expand description
An ownership inference error record.
Fields§
§id: u64Unique error ID
variable: StringVariable name
source_file: StringSource file
source_line: u32Source line
predicted: InferredOwnershipPredicted ownership
expected: InferredOwnershipExpected ownership (ground truth)
confidence: f64Confidence of prediction
c_features: Vec<String>C features present in context
rust_error: Option<String>Rust error code (if compilation failed)
defect: OwnershipDefectDefect category
timestamp: u64Timestamp
Implementations§
Source§impl InferenceError
impl InferenceError
Sourcepub fn new(
variable: impl Into<String>,
source_file: impl Into<String>,
source_line: u32,
predicted: InferredOwnership,
expected: InferredOwnership,
confidence: f64,
defect: OwnershipDefect,
) -> Self
pub fn new( variable: impl Into<String>, source_file: impl Into<String>, source_line: u32, predicted: InferredOwnership, expected: InferredOwnership, confidence: f64, defect: OwnershipDefect, ) -> Self
Create a new inference error.
Sourcepub fn with_features(self, features: Vec<String>) -> Self
pub fn with_features(self, features: Vec<String>) -> Self
Add C features to the error.
Sourcepub fn with_rust_error(self, error: impl Into<String>) -> Self
pub fn with_rust_error(self, error: impl Into<String>) -> Self
Add Rust error code.
Trait Implementations§
Source§impl Clone for InferenceError
impl Clone for InferenceError
Source§fn clone(&self) -> InferenceError
fn clone(&self) -> InferenceError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InferenceError
impl Debug for InferenceError
Source§impl<'de> Deserialize<'de> for InferenceError
impl<'de> Deserialize<'de> for InferenceError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for InferenceError
impl RefUnwindSafe for InferenceError
impl Send for InferenceError
impl Sync for InferenceError
impl Unpin for InferenceError
impl UnwindSafe for InferenceError
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