pub enum ValidColumnSizeParse {
Decimal,
Binary,
}Variants§
Implementations§
Source§impl ValidColumnSizeParse
impl ValidColumnSizeParse
pub fn parse(s: &str) -> Result<Self, String>
Sourcepub fn parse_vec_as_config<I>(inputs: I) -> ValidColumnSizeConfig
pub fn parse_vec_as_config<I>(inputs: I) -> ValidColumnSizeConfig
Examples found in repository?
examples/try-step2.rs (line 34)
3fn main() {
4 println!("=== TEST STEP 2 (ALPHA) ===\n");
5
6 // =========================================================================
7 // STEP 0: Inicjalizacja
8 // =========================================================================
9
10 let ws_cfg = job::ValidWorkspaceParse::parse_vec_as_config(["."]);
11 let pt_cfg = job::ValidPatternParse::parse_vec_as_config(Vec::<&str>::new(), None);
12 // let pt_cfg = job::ValidPatternParse::parse_vec_as_config::<[&str; 0]>([], None);
13
14 // =========================================================================
15 // STEP 1: Skanowanie i pobranie metadanych z dysku
16 // =========================================================================
17 let part_cfg = job::ValidTablePartParse::parse_vec_as_config(["md", "mf"]);
18 let raw_rows = job::engine_step1_scanner(part_cfg, &ws_cfg, &pt_cfg);
19
20 println!("Skanowanie zakończone. Zabrano wierszy (ValidResultMainRow): {}\n", raw_rows.rows.len());
21
22 // =========================================================================
23 // STEP 2: Formatowanie komórek
24 // =========================================================================
25
26 // Ustawiamy dość bogatą konfigurację, żeby przetestować wszystkie mechanizmy
27 let item_cfg =
28 job::ValidColumnItemParse::parse_vec_as_config(["list-tree", "name-show", "ws-show", "icons-lite"]).unwrap();
29
30 let cols_cfg = job::ValidTableColumnsParse::parse_vec_as_config(["date", "time", "size", "item", "path"]);
31
32 let date_cfg = job::ValidColumnDateParse::parse_vec_as_config(["default"]);
33 let time_cfg = job::ValidColumnTimeParse::parse_vec_as_config(["default"]);
34 let size_cfg = job::ValidColumnSizeParse::parse_vec_as_config(["dec"]);
35
36 let formatted_rows =
37 job::engine_step2_data_formater((&item_cfg, &cols_cfg), (&date_cfg, &time_cfg, &size_cfg), &raw_rows);
38
39 // =========================================================================
40 // WYDRUK KONTROLNY (Dla naszych oczu)
41 // =========================================================================
42 let sample_rows: Vec<_> = formatted_rows.into_iter().take(75).collect();
43
44 // Przekazujemy wiersze i konfigurację kolumn (żeby renderer wiedział, czym są komórki)
45 mock_render(&sample_rows, &cols_cfg);
46}Trait Implementations§
Source§impl Clone for ValidColumnSizeParse
impl Clone for ValidColumnSizeParse
Source§fn clone(&self) -> ValidColumnSizeParse
fn clone(&self) -> ValidColumnSizeParse
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 ValidColumnSizeParse
impl Debug for ValidColumnSizeParse
Source§impl PartialEq for ValidColumnSizeParse
impl PartialEq for ValidColumnSizeParse
impl Copy for ValidColumnSizeParse
impl Eq for ValidColumnSizeParse
impl StructuralPartialEq for ValidColumnSizeParse
Auto Trait Implementations§
impl Freeze for ValidColumnSizeParse
impl RefUnwindSafe for ValidColumnSizeParse
impl Send for ValidColumnSizeParse
impl Sync for ValidColumnSizeParse
impl Unpin for ValidColumnSizeParse
impl UnsafeUnpin for ValidColumnSizeParse
impl UnwindSafe for ValidColumnSizeParse
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