Skip to content

Commit 08a32c3

Browse files
domenukkandreafioraldi
authored andcommitted
more docs
1 parent f96ae30 commit 08a32c3

File tree

7 files changed

+19
-0
lines changed

7 files changed

+19
-0
lines changed

libafl/src/bolts/tuples.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,12 @@ where
212212
}
213213
}
214214

215+
/// Allows prepending of values to a tuple
215216
pub trait Prepend<T>: TupleList {
216217
type PreprendResult: TupleList;
217218

219+
/// Prepend a value to this tuple, returning a new tuple with prepended value.
220+
#[must_use]
218221
fn prepend(self, value: T) -> (T, Self::PreprendResult);
219222
}
220223

@@ -230,9 +233,12 @@ where
230233
}
231234
}
232235

236+
/// Append to a `TupeList`
233237
pub trait Append<T>: TupleList {
234238
type AppendResult: TupleList;
235239

240+
/// Append Value and return the tuple
241+
#[must_use]
236242
fn append(self, value: T) -> Self::AppendResult;
237243
}
238244

libafl/src/corpus/minimizer.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use core::marker::PhantomData;
1515
use hashbrown::{HashMap, HashSet};
1616
use serde::{Deserialize, Serialize};
1717

18+
/// Default probability to skip the non-favored values
1819
pub const DEFAULT_SKIP_NOT_FAV_PROB: u64 = 95;
1920

2021
/// A testcase metadata saying if a testcase is favored

libafl/src/corpus/queue.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ where
5353
C: Corpus<I>,
5454
I: Input,
5555
{
56+
/// Creates a new `QueueCorpusScheduler`
5657
pub fn new() -> Self {
5758
Self {
5859
phantom: PhantomData,

libafl/src/events/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ where
108108
severity_level: LogSeverity,
109109
/// The message
110110
message: String,
111+
/// `PhantomData`
111112
phantom: PhantomData<I>,
112113
},
113114
/*/// A custom type

libafl/src/executors/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,21 @@ use crate::{
1616

1717
use alloc::boxed::Box;
1818

19+
/// A `CustomExitKind` for exits that do not fit the default `ExitKind`
1920
pub trait CustomExitKind: core::fmt::Debug + SerdeAny + 'static {}
2021

2122
/// How an execution finished.
2223
#[derive(Debug)]
2324
pub enum ExitKind {
25+
/// The run exited normally.
2426
Ok,
27+
/// The run resulted in a target crash.
2528
Crash,
29+
/// The run hit an out of memory error.
2630
Oom,
31+
/// The run timed out
2732
Timeout,
33+
/// The run resulted in a custom `ExitKind`.
2834
Custom(Box<dyn CustomExitKind>),
2935
}
3036

libafl/src/executors/timeout.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ where
5454
E: Executor<I>,
5555
I: Input,
5656
{
57+
/// Create a new `TimeoutExecutor`, wrapping the given `executor` and checking for timeouts.
58+
/// This should usually be used for `InProcess` fuzzing.
5759
pub fn new(executor: E, exec_tmout: Duration) -> Self {
5860
Self {
5961
executor,
@@ -62,6 +64,7 @@ where
6264
}
6365
}
6466

67+
/// Retrieve the inner `Executor` that is wrapped by this `TimeoutExecutor`.
6568
pub fn inner(&mut self) -> &mut E {
6669
&mut self.executor
6770
}

libafl/src/fuzzer.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ where
237237
EM: EventManager<I, S>,
238238
I: Input,
239239
{
240+
/// Create a new `StdFuzzer` with standard behavior.
240241
pub fn new(stages: ST) -> Self {
241242
Self {
242243
stages,

0 commit comments

Comments
 (0)