pub struct FixtureClient { /* private fields */ }Expand description
An RPC client used from fixture code.
An instance is created using FixtureClient::connect().
Implementations§
Source§impl FixtureClient
impl FixtureClient
Sourcepub async fn set_env_var(
&mut self,
name: impl Into<String>,
value: impl Into<String>,
) -> Result<()>
pub async fn set_env_var( &mut self, name: impl Into<String>, value: impl Into<String>, ) -> Result<()>
Request that an environment variable be set for cargo test.
Sourcepub async fn set_env_vars(
&mut self,
vars: impl IntoIterator<Item = (impl Into<String>, impl Into<String>)>,
) -> Result<()>
pub async fn set_env_vars( &mut self, vars: impl IntoIterator<Item = (impl Into<String>, impl Into<String>)>, ) -> Result<()>
Request that multiple environment variables be set for cargo test.
Sourcepub async fn set_extra_cargo_test_args(
&mut self,
args: impl IntoIterator<Item = impl Into<String>>,
) -> Result<()>
pub async fn set_extra_cargo_test_args( &mut self, args: impl IntoIterator<Item = impl Into<String>>, ) -> Result<()>
Set additional CLI arguments to be passed to cargo test.
No that these are arguments intended for the cargo test command itself, to pass arguments to the test binary,
such as --nocapture or similar, use set_extra_test_binary_args().
Sourcepub async fn set_extra_test_binary_args(
&mut self,
args: impl IntoIterator<Item = impl Into<String>>,
) -> Result<()>
pub async fn set_extra_test_binary_args( &mut self, args: impl IntoIterator<Item = impl Into<String>>, ) -> Result<()>
Set additional CLI arguments to be passed to the test binary.
When using CLI, these are usually passed via cargo using the -- syntax, i.e. cargo test -- args…
Sourcepub async fn set_value(
&mut self,
key: impl Into<String>,
value: impl Serialize,
) -> Result<()>
pub async fn set_value( &mut self, key: impl Into<String>, value: impl Serialize, ) -> Result<()>
Set a value in cargo fixture’s in-memory K-V storage.
The value can be any serde-serializable value. After set, it can be retrieved by the test code.
The K-V store internally uses JSON representation.