[−][src]Struct rubric::rubric::criterion_builder::CriterionBuilder
A builder struct that builds a Criterion. You should create one
of these through Criterion::new
instead of directly.
Implementations
impl CriterionBuilder
[src]
pub fn new(name: &str) -> Self
[src]
Creates a new CriterionBuilder
let builder = CriterionBuilder::new("my crit").build();
pub fn func(self, func: &str) -> Self
[src]
Sets the function name of a criterion.
This only assigns the function name, not the actual function. Use the attach! macro or test() method to attach the function.
A function name should conform to rust standards, ie. should be lowercase and not contain whitespace. I use snake_case, but camelCase will also work
let crit = CriterionBuilder::new("my crit") .func("my_func") .build();
pub fn index(self, index: i64) -> Self
[src]
Sets the index
pub fn test(self, test: Box<dyn Fn(&TestData) -> bool>) -> Self
[src]
Attaches a test.
fn my_test(_: &TestData) -> bool { true } let crit = CriterionBuilder::new("my crit") .test(Box::new(my_test)) .build();
pub fn messages(self, success: &str, failure: &str) -> Self
[src]
Sets the messages of a criterion.
let crit = CriterionBuilder::new("my crit") .messages("passed", "failed") .build();
pub fn desc(self, desc: &str) -> Self
[src]
Sets the description of a criterion. It should be relatively short.
let crit = CriterionBuilder::new("Git installed") .desc("Tests that Git is installed") .build();
pub fn worth(self, worth: isize) -> Self
[src]
Sets the worth on a Criterion
pub fn hide(self, hide: bool) -> Self
[src]
Sets the hide flag on a criterion. If hide is true, the criterion can't be printed.
let crit = CriterionBuilder::new("my crit") .hide(true) .build();
pub fn build(self) -> Criterion
[src]
Finalizes the criterion.
If a function name wasn't manually set, it will create one based on the name. It will lowercase it, then replace all whitespace with underscores.
let crit = CriterionBuilder::new("my crit") // more configuration options... .build();
Auto Trait Implementations
impl !RefUnwindSafe for CriterionBuilder
impl !Send for CriterionBuilder
impl !Sync for CriterionBuilder
impl Unpin for CriterionBuilder
impl !UnwindSafe for CriterionBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T, I> AsResult<T, I> for T where
I: Input,
I: Input,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoCollection<T> for T
fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
A: Array<Item = T>,
fn mapped<U, F, A>(self, f: F) -> SmallVec<A> where
A: Array<Item = U>,
F: FnMut(T) -> U,
A: Array<Item = U>,
F: FnMut(T) -> U,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Typeable for T where
T: Any,
T: Any,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,