Skip to main content

ValidTableColumns

Enum ValidTableColumns 

Source
pub enum ValidTableColumns {
    Date,
    Time,
    Size,
    Item,
    Path,
}

Variants§

§

Date

§

Time

§

Size

§

Item

§

Path

Implementations§

Source§

impl ValidTableColumns

Source

pub fn parse(s: &str) -> Result<Self, String>

Source

pub fn parse_vec<I>(inputs: I) -> Result<Vec<Self>, String>
where I: IntoIterator, I::Item: AsRef<str>,

Source

pub fn parse_vec_as_config<I>(inputs: I) -> ValidTableColumnsConfig
where I: IntoIterator, I::Item: AsRef<str>,

Examples found in repository?
examples/try-step2.rs (line 30)
3fn main() {
4	println!("=== TEST STEP 2 (ALPHA) ===\n");
5
6	// =========================================================================
7	// STEP 0: Inicjalizacja
8	// =========================================================================
9
10	let ws_cfg = job::ValidWorkspace::parse_vec_as_config(["."]);
11	let pt_cfg = job::ValidPattern::parse_vec_as_config(Vec::<&str>::new(), None);
12	// let pt_cfg = job::ValidPattern::parse_vec_as_config::<[&str; 0]>([], None);
13
14	// =========================================================================
15	// STEP 1: Skanowanie i pobranie metadanych z dysku
16	// =========================================================================
17	let part_cfg = job::ValidTablePart::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 (RawRow): {}\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::ValidColumnItem::parse_vec_as_config(["list-tree", "name-show", "ws-show", "icons-lite"]).unwrap();
29
30	let cols_cfg = job::ValidTableColumns::parse_vec_as_config(["date", "time", "size", "item", "path"]);
31
32	let date_cfg = job::ValidColumnDate::parse_vec_as_config(["default"]);
33	let time_cfg = job::ValidColumnTime::parse_vec_as_config(["default"]);
34	let size_cfg = job::ValidColumnSize::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 ValidTableColumns

Source§

fn clone(&self) -> ValidTableColumns

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ValidTableColumns

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ValidTableColumns

Source§

fn eq(&self, other: &ValidTableColumns) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for ValidTableColumns

Source§

impl StructuralPartialEq for ValidTableColumns

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.