Assert

Struct Assert 

Source
pub struct Assert<'a, T> { /* private fields */ }

Implementations§

Source§

impl<'a, T> Assert<'a, Vec<T>>
where T: PartialEq + Debug,

Source

pub fn contains_all(&self, expected: &Vec<T>) -> &Self

Source

pub fn contains(&self, expected: &T) -> &Self

Source§

impl<'a> Assert<'a, bool>

Source

pub fn is_false(&self) -> &Self

Source

pub fn is_true(&self) -> &Self

Source§

impl<'a, T> Assert<'a, T>
where T: PartialEq + Debug,

Source

pub fn equals(&self, expected: &T)

Source§

impl<'a, K, V> Assert<'a, HashMap<K, V>>
where K: Eq + Hash + Debug + PartialEq, V: PartialEq + Debug,

Source

pub fn contains_key(&self, key: &K) -> &Self

Source

pub fn contains_all(&self, expected: &HashMap<K, V>) -> &Self

Source§

impl<'a, T> Assert<'a, T>
where T: PartialOrd + Display,

Source

pub fn greater_than_or_equal_to(&self, expected: &T) -> &Self

Source

pub fn greater_than_to(&self, expected: &T) -> &Self

Source

pub fn less_than_or_equal_to(&self, expected: &T) -> &Self

Source

pub fn less_than_to(&self, expected: &T) -> &Self

Source

pub fn in_range(&self, expected: Range<T>) -> &Self

Source§

impl<'a, T> Assert<'a, T>
where T: Fn() + RefUnwindSafe,

Source

pub fn should_panic(&mut self) -> &Self

Source§

impl<'a, S, E> Assert<'a, Result<S, E>>
where S: Debug + PartialEq, E: Debug + PartialEq,

Source

pub fn is_ok(&self) -> &Self

Source

pub fn ok_and_equals(&self, expected: &S) -> &Self

Source

pub fn is_err(&self) -> &Self

Source

pub fn err_and_equals(&self, expected: &E) -> &Self

Source§

impl<'a, T> Assert<'a, Option<T>>
where T: Debug + PartialEq,

Source

pub fn is_some(&self) -> &Self

Source

pub fn is_some_equal_to(&self, expected: &T) -> &Self

Source

pub fn unwrap_some(&self) -> Assert<'a, T>

Source§

impl<'a, T> Assert<'a, T>
where T: ToString,

Source

pub fn is_match(&self, pattern: &str) -> &Self

Source§

impl<'a, T> Assert<'a, T>

Source

pub fn not(&self) -> Not<'a, T>

Auto Trait Implementations§

§

impl<'a, T> Freeze for Assert<'a, T>

§

impl<'a, T> RefUnwindSafe for Assert<'a, T>
where T: RefUnwindSafe,

§

impl<'a, T> Send for Assert<'a, T>
where T: Sync,

§

impl<'a, T> Sync for Assert<'a, T>
where T: Sync,

§

impl<'a, T> Unpin for Assert<'a, T>

§

impl<'a, T> UnwindSafe for Assert<'a, T>
where T: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.