[−][src]Struct exonum_testkit::Spec
Deploy specification for a Rust artifact. The spec can include zero or more instantiated services.
Examples
#[derive(Debug, ServiceDispatcher, ServiceFactory)] #[service_factory(artifact_name = "my-service")] pub struct MyService; impl Service for MyService {} impl DefaultInstance for MyService { const INSTANCE_ID: InstanceId = 100; const INSTANCE_NAME: &'static str = "my-service"; } let spec = Spec::new(MyService) .with_default_instance() .with_instance(200, "other-service", 42_u64); // Deploy `spec` somewhere...
Methods
impl<T, Kind> Spec<T, Kind> where
T: ServiceFactory,
[src]
T: ServiceFactory,
pub fn with_instance(
self,
id: u32,
name: impl Into<String>,
constructor: impl BinaryValue
) -> Spec<T, Kind>
[src]
self,
id: u32,
name: impl Into<String>,
constructor: impl BinaryValue
) -> Spec<T, Kind>
Adds a new built-in service instance to instantiate at the genesis block.
impl<T, Kind> Spec<T, Kind> where
T: DefaultInstance,
[src]
T: DefaultInstance,
pub fn with_default_instance(self) -> Spec<T, Kind>
[src]
Adds a built-in service instance with the default identifiers to instantiate at the genesis block.
Calling this method several times still results in a single default instance added to the blockchain upon creation.
impl<T> Spec<T, Simple> where
T: ServiceFactory,
[src]
T: ServiceFactory,
impl<T> Spec<T, Migrating> where
T: ServiceFactory,
[src]
T: ServiceFactory,
pub fn migrating(service: T) -> Spec<T, Migrating>
[src]
Creates a spec with support of data migrations.
Trait Implementations
impl<T, Kind> Clone for Spec<T, Kind> where
T: Clone,
[src]
T: Clone,
impl<T, Kind> Debug for Spec<T, Kind> where
Kind: Debug,
T: Debug,
[src]
Kind: Debug,
T: Debug,
impl<T> Deploy for Spec<T, Simple> where
T: ServiceFactory,
[src]
T: ServiceFactory,
fn deploy(self, genesis: &mut GenesisConfigBuilder, rt: &mut RustRuntimeBuilder)
[src]
impl<T> Deploy for Spec<T, Migrating> where
T: ServiceFactory + MigrateData,
[src]
T: ServiceFactory + MigrateData,
fn deploy(self, genesis: &mut GenesisConfigBuilder, rt: &mut RustRuntimeBuilder)
[src]
Auto Trait Implementations
impl<T, Kind> RefUnwindSafe for Spec<T, Kind> where
Kind: RefUnwindSafe,
T: RefUnwindSafe,
Kind: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, Kind> Send for Spec<T, Kind> where
Kind: Send,
T: Send,
Kind: Send,
T: Send,
impl<T, Kind> Sync for Spec<T, Kind> where
Kind: Sync,
T: Sync,
Kind: Sync,
T: Sync,
impl<T, Kind> Unpin for Spec<T, Kind> where
Kind: Unpin,
T: Unpin,
Kind: Unpin,
T: Unpin,
impl<T, Kind> UnwindSafe for Spec<T, Kind> where
Kind: UnwindSafe,
T: UnwindSafe,
Kind: UnwindSafe,
T: UnwindSafe,
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> 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>,