pub trait SpawnedNode:
Any
+ Serialize
+ Send
+ Sync
+ 'static {
// Required methods
fn core(&self) -> &NodeCore;
fn wait_until_is_up<'life0, 'async_trait>(
&'life0 self,
timeout_secs: u64,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
// Provided methods
fn kind(&self) -> NodeKind { ... }
fn name(&self) -> &str { ... }
fn is_running(&self) -> bool { ... }
fn last_start_ts(&self) -> u64 { ... }
fn base_dir(&self) -> &PathBuf { ... }
fn args(&self) -> Vec<&str> { ... }
fn logs<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait { ... }
fn pause<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait { ... }
fn resume<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait { ... }
fn restart<'life0, 'async_trait>(
&'life0 self,
after: Option<Duration>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait { ... }
}Expand description
Behaviour shared by every node zombienet spawns, regardless of what it runs.
Implementors only need to provide core and
wait_until_is_up; everything else is
delegated to the NodeCore.
NOTE: this trait is deliberately dyn-compatible. Generic methods (e.g the
subxt client::<Config>()) stay inherent on the concrete types — downcast
with Network::get_node or
Network::get_jam_node to reach them.
Required Methods§
Sourcefn wait_until_is_up<'life0, 'async_trait>(
&'life0 self,
timeout_secs: u64,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn wait_until_is_up<'life0, 'async_trait>(
&'life0 self,
timeout_secs: u64,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Wait until the node reports it finished booting.
How readiness is established is up to each node flavour (Prometheus scrape for substrate, log/rpc probe for JAM), which is why this has no default implementation.
Provided Methods§
fn name(&self) -> &str
fn is_running(&self) -> bool
fn last_start_ts(&self) -> u64
fn base_dir(&self) -> &PathBuf
fn args(&self) -> Vec<&str>
fn logs<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn pause<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn resume<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn restart<'life0, 'async_trait>(
&'life0 self,
after: Option<Duration>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Trait Implementations§
Source§impl<'erased> Serialize for dyn SpawnedNode + 'erased
impl<'erased> Serialize for dyn SpawnedNode + 'erased
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl<'erased> Serialize for dyn SpawnedNode + Send + 'erased
impl<'erased> Serialize for dyn SpawnedNode + Send + 'erased
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl<'erased> Serialize for dyn SpawnedNode + Sync + 'erased
impl<'erased> Serialize for dyn SpawnedNode + Sync + 'erased
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl<'erased> Serialize for dyn SpawnedNode + Send + Sync + 'erased
impl<'erased> Serialize for dyn SpawnedNode + Send + Sync + 'erased
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".