Struct lazybar_core::common::PanelCommon
source · pub struct PanelCommon {
pub formats: Vec<String>,
pub dependence: Dependence,
pub attrs: Vec<Attrs>,
pub actions: Actions,
pub ramps: Vec<Ramp>,
pub images: Vec<Image>,
pub visible: bool,
}
Expand description
The common part of most PanelConfigs
. Stores format
strings, Attrs
, and Dependence
Fields§
§formats: Vec<String>
The format strings used by the panel
dependence: Dependence
Whether the panel depends on its neighbors
attrs: Vec<Attrs>
The instances of Attrs
used by the panel
actions: Actions
The events that should be run on mouse events
ramps: Vec<Ramp>
The ramps that are available for use in format strings
images: Vec<Image>
The images that will be displayed on the bar
visible: bool
Whether the panel should be visible on startup
Implementations§
source§impl PanelCommon
impl PanelCommon
sourcepub fn parse<S: BuildHasher>(
table: &mut HashMap<String, Value, S>,
format_suffixes: &[&'static str],
format_defaults: &[&'static str],
attrs_prefixes: &[&'static str],
ramp_suffixes: &[&'static str],
) -> Result<Self>
pub fn parse<S: BuildHasher>( table: &mut HashMap<String, Value, S>, format_suffixes: &[&'static str], format_defaults: &[&'static str], attrs_prefixes: &[&'static str], ramp_suffixes: &[&'static str], ) -> Result<Self>
Attempts to parse common panel configuration options from a subset of
the global [Config
]. The format suffixes and defaults
and attrs prefixes are documented by each panel.
Format strings should be specified as format{suffix} = "value"
. Where
not noted, panels accept one format string with no suffix.
Dependence should be specified as dependence = "value"
, where value is
a valid variant of Dependence
.
See Attrs::parse
, Actions::parse
, Image::parse
, and
Ramp::parse
for more parsing details.
sourcepub fn parse_variadic<S: BuildHasher>(
table: &mut HashMap<String, Value, S>,
format_default: &[&'static str],
attrs_prefixes: &[&'static str],
ramp_suffixes: &[&'static str],
) -> Result<Self>
pub fn parse_variadic<S: BuildHasher>( table: &mut HashMap<String, Value, S>, format_default: &[&'static str], attrs_prefixes: &[&'static str], ramp_suffixes: &[&'static str], ) -> Result<Self>
Attempts to parse common panel configuration options from a subset of
the global [Config
]. The format defaults, attrs
prefixes, and ramp suffixes are documented by each panel.
Format strings should be specified as formats = ["value", ...]
.
Dependence should be specified as dependence = "value"
, where value is
a valid variant of Dependence
.
See Attrs::parse
for more parsing details.
Trait Implementations§
source§impl Clone for PanelCommon
impl Clone for PanelCommon
source§fn clone(&self) -> PanelCommon
fn clone(&self) -> PanelCommon
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for PanelCommon
impl RefUnwindSafe for PanelCommon
impl !Send for PanelCommon
impl !Sync for PanelCommon
impl Unpin for PanelCommon
impl UnwindSafe for PanelCommon
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)