[][src]Struct tendermint_testgen::tester::TestEnv

pub struct TestEnv { /* fields omitted */ }

A test environment, which is essentially a wrapper around some directory, with some utility functions operating relative to that directory.

Implementations

impl TestEnv[src]

pub fn new(current_dir: &str) -> Option<Self>[src]

pub fn push(&self, child: &str) -> Option<Self>[src]

pub fn current_dir(&self) -> &str[src]

pub fn clear_log(&self) -> Option<()>[src]

pub fn logln(&self, msg: &str) -> Option<()>[src]

pub fn logln_to(&self, msg: &str, rel_path: impl AsRef<Path>) -> Option<()>[src]

pub fn read_file(&self, rel_path: impl AsRef<Path>) -> Option<String>[src]

Read a file from a path relative to the environment current dir into a string

pub fn write_file(
    &self,
    rel_path: impl AsRef<Path>,
    contents: &str
) -> Option<()>
[src]

Write a file to a path relative to the environment current dir

pub fn parse_file<T: DeserializeOwned>(
    &self,
    rel_path: impl AsRef<Path>
) -> Option<T>
[src]

Parse a file from a path relative to the environment current dir as the given type

pub fn copy_file_from(&self, path: impl AsRef<Path>) -> Option<()>[src]

Copy a file from the path outside environment into the environment current dir Returns None if copying was not successful

pub fn copy_file_from_as(
    &self,
    path: impl AsRef<Path>,
    new_name: &str
) -> Option<()>
[src]

Copy a file from the path outside environment into the environment current dir Assigns the file a new_name in the current environment Returns None if copying was not successful

pub fn copy_file_from_env(
    &self,
    other: &TestEnv,
    path: impl AsRef<Path>
) -> Option<()>
[src]

Copy a file from the path relative to the other environment into the environment current dir Returns None if copying was not successful

pub fn copy_file_from_env_as(
    &self,
    other: &TestEnv,
    path: impl AsRef<Path>,
    new_name: &str
) -> Option<()>
[src]

Copy a file from the path relative to the other environment into the environment current dir Assigns the file a new_name in the current environment Returns None if copying was not successful

pub fn remove_file(&self, rel_path: impl AsRef<Path>) -> Option<()>[src]

Remove a file from a path relative to the environment current dir

pub fn full_path(&self, rel_path: impl AsRef<Path>) -> PathBuf[src]

Convert a relative path to the full path from the test root Return None if the full path can't be formed

pub fn rel_path(&self, full_path: impl AsRef<Path>) -> Option<String>[src]

Convert a full path to the path relative to the test root Returns None if the full path doesn't contain test root as prefix

pub fn full_canonical_path(&self, rel_path: impl AsRef<Path>) -> Option<String>[src]

Convert a relative path to the full path from the test root, canonicalized Returns None the full path can't be formed

Trait Implementations

impl Clone for TestEnv[src]

impl Debug for TestEnv[src]

Auto Trait Implementations

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> Same<T> for T

type Output = T

Should always be Self

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

type Owned = T

The resulting type after obtaining ownership.

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,