Struct Assert

Source
pub struct Assert(/* private fields */);
Expand description

A specialized process builder managing a rustdoc test session.

§Example

The following code will test the crate README with the docmatic configuration set and a default library path:

extern crate docmatic;

use std::default::Default;

fn test_readme() {
    docmatic::Assert::default()
        .cfg("docmatic")
        .test_file("README.md")
}

Implementations§

Source§

impl Assert

Source

pub fn new() -> Self

Construct a new Assert with no flags set.

Will likely fail if you don’t provide at least one library path containing the tested crate. Instead, you should probably use Assert::default

Source

pub fn library_path<S>(&mut self, path: S) -> &mut Self
where S: AsRef<OsStr>,

Add a path to the library paths passed to rustdoc.

Source

pub fn cfg<S>(&mut self, cfg: S) -> &mut Self
where S: AsRef<OsStr>,

Add a cfg to the configuration passed to rustdoc.

Source

pub fn test_file<P>(&mut self, path: P)
where P: AsRef<Path>,

Test the given file, and panics on failure.

Trait Implementations§

Source§

impl Default for Assert

Source§

fn default() -> Self

Create an Assert instance with the following default parameters:

  • --library-path set to the current deps directory (target/debug/deps or target/release/deps depending on the test compilation mode).

Auto Trait Implementations§

§

impl Freeze for Assert

§

impl !RefUnwindSafe for Assert

§

impl Send for Assert

§

impl Sync for Assert

§

impl Unpin for Assert

§

impl !UnwindSafe for Assert

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.