[−][src]Struct ethers_core::utils::Ganache
Builder for launching ganache-cli
.
Panics
If spawn
is called without ganache-cli
being available in the user's $PATH
Example
use ethers::utils::Ganache; let port = 8545u64; let url = format!("http://localhost:{}", port).to_string(); let ganache = Ganache::new() .port(port) .mnemonic("abstract vacuum mammal awkward pudding scene penalty purchase dinner depart evoke puzzle") .spawn(); drop(ganache); // this will kill the instance
Implementations
impl Ganache
[src]
pub fn new() -> Self
[src]
Creates an empty Ganache builder. The default port is 8545. The mnemonic is chosen randomly.
pub fn port<T: Into<u64>>(self, port: T) -> Self
[src]
Sets the port which will be used when the ganache-cli
instance is launched.
pub fn mnemonic<T: Into<String>>(self, mnemonic: T) -> Self
[src]
Sets the mnemonic which will be used when the ganache-cli
instance is launched.
pub fn block_time<T: Into<u64>>(self, block_time: T) -> Self
[src]
Sets the block-time which will be used when the ganache-cli
instance is launched.
pub fn spawn(self) -> GanacheInstance
[src]
Consumes the builder and spawns ganache-cli
with stdout redirected
to /dev/null. This takes ~2 seconds to execute as it blocks while
waiting for ganache-cli
to launch.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Ganache
impl Send for Ganache
impl Sync for Ganache
impl Unpin for Ganache
impl UnwindSafe for Ganache
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,