pub struct AppBuilder<Bank, Api, Storage, Custom, Wasm, Staking, Distr, Ibc, Gov, Stargate> { /* private fields */ }Expand description
Utility to build App in stages. If particular items wont be set, defaults would be used
Implementations§
Source§impl AppBuilder<BankKeeper, MockApi, MockStorage, FailingModule<Empty, Empty, Empty>, WasmKeeper<Empty, Empty>, StakeKeeper, DistributionKeeper, FailingModule<IbcMsg, IbcQuery, Empty>, FailingModule<GovMsg, Empty, Empty>, StargateKeeper<Empty, Empty>>
impl AppBuilder<BankKeeper, MockApi, MockStorage, FailingModule<Empty, Empty, Empty>, WasmKeeper<Empty, Empty>, StakeKeeper, DistributionKeeper, FailingModule<IbcMsg, IbcQuery, Empty>, FailingModule<GovMsg, Empty, Empty>, StargateKeeper<Empty, Empty>>
Source§impl<ExecC, QueryC> AppBuilder<BankKeeper, MockApi, MockStorage, FailingModule<ExecC, QueryC, Empty>, WasmKeeper<ExecC, QueryC>, StakeKeeper, DistributionKeeper, FailingModule<IbcMsg, IbcQuery, Empty>, FailingModule<GovMsg, Empty, Empty>, StargateKeeper<ExecC, QueryC>>where
ExecC: Debug + Clone + PartialEq + JsonSchema + DeserializeOwned + 'static,
QueryC: Debug + CustomQuery + DeserializeOwned + 'static,
impl<ExecC, QueryC> AppBuilder<BankKeeper, MockApi, MockStorage, FailingModule<ExecC, QueryC, Empty>, WasmKeeper<ExecC, QueryC>, StakeKeeper, DistributionKeeper, FailingModule<IbcMsg, IbcQuery, Empty>, FailingModule<GovMsg, Empty, Empty>, StargateKeeper<ExecC, QueryC>>where
ExecC: Debug + Clone + PartialEq + JsonSchema + DeserializeOwned + 'static,
QueryC: Debug + CustomQuery + DeserializeOwned + 'static,
Sourcepub fn new_custom() -> Self
pub fn new_custom() -> Self
Creates builder with default components designed to work with custom exec and query messages.
Source§impl<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT, IbcT, GovT, StargateT> AppBuilder<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT, IbcT, GovT, StargateT>
impl<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT, IbcT, GovT, StargateT> AppBuilder<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT, IbcT, GovT, StargateT>
pub fn construct( api: ApiT, block: BlockInfo, storage: StorageT, bank: BankT, wasm: WasmT, custom: CustomT, staking: StakingT, distribution: DistrT, ibc: IbcT, gov: GovT, stargate: StargateT, ) -> Self
Sourcepub fn with_wasm<ExecC, QueryC: CustomQuery, NewWasm: Wasm<ExecC, QueryC>>(
self,
wasm: NewWasm,
) -> AppBuilder<BankT, ApiT, StorageT, CustomT, NewWasm, StakingT, DistrT, IbcT, GovT, StargateT>
pub fn with_wasm<ExecC, QueryC: CustomQuery, NewWasm: Wasm<ExecC, QueryC>>( self, wasm: NewWasm, ) -> AppBuilder<BankT, ApiT, StorageT, CustomT, NewWasm, StakingT, DistrT, IbcT, GovT, StargateT>
Overwrites default wasm executor.
At this point it is needed that new wasm implements some Wasm trait, but it doesn’t need
to be bound to Bank or Custom yet - as those may change. The cross-components validation is
done on final building.
Also it is possible to completely abandon trait bounding here which would not be bad idea,
however it might make the message on build creepy in many cases, so as for properly build
App we always want Wasm to be Wasm, some checks are done early.
pub fn with_stargate( self, stargate: StargateT, ) -> AppBuilder<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT, IbcT, GovT, StargateT>
Sourcepub fn with_bank<NewBank: Bank>(
self,
bank: NewBank,
) -> AppBuilder<NewBank, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT, IbcT, GovT, StargateT>
pub fn with_bank<NewBank: Bank>( self, bank: NewBank, ) -> AppBuilder<NewBank, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT, IbcT, GovT, StargateT>
Overwrites default bank interface
Sourcepub fn with_api<NewApi: Api>(
self,
api: NewApi,
) -> AppBuilder<BankT, NewApi, StorageT, CustomT, WasmT, StakingT, DistrT, IbcT, GovT, StargateT>
pub fn with_api<NewApi: Api>( self, api: NewApi, ) -> AppBuilder<BankT, NewApi, StorageT, CustomT, WasmT, StakingT, DistrT, IbcT, GovT, StargateT>
Overwrites default api interface
Sourcepub fn with_storage<NewStorage: Storage>(
self,
storage: NewStorage,
) -> AppBuilder<BankT, ApiT, NewStorage, CustomT, WasmT, StakingT, DistrT, IbcT, GovT, StargateT>
pub fn with_storage<NewStorage: Storage>( self, storage: NewStorage, ) -> AppBuilder<BankT, ApiT, NewStorage, CustomT, WasmT, StakingT, DistrT, IbcT, GovT, StargateT>
Overwrites default storage interface
Sourcepub fn with_custom<NewCustom: Module>(
self,
custom: NewCustom,
) -> AppBuilder<BankT, ApiT, StorageT, NewCustom, WasmT, StakingT, DistrT, IbcT, GovT, StargateT>
pub fn with_custom<NewCustom: Module>( self, custom: NewCustom, ) -> AppBuilder<BankT, ApiT, StorageT, NewCustom, WasmT, StakingT, DistrT, IbcT, GovT, StargateT>
Overwrites default custom messages handler
At this point it is needed that new custom implements some Module trait, but it doesn’t need
to be bound to ExecC or QueryC yet - as those may change. The cross-components validation is
done on final building.
Also it is possible to completely abandon trait bounding here which would not be bad idea,
however it might make the message on build creepy in many cases, so as for properly build
App we always want Wasm to be Wasm, some checks are done early.
Sourcepub fn with_staking<NewStaking: Staking>(
self,
staking: NewStaking,
) -> AppBuilder<BankT, ApiT, StorageT, CustomT, WasmT, NewStaking, DistrT, IbcT, GovT, StargateT>
pub fn with_staking<NewStaking: Staking>( self, staking: NewStaking, ) -> AppBuilder<BankT, ApiT, StorageT, CustomT, WasmT, NewStaking, DistrT, IbcT, GovT, StargateT>
Overwrites default bank interface
Sourcepub fn with_distribution<NewDistribution: Distribution>(
self,
distribution: NewDistribution,
) -> AppBuilder<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, NewDistribution, IbcT, GovT, StargateT>
pub fn with_distribution<NewDistribution: Distribution>( self, distribution: NewDistribution, ) -> AppBuilder<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, NewDistribution, IbcT, GovT, StargateT>
Overwrites default distribution interface
Sourcepub fn with_ibc<NewIbc: Ibc>(
self,
ibc: NewIbc,
) -> AppBuilder<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT, NewIbc, GovT, StargateT>
pub fn with_ibc<NewIbc: Ibc>( self, ibc: NewIbc, ) -> AppBuilder<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT, NewIbc, GovT, StargateT>
Overwrites default ibc interface
Sourcepub fn with_gov<NewGov: Gov>(
self,
gov: NewGov,
) -> AppBuilder<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT, IbcT, NewGov, StargateT>
pub fn with_gov<NewGov: Gov>( self, gov: NewGov, ) -> AppBuilder<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT, IbcT, NewGov, StargateT>
Overwrites default gov interface
Sourcepub fn with_block(self, block: BlockInfo) -> Self
pub fn with_block(self, block: BlockInfo) -> Self
Overwrites default initial block
Sourcepub fn build<F>(
self,
init_fn: F,
) -> App<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT, IbcT, GovT, StargateT>
pub fn build<F>( self, init_fn: F, ) -> App<BankT, ApiT, StorageT, CustomT, WasmT, StakingT, DistrT, IbcT, GovT, StargateT>
Builds final App. At this point all components type have to be properly related to each
other. If there are some generics related compilation error make sure, that all components
are properly relating to each other.
Trait Implementations§
Source§impl Default for AppBuilder<BankKeeper, MockApi, MockStorage, FailingModule<Empty, Empty, Empty>, WasmKeeper<Empty, Empty>, StakeKeeper, DistributionKeeper, FailingModule<IbcMsg, IbcQuery, Empty>, FailingModule<GovMsg, Empty, Empty>, StargateKeeper<Empty, Empty>>
impl Default for AppBuilder<BankKeeper, MockApi, MockStorage, FailingModule<Empty, Empty, Empty>, WasmKeeper<Empty, Empty>, StakeKeeper, DistributionKeeper, FailingModule<IbcMsg, IbcQuery, Empty>, FailingModule<GovMsg, Empty, Empty>, StargateKeeper<Empty, Empty>>
Auto Trait Implementations§
impl<Bank, Api, Storage, Custom, Wasm, Staking, Distr, Ibc, Gov, Stargate> Freeze for AppBuilder<Bank, Api, Storage, Custom, Wasm, Staking, Distr, Ibc, Gov, Stargate>
impl<Bank, Api, Storage, Custom, Wasm, Staking, Distr, Ibc, Gov, Stargate> RefUnwindSafe for AppBuilder<Bank, Api, Storage, Custom, Wasm, Staking, Distr, Ibc, Gov, Stargate>where
Api: RefUnwindSafe,
Storage: RefUnwindSafe,
Bank: RefUnwindSafe,
Wasm: RefUnwindSafe,
Custom: RefUnwindSafe,
Staking: RefUnwindSafe,
Distr: RefUnwindSafe,
Ibc: RefUnwindSafe,
Gov: RefUnwindSafe,
Stargate: RefUnwindSafe,
impl<Bank, Api, Storage, Custom, Wasm, Staking, Distr, Ibc, Gov, Stargate> Send for AppBuilder<Bank, Api, Storage, Custom, Wasm, Staking, Distr, Ibc, Gov, Stargate>
impl<Bank, Api, Storage, Custom, Wasm, Staking, Distr, Ibc, Gov, Stargate> Sync for AppBuilder<Bank, Api, Storage, Custom, Wasm, Staking, Distr, Ibc, Gov, Stargate>
impl<Bank, Api, Storage, Custom, Wasm, Staking, Distr, Ibc, Gov, Stargate> Unpin for AppBuilder<Bank, Api, Storage, Custom, Wasm, Staking, Distr, Ibc, Gov, Stargate>
impl<Bank, Api, Storage, Custom, Wasm, Staking, Distr, Ibc, Gov, Stargate> UnwindSafe for AppBuilder<Bank, Api, Storage, Custom, Wasm, Staking, Distr, Ibc, Gov, Stargate>where
Api: UnwindSafe,
Storage: UnwindSafe,
Bank: UnwindSafe,
Wasm: UnwindSafe,
Custom: UnwindSafe,
Staking: UnwindSafe,
Distr: UnwindSafe,
Ibc: UnwindSafe,
Gov: UnwindSafe,
Stargate: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more