pub struct KnobOverrides { /* private fields */ }Expand description
Variant override map: knob id → preset value. Built incrementally
with KnobOverrides::new().bool_("disabled", true)… and supplied
to PreviewVariant::knobs(...).
Implementations§
Source§impl KnobOverrides
impl KnobOverrides
pub fn new() -> Self
pub fn get(&self, id: &str) -> Option<&KnobValue>
pub fn iter(&self) -> impl Iterator<Item = (&&'static str, &KnobValue)>
pub fn bool_(self, id: &'static str, value: bool) -> Self
pub fn opt_bool(self, id: &'static str, value: Option<bool>) -> Self
pub fn i32_(self, id: &'static str, value: i32) -> Self
pub fn f32_(self, id: &'static str, value: f32) -> Self
pub fn text(self, id: &'static str, value: impl Into<String>) -> Self
pub fn opt_text(self, id: &'static str, value: Option<&str>) -> Self
pub fn choice(self, id: &'static str, value: usize) -> Self
pub fn enum_(self, id: &'static str, value: usize) -> Self
pub fn text_role(self, id: &'static str, value: TextRole) -> Self
pub fn surface_role(self, id: &'static str, value: SurfaceRole) -> Self
pub fn border_role(self, id: &'static str, value: BorderRole) -> Self
pub fn text_style(self, id: &'static str, value: TextStyleRole) -> Self
Trait Implementations§
Source§impl Clone for KnobOverrides
impl Clone for KnobOverrides
Source§fn clone(&self) -> KnobOverrides
fn clone(&self) -> KnobOverrides
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 KnobOverrides
impl Debug for KnobOverrides
Source§impl Default for KnobOverrides
impl Default for KnobOverrides
Source§fn default() -> KnobOverrides
fn default() -> KnobOverrides
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for KnobOverrides
impl RefUnwindSafe for KnobOverrides
impl Send for KnobOverrides
impl Sync for KnobOverrides
impl Unpin for KnobOverrides
impl UnsafeUnpin for KnobOverrides
impl UnwindSafe for KnobOverrides
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