pub struct ProbeObservation {
pub outcome: ObservationOutcome,
pub error: Option<String>,
pub categories: Vec<String>,
pub elapsed: Duration,
pub return_value: Option<String>,
pub confirmed: bool,
}Fields§
§outcome: ObservationOutcome§error: Option<String>§categories: Vec<String>§elapsed: Duration§return_value: Option<String>§confirmed: boolImplementations§
Source§impl ProbeObservation
impl ProbeObservation
Sourcepub fn silent(elapsed: Duration) -> Self
pub fn silent(elapsed: Duration) -> Self
Examples found in repository?
examples/learner.rs (line 12)
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 matched(
elapsed: Duration,
categories: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn matched( elapsed: Duration, categories: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Examples found in repository?
examples/learner.rs (line 8)
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 error(elapsed: Duration, error: impl Into<String>) -> Self
Trait Implementations§
Source§impl Clone for ProbeObservation
impl Clone for ProbeObservation
Source§fn clone(&self) -> ProbeObservation
fn clone(&self) -> ProbeObservation
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 ProbeObservation
impl Debug for ProbeObservation
Source§impl<'de> Deserialize<'de> for ProbeObservation
impl<'de> Deserialize<'de> for ProbeObservation
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
Source§impl PartialEq for ProbeObservation
impl PartialEq for ProbeObservation
Source§impl Serialize for ProbeObservation
impl Serialize for ProbeObservation
impl Eq for ProbeObservation
impl StructuralPartialEq for ProbeObservation
Auto Trait Implementations§
impl Freeze for ProbeObservation
impl RefUnwindSafe for ProbeObservation
impl Send for ProbeObservation
impl Sync for ProbeObservation
impl Unpin for ProbeObservation
impl UnsafeUnpin for ProbeObservation
impl UnwindSafe for ProbeObservation
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