pub enum PreferenceValue {
Bool(bool),
Int(i32),
String(String),
}Expand description
A preference value in user.js.
Firefox preferences can be booleans, integers, or strings.
§Examples
use firefox_webdriver::driver::profile::PreferenceValue;
let bool_val = PreferenceValue::Bool(true);
let int_val = PreferenceValue::Int(42);
let str_val = PreferenceValue::String("value".to_string());Variants§
Implementations§
Source§impl PreferenceValue
impl PreferenceValue
Sourcepub fn to_js_string(&self) -> String
pub fn to_js_string(&self) -> String
Formats the value for user.js.
- Booleans:
trueorfalse - Integers: numeric literal
- Strings: quoted and escaped
Trait Implementations§
Source§impl Clone for PreferenceValue
impl Clone for PreferenceValue
Source§fn clone(&self) -> PreferenceValue
fn clone(&self) -> PreferenceValue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PreferenceValue
impl Debug for PreferenceValue
Source§impl From<&str> for PreferenceValue
impl From<&str> for PreferenceValue
Source§impl From<String> for PreferenceValue
impl From<String> for PreferenceValue
Source§impl From<bool> for PreferenceValue
impl From<bool> for PreferenceValue
Source§impl From<i32> for PreferenceValue
impl From<i32> for PreferenceValue
Source§impl Hash for PreferenceValue
impl Hash for PreferenceValue
Source§impl PartialEq for PreferenceValue
impl PartialEq for PreferenceValue
impl Eq for PreferenceValue
impl StructuralPartialEq for PreferenceValue
Auto Trait Implementations§
impl Freeze for PreferenceValue
impl RefUnwindSafe for PreferenceValue
impl Send for PreferenceValue
impl Sync for PreferenceValue
impl Unpin for PreferenceValue
impl UnwindSafe for PreferenceValue
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.