pub struct Options {
options: BTreeMap<String, Attribute>,
}Expand description
Options for query serializer.
§Example
// Connect to the server
let mut client = Client::connect("localhost", 1984, "admin", "admin")?;
// Create options from string (not loaded from the database)
let mut options = Options::from_str("encoding=US-ASCII,indent=yes")?;
// Change indent option
let indent = options.get("indent").unwrap();
assert!(indent.as_bool()?);
let indent = options.set("indent", false);
assert!(!indent.as_bool()?);
// Change encoding option
let encoding = options.get("encoding").unwrap();
assert_eq!("US-ASCII", encoding.as_str());
let encoding = options.set("encoding", "UTF-8");
assert_eq!("UTF-8", encoding.as_str());
// Final state
assert_eq!("encoding=UTF-8,indent=no", &options.to_string());
// Save the state of Options to database
let client = options.save(client)?;Fields§
§options: BTreeMap<String, Attribute>Implementations§
Trait Implementations§
impl StructuralPartialEq for Options
Auto Trait Implementations§
impl Freeze for Options
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnwindSafe for Options
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