pub struct GraphConfig {
pub panels: Vec<Panel>,
}Expand description
Fields§
§panels: Vec<Panel>The list of panels in this graph.
Implementations§
Source§impl GraphConfig
impl GraphConfig
Sourcepub fn try_from_matches(matches: &ArgMatches) -> Result<Self, Error>
pub fn try_from_matches(matches: &ArgMatches) -> Result<Self, Error>
Builds a GraphConfig by parsing CLI arguments in the order they appear.
This function enables flexible, order-sensitive CLI composition by:
- Tracking user-provided arguments as logical events (e.g.
--panel,--plot) - Preserving original argument order using match indices
- Incrementally constructing panels and lines using a builder-style approach
This is necessary because Clap alone cannot support ordered, repeated, multi-flag patterns
like: --plot ... --panel --event ... --plot ....
By interpreting arguments as a linear sequence of graphing instructions,
this method supports expressive CLI layouts without sacrificing ergonomics or structure.
Used internally to construct a GraphConfig from clap::ArgMatches.
Source§impl GraphConfig
impl GraphConfig
pub fn save_to_file(self: &GraphConfig, config_path: &Path) -> Result<(), Error>
pub fn load_from_file(path: &Path) -> Result<Self, Error>
Trait Implementations§
Source§impl Debug for GraphConfig
impl Debug for GraphConfig
Source§impl<'de> Deserialize<'de> for GraphConfig
impl<'de> Deserialize<'de> for GraphConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for GraphConfig
impl PartialEq for GraphConfig
Source§impl Serialize for GraphConfig
impl Serialize for GraphConfig
impl StructuralPartialEq for GraphConfig
Auto Trait Implementations§
impl Freeze for GraphConfig
impl RefUnwindSafe for GraphConfig
impl Send for GraphConfig
impl Sync for GraphConfig
impl Unpin for GraphConfig
impl UnwindSafe for GraphConfig
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.