Skip to main content

Captured

Struct Captured 

Source
pub struct Captured;
Expand description

A handle on the fake host: install it, run the plugin, assert on the lines.

Implementations§

Source§

impl Captured

Source

pub fn take(&self) -> Vec<String>

Everything the plugin wrote since the handle was created, oldest first.

Draining by taking it: a test that asserts twice does not see the first assertion’s lines again.

Source

pub fn take_levels(&self) -> Vec<(u32, String)>

The same, with the contract’s level numbers.

Source

pub fn level(self, level: u32) -> Self

How loud this host is: installing the table for that level is what tells the plugin.

Source

pub fn trace(self) -> Self

Everything: notes and detail included.

Source

pub fn quiet(self) -> Self

Only failures.

Source

pub fn normal(self) -> Self

A plain run: warnings and errors.

Source

pub fn info(self) -> Self

Notes and above.

Auto Trait Implementations§

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 = !

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.