Skip to main content

ShouldImpl

Struct ShouldImpl 

Source
pub struct ShouldImpl<L>
where L: Debug,
{ pub left: Option<L>, /* private fields */ }
Expand description

The inner should implementation, not intended to be used by the final user.

Fields§

§left: Option<L>

The left part of the assertion.

Implementations§

Source§

impl<L> ShouldImpl<L>
where L: Debug,

Source

pub fn map_left<T: Debug, F>(self, f: F) -> ShouldImpl<T>
where F: FnOnce(L) -> Option<T>,

Creates a new ShouldImpl by applicating the passed closure to the left element.

Source

pub fn truthness(&self) -> bool

Returns wether the assertion should be true or not.

Source

pub fn left_dbg(&self) -> &str

Returns a debug reptresentation of the left element.

Source

pub fn stringified(&self) -> Option<String>

Returns a stringified representation of the left element.

Source

pub fn add_message(&mut self, message: String)

Adds a new explanation message to the assertion. Must be used through the ConsumingAssert::because or the ChainableAssert::because method.

Trait Implementations§

Source§

impl<L> Debug for ShouldImpl<L>
where L: Debug + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<L> Default for ShouldImpl<L>
where L: Debug,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'a, L> From<&'a mut Should<L>> for &'a mut ShouldImpl<L>
where L: Debug,

Source§

fn from(should: &'a mut Should<L>) -> Self

Converts to this type from the input type.
Source§

impl<L> From<Should<L>> for ShouldImpl<L>
where L: Debug,

Source§

fn from(should: Should<L>) -> Self

Converts to this type from the input type.
Source§

impl<L> From<ShouldImpl<L>> for Should<L>
where L: Debug,

Source§

fn from(implem: ShouldImpl<L>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<L> Freeze for ShouldImpl<L>
where Option<L>: Freeze,

§

impl<L> RefUnwindSafe for ShouldImpl<L>

§

impl<L> Send for ShouldImpl<L>
where Option<L>: Send,

§

impl<L> Sync for ShouldImpl<L>
where Option<L>: Sync,

§

impl<L> Unpin for ShouldImpl<L>
where Option<L>: Unpin,

§

impl<L> UnsafeUnpin for ShouldImpl<L>
where Option<L>: UnsafeUnpin,

§

impl<L> UnwindSafe for ShouldImpl<L>
where Option<L>: UnwindSafe,

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> PrintDebug for T
where T: Debug,

Source§

fn dbg(&self) -> String

Display the user’s input as a debug string.
Source§

impl<L> ShouldExtension<L> for L
where L: Debug,

Source§

fn should(self) -> Should<L>

Initiates an assertion. Note that this method should not be used alone, but: Read more
Source§

impl<T> Take for T
where T: Default,

Source§

fn take(&mut self) -> T

Replace self with its default value and returns the old one.
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.