[][src]Struct k9::Snap

pub struct Snap(_);

String with concurrent access. Allows mutation without &mut reference to itself. It makes passing it to different parts of tests easier when performance is not important.

let snap = k9::Snap::new();
let closure_captured_snap_by_ref = || {
   snap.push("a");
};

closure_captured_snap_by_ref();
closure_captured_snap_by_ref();
closure_captured_snap_by_ref();
k9::assert_equal!(snap.to_string(), "aaa".to_string());

Implementations

impl Snap[src]

pub fn new() -> Self[src]

pub fn from<S: Into<String>>(s: S) -> Self[src]

pub fn push<S: Into<String>>(&self, s: S)[src]

Push a substring

pub fn pushln<S: Into<String>>(&self, s: S)[src]

Push a substring and add a newline \n at the end

Trait Implementations

impl Clone for Snap[src]

impl Display for Snap[src]

impl<'_> From<&'_ Snap> for String[src]

Auto Trait Implementations

impl RefUnwindSafe for Snap

impl Send for Snap

impl Sync for Snap

impl Unpin for Snap

impl UnwindSafe for Snap

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.