pub struct FieldTaintMap { /* private fields */ }Expand description
Maps field paths to their taint states
This data structure tracks taint at the field level, enabling precise analysis where only specific fields of a struct are tainted.
Implementations§
Source§impl FieldTaintMap
impl FieldTaintMap
Sourcepub fn set_field_taint(&mut self, path: FieldPath, taint: FieldTaint)
pub fn set_field_taint(&mut self, path: FieldPath, taint: FieldTaint)
Set taint state for a specific field
Sourcepub fn get_field_taint(&self, path: &FieldPath) -> FieldTaint
pub fn get_field_taint(&self, path: &FieldPath) -> FieldTaint
Get taint state for a specific field
If the exact field is not in the map, checks parent fields. Returns Unknown if no information is available.
Sourcepub fn set_var_taint(&mut self, base_var: &str, taint: FieldTaint)
pub fn set_var_taint(&mut self, base_var: &str, taint: FieldTaint)
Set taint for an entire variable (all fields)
This is used when a whole struct is assigned a tainted value. In conservative analysis, this taints all known fields of the struct.
Sourcepub fn get_fields_for_var(&self, base_var: &str) -> Vec<(FieldPath, FieldTaint)>
pub fn get_fields_for_var(&self, base_var: &str) -> Vec<(FieldPath, FieldTaint)>
Get all fields for a given base variable
Sourcepub fn has_tainted_field(&self, base_var: &str) -> bool
pub fn has_tainted_field(&self, base_var: &str) -> bool
Check if any field of a variable is tainted
Sourcepub fn merge(&mut self, other: &FieldTaintMap)
pub fn merge(&mut self, other: &FieldTaintMap)
Merge another FieldTaintMap into this one
Used when combining taint states from different paths. If a field appears in both maps, the more specific taint wins: Tainted > Sanitized > Clean > Unknown
Trait Implementations§
Source§impl Clone for FieldTaintMap
impl Clone for FieldTaintMap
Source§fn clone(&self) -> FieldTaintMap
fn clone(&self) -> FieldTaintMap
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FieldTaintMap
impl Debug for FieldTaintMap
Auto Trait Implementations§
impl Freeze for FieldTaintMap
impl RefUnwindSafe for FieldTaintMap
impl Send for FieldTaintMap
impl Sync for FieldTaintMap
impl Unpin for FieldTaintMap
impl UnsafeUnpin for FieldTaintMap
impl UnwindSafe for FieldTaintMap
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> 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