pub struct DifferentialLearner { /* private fields */ }Implementations§
Source§impl DifferentialLearner
impl DifferentialLearner
Sourcepub fn new() -> Self
pub fn new() -> Self
Examples found in repository?
examples/learner.rs (line 5)
4fn main() {
5 let mut learner = DifferentialLearner::new().with_analyze_every(1);
6 learner.record(
7 [("action", "run"), ("code", "seed")],
8 ProbeObservation::matched(Duration::from_millis(5), ["code-injection"]),
9 );
10 learner.record(
11 [("action", "noop"), ("code", "seed")],
12 ProbeObservation::silent(Duration::from_millis(5)),
13 );
14
15 for variant in learner.generate_variants(&["alert(1)"]) {
16 println!("{:?}", variant.properties);
17 }
18}Sourcepub fn with_analyze_every(self, analyze_every: usize) -> Self
pub fn with_analyze_every(self, analyze_every: usize) -> Self
Examples found in repository?
examples/learner.rs (line 5)
4fn main() {
5 let mut learner = DifferentialLearner::new().with_analyze_every(1);
6 learner.record(
7 [("action", "run"), ("code", "seed")],
8 ProbeObservation::matched(Duration::from_millis(5), ["code-injection"]),
9 );
10 learner.record(
11 [("action", "noop"), ("code", "seed")],
12 ProbeObservation::silent(Duration::from_millis(5)),
13 );
14
15 for variant in learner.generate_variants(&["alert(1)"]) {
16 println!("{:?}", variant.properties);
17 }
18}pub fn with_max_history(self, max_history: usize) -> Self
Sourcepub fn record(
&mut self,
properties: impl IntoIterator<Item = (impl Into<String>, impl Into<String>)>,
observation: ProbeObservation,
)
pub fn record( &mut self, properties: impl IntoIterator<Item = (impl Into<String>, impl Into<String>)>, observation: ProbeObservation, )
Examples found in repository?
examples/learner.rs (lines 6-9)
4fn main() {
5 let mut learner = DifferentialLearner::new().with_analyze_every(1);
6 learner.record(
7 [("action", "run"), ("code", "seed")],
8 ProbeObservation::matched(Duration::from_millis(5), ["code-injection"]),
9 );
10 learner.record(
11 [("action", "noop"), ("code", "seed")],
12 ProbeObservation::silent(Duration::from_millis(5)),
13 );
14
15 for variant in learner.generate_variants(&["alert(1)"]) {
16 println!("{:?}", variant.properties);
17 }
18}pub fn analyze(&mut self)
pub fn property_roles(&self) -> &HashMap<String, PropertyRole>
pub fn gates_found(&self) -> usize
pub fn injectables_found(&self) -> usize
pub fn paths_found(&self) -> usize
pub fn dangerous_path_count(&self) -> usize
Sourcepub fn generate_variants(
&self,
payloads: &[impl AsRef<str>],
) -> Vec<ProbeVariant>
pub fn generate_variants( &self, payloads: &[impl AsRef<str>], ) -> Vec<ProbeVariant>
Examples found in repository?
examples/learner.rs (line 15)
4fn main() {
5 let mut learner = DifferentialLearner::new().with_analyze_every(1);
6 learner.record(
7 [("action", "run"), ("code", "seed")],
8 ProbeObservation::matched(Duration::from_millis(5), ["code-injection"]),
9 );
10 learner.record(
11 [("action", "noop"), ("code", "seed")],
12 ProbeObservation::silent(Duration::from_millis(5)),
13 );
14
15 for variant in learner.generate_variants(&["alert(1)"]) {
16 println!("{:?}", variant.properties);
17 }
18}Trait Implementations§
Source§impl Clone for DifferentialLearner
impl Clone for DifferentialLearner
Source§fn clone(&self) -> DifferentialLearner
fn clone(&self) -> DifferentialLearner
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 DifferentialLearner
impl Debug for DifferentialLearner
Auto Trait Implementations§
impl Freeze for DifferentialLearner
impl RefUnwindSafe for DifferentialLearner
impl Send for DifferentialLearner
impl Sync for DifferentialLearner
impl Unpin for DifferentialLearner
impl UnsafeUnpin for DifferentialLearner
impl UnwindSafe for DifferentialLearner
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