pub struct IFCTracker {
pub labels: HashMap<String, SecurityLevel>,
pub violations: Vec<(String, SecurityLevel)>,
}Expand description
Tracks information flow labels for a set of variables.
Fields§
§labels: HashMap<String, SecurityLevel>Security label for each variable.
violations: Vec<(String, SecurityLevel)>Recorded violations: (var, expected_label).
Implementations§
Source§impl IFCTracker
impl IFCTracker
Sourcepub fn assign(&mut self, var: impl Into<String>, level: SecurityLevel)
pub fn assign(&mut self, var: impl Into<String>, level: SecurityLevel)
Assign a security label to a variable.
Sourcepub fn label_of(&self, var: &str) -> SecurityLevel
pub fn label_of(&self, var: &str) -> SecurityLevel
Get the label of a variable (defaults to Low if unknown).
Sourcepub fn propagate(&mut self, dst: impl Into<String>, srcs: &[&str])
pub fn propagate(&mut self, dst: impl Into<String>, srcs: &[&str])
Propagate: dst gets the join of all source labels.
Sourcepub fn check_flow(&mut self, var: &str, required: &SecurityLevel)
pub fn check_flow(&mut self, var: &str, required: &SecurityLevel)
Check a flow: assert that var’s label ⊑ required.
Sourcepub fn has_violation(&self) -> bool
pub fn has_violation(&self) -> bool
Returns true if any information flow violation was detected.
Trait Implementations§
Source§impl Clone for IFCTracker
impl Clone for IFCTracker
Source§fn clone(&self) -> IFCTracker
fn clone(&self) -> IFCTracker
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 IFCTracker
impl Debug for IFCTracker
Source§impl Default for IFCTracker
impl Default for IFCTracker
Source§fn default() -> IFCTracker
fn default() -> IFCTracker
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for IFCTracker
impl RefUnwindSafe for IFCTracker
impl Send for IFCTracker
impl Sync for IFCTracker
impl Unpin for IFCTracker
impl UnsafeUnpin for IFCTracker
impl UnwindSafe for IFCTracker
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