pub struct Options { /* private fields */ }Implementations§
Source§impl Options
impl Options
pub fn new() -> Self
pub fn insert<S: AsRef<str>>(&mut self, k: S, v: S) -> &Self
pub fn contains_keys<'a>(&self, keys: &'a [String]) -> Vec<&'a str>
pub fn different_set(&self, keys: &[String]) -> Vec<&str>
Sourcepub fn pack(&self) -> Option<String>
pub fn pack(&self) -> Option<String>
packs Options, converts Options to String. return None if field ‘inner’ is empty.
use scst::Options;
let mut opt = Options::new();
let s = opt.pack();
assert_eq!(s, None);
opt.insert("a", "b");
assert_eq!(opt.pack(), Some("a=b".to_string()));Sourcepub fn pack_with_check(&self, keys: &[String]) -> Result<Option<String>>
pub fn pack_with_check(&self, keys: &[String]) -> Result<Option<String>>
like pack(), but checks input firstly.
use scst::Options;
let mut opt = Options::new();
let s = opt.pack_with_check(&Vec::new());
assert_eq!(s.unwrap(), None);
opt.insert("a", "b");
assert!(opt.pack_with_check(&["c".to_string()]).is_err());Trait Implementations§
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