TestActor

Trait TestActor 

Source
pub trait TestActor<APP>:
    DBProvider
    + Agent<RcApp = Result<Arc<APP>, SimErrorAny>>
    + Debug
where APP: SimulationApp + Send + Sync + 'static,
{
Show 21 methods // Required methods fn progress(&self) -> Result<Arc<Option<ProgressBar>>, SimError>; fn current_day(&self) -> i32; fn set_title(&self, title: &ScriptTitle) -> Result<(), SimError>; fn prelude(&self) -> Result<(), SimError>; fn set_current_day<'life0, 'async_trait>( &'life0 self, day: i32, ) -> Pin<Box<dyn Future<Output = Result<(), SimError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn add_customer<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, db: &'life1 DatabaseConnection, customer: &'life2 Customer, ) -> Pin<Box<dyn Future<Output = Result<(), SimError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn add_inventory_record<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, db: &'life1 DatabaseConnection, inventory_record: &'life2 InventoryRecord, ) -> Pin<Box<dyn Future<Output = Result<(), SimError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn add_order<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, db: &'life1 DatabaseConnection, order: &'life2 Order, ) -> Pin<Box<dyn Future<Output = Result<(), SimError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn add_product<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, db: &'life1 DatabaseConnection, product: &'life2 Product, ) -> Pin<Box<dyn Future<Output = Result<(), SimError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn add_session<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, db: &'life1 DatabaseConnection, session: &'life2 Session, ) -> Pin<Box<dyn Future<Output = Result<(), SimError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn check_inventory<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, db: &'life1 DatabaseConnection, product_id: i32, stock: i64, comment: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<(), SimError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn update_inventory_record<'life0, 'life1, 'async_trait>( &'life0 self, db: &'life1 DatabaseConnection, product_id: i32, quantity: i64, ) -> Pin<Box<dyn Future<Output = Result<(), SimError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn collect_sessions<'life0, 'life1, 'async_trait>( &'life0 self, db: &'life1 DatabaseConnection, ) -> Pin<Box<dyn Future<Output = Result<(), SimError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn update_order<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, db: &'life1 DatabaseConnection, order: &'life2 Order, ) -> Pin<Box<dyn Future<Output = Result<(), SimError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn update_product_view_count<'life0, 'life1, 'async_trait>( &'life0 self, db: &'life1 DatabaseConnection, product_id: i32, ) -> Pin<Box<dyn Future<Output = Result<(), SimError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn update_session<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, db: &'life1 DatabaseConnection, session: &'life2 Session, ) -> Pin<Box<dyn Future<Output = Result<(), SimError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn step_complete<'life0, 'life1, 'async_trait>( &'life0 self, db: &'life1 DatabaseConnection, step_num: usize, ) -> Pin<Box<dyn Future<Output = Result<(), SimError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; // Provided methods fn inv_rec_compare( &self, inventory_record: &Option<InventoryRecord>, product_id: i32, stock: i64, comment: &str, ) -> Result<(), SimError> { ... } fn act<'life0, 'life1, 'async_trait>( &'life0 self, screenplay: &'life1 [Step], ) -> Pin<Box<dyn Future<Output = Result<(), SimError>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn curtain_call<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), SimError>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn collect_session_stubs<'life0, 'life1, 'async_trait>( &'life0 self, db: &'life1 DatabaseConnection, ) -> Pin<Box<dyn Future<Output = Result<(), SimError>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... }
}

Required Methods§

Source

fn progress(&self) -> Result<Arc<Option<ProgressBar>>, SimError>

Source

fn current_day(&self) -> i32

Source

fn set_title(&self, title: &ScriptTitle) -> Result<(), SimError>

Source

fn prelude(&self) -> Result<(), SimError>

Source

fn set_current_day<'life0, 'async_trait>( &'life0 self, day: i32, ) -> Pin<Box<dyn Future<Output = Result<(), SimError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn add_customer<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, db: &'life1 DatabaseConnection, customer: &'life2 Customer, ) -> Pin<Box<dyn Future<Output = Result<(), SimError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn add_inventory_record<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, db: &'life1 DatabaseConnection, inventory_record: &'life2 InventoryRecord, ) -> Pin<Box<dyn Future<Output = Result<(), SimError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn add_order<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, db: &'life1 DatabaseConnection, order: &'life2 Order, ) -> Pin<Box<dyn Future<Output = Result<(), SimError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn add_product<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, db: &'life1 DatabaseConnection, product: &'life2 Product, ) -> Pin<Box<dyn Future<Output = Result<(), SimError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn add_session<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, db: &'life1 DatabaseConnection, session: &'life2 Session, ) -> Pin<Box<dyn Future<Output = Result<(), SimError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn check_inventory<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, db: &'life1 DatabaseConnection, product_id: i32, stock: i64, comment: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<(), SimError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn update_inventory_record<'life0, 'life1, 'async_trait>( &'life0 self, db: &'life1 DatabaseConnection, product_id: i32, quantity: i64, ) -> Pin<Box<dyn Future<Output = Result<(), SimError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn collect_sessions<'life0, 'life1, 'async_trait>( &'life0 self, db: &'life1 DatabaseConnection, ) -> Pin<Box<dyn Future<Output = Result<(), SimError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn update_order<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, db: &'life1 DatabaseConnection, order: &'life2 Order, ) -> Pin<Box<dyn Future<Output = Result<(), SimError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn update_product_view_count<'life0, 'life1, 'async_trait>( &'life0 self, db: &'life1 DatabaseConnection, product_id: i32, ) -> Pin<Box<dyn Future<Output = Result<(), SimError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn update_session<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, db: &'life1 DatabaseConnection, session: &'life2 Session, ) -> Pin<Box<dyn Future<Output = Result<(), SimError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn step_complete<'life0, 'life1, 'async_trait>( &'life0 self, db: &'life1 DatabaseConnection, step_num: usize, ) -> Pin<Box<dyn Future<Output = Result<(), SimError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Provided Methods§

Source

fn inv_rec_compare( &self, inventory_record: &Option<InventoryRecord>, product_id: i32, stock: i64, comment: &str, ) -> Result<(), SimError>

Source

fn act<'life0, 'life1, 'async_trait>( &'life0 self, screenplay: &'life1 [Step], ) -> Pin<Box<dyn Future<Output = Result<(), SimError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn curtain_call<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), SimError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn collect_session_stubs<'life0, 'life1, 'async_trait>( &'life0 self, db: &'life1 DatabaseConnection, ) -> Pin<Box<dyn Future<Output = Result<(), SimError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Collect sessions that are older than the current day and have no customer ID

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<APP, D> TestActor<APP> for wb_cache::test::simulation::company_cached::TestCompany<APP, D>

Source§

impl<APP, D> TestActor<APP> for wb_cache::test::simulation::company_plain::TestCompany<APP, D>