use mongors::{WriteConcern}; fn main() { let mut write_concern = WriteConcern::new(); println!("{:?}", write_concern); println!("{:?}", write_concern.is_defalut()); println!("{:?}", write_concern.is_valid()); write_concern.set_journal(true); println!("{:?}", write_concern); println!("{:?}", write_concern.is_valid()); write_concern.set_wtimeout(100); println!("{:?}", write_concern); println!("{:?}", write_concern.is_valid()); write_concern.set_wtag("aaa"); println!("{:?}", write_concern); write_concern.set_w(WriteConcern::W_MAJORITY); println!("{:?}", write_concern); write_concern.set_wmajority(100); println!("{:?}", write_concern); write_concern.set_w(WriteConcern::W_DEFAULT); println!("{:?}", write_concern); println!("{:?}", write_concern.is_valid()); // write_concern.set_wtag("aaa"); // println!("{:?}", write_concern.w()); // println!("{:?}", write_concern.is_valid()); write_concern.set_w(WriteConcern::W_UNACKNOWLEDGED as i32); println!("{:?}", write_concern.w()); println!("{:?}", write_concern.is_valid()); write_concern.set_w(WriteConcern::W_MAJORITY); println!("{:?}", write_concern.w()); println!("{:?}", write_concern.is_valid()); write_concern.set_w(1); println!("{:?}", write_concern.w()); println!("{:?}", write_concern.is_valid()); write_concern.set_w(0); println!("{:?}", write_concern.w()); println!("{:?}", write_concern.is_valid()); }