pub struct FactHelper;Expand description
Helper functions for working with fact objects
Implementations§
Source§impl FactHelper
impl FactHelper
Sourcepub fn create_object(pairs: Vec<(&str, Value)>) -> Value
pub fn create_object(pairs: Vec<(&str, Value)>) -> Value
Create a generic object with key-value pairs
Sourcepub fn create_user(
name: &str,
age: i64,
email: &str,
country: &str,
is_vip: bool,
) -> Value
pub fn create_user( name: &str, age: i64, email: &str, country: &str, is_vip: bool, ) -> Value
Create a User fact from common fields
Sourcepub fn create_product(
name: &str,
price: f64,
category: &str,
in_stock: bool,
stock_count: i64,
) -> Value
pub fn create_product( name: &str, price: f64, category: &str, in_stock: bool, stock_count: i64, ) -> Value
Create a Product fact
Sourcepub fn create_order(
id: &str,
user_id: &str,
total: f64,
item_count: i64,
status: &str,
) -> Value
pub fn create_order( id: &str, user_id: &str, total: f64, item_count: i64, status: &str, ) -> Value
Create an Order fact
Sourcepub fn create_test_car(
speed_up: bool,
speed: f64,
max_speed: f64,
speed_increment: f64,
) -> Value
pub fn create_test_car( speed_up: bool, speed: f64, max_speed: f64, speed_increment: f64, ) -> Value
Create a TestCar object for method call demo
Sourcepub fn create_distance_record(total_distance: f64) -> Value
pub fn create_distance_record(total_distance: f64) -> Value
Create a DistanceRecord object for method call demo
Auto Trait Implementations§
impl Freeze for FactHelper
impl RefUnwindSafe for FactHelper
impl Send for FactHelper
impl Sync for FactHelper
impl Unpin for FactHelper
impl UnwindSafe for FactHelper
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
Mutably borrows from an owned value. Read more