| 1 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::{borrowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/::Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#, cmprust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/::maxrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/max()., numrust-analyzer cargo std https://github.com/rust-lang/rust/library/std num/::NonZeroU16rust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/NonZeroU16#}; |
| 2 | |
| 3 | use serderust-analyzer cargo serde 1.0.228 crate/::Deserializerust-analyzer cargo serde_core 1.0.228 de/Deserialize#; |
| 4 | |
| 5 | use craterust-analyzer cargo bottom 0.14.9 crate/::{ |
| 6 | apprust-analyzer cargo bottom 0.14.9 app/::{AppConfigFieldsrust-analyzer cargo bottom 0.14.9 app/AppConfigFields#, datarust-analyzer cargo bottom 0.14.9 app/data/::InnerDatarust-analyzer cargo bottom 0.14.9 app/data/store/InnerData#}, |
| 7 | canvasrust-analyzer cargo bottom 0.14.9 canvas/::componentsrust-analyzer cargo bottom 0.14.9 canvas/components/::data_tablerust-analyzer cargo bottom 0.14.9 canvas/components/data_table/::{ |
| 8 | ColumnHeaderrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/column/ColumnHeader#, DataTableColumnrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/column/DataTableColumn#, DataTablePropsrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/props/DataTableProps#, DataTableStylingrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/styling/DataTableStyling#, DataToCellrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/data_type/DataToCell#, SortColumnrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/SortColumn#, |
| 9 | SortDataTablerust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/SortDataTable#, SortDataTablePropsrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/SortDataTableProps#, SortsRowrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/SortsRow#, |
| 10 | }, |
| 11 | optionsrust-analyzer cargo bottom 0.14.9 options/::configrust-analyzer cargo bottom 0.14.9 options/config/::stylerust-analyzer cargo bottom 0.14.9 options/config/style/::Stylesrust-analyzer cargo bottom 0.14.9 options/config/style/Styles#, |
| 12 | utilsrust-analyzer cargo bottom 0.14.9 utils/::{ |
| 13 | conversionrust-analyzer cargo bottom 0.14.9 utils/conversion/::dec_bytes_per_second_stringrust-analyzer cargo bottom 0.14.9 utils/conversion/dec_bytes_per_second_string()., data_unitsrust-analyzer cargo bottom 0.14.9 utils/data_units/::get_decimal_bytesrust-analyzer cargo bottom 0.14.9 utils/data_units/get_decimal_bytes()., |
| 14 | generalrust-analyzer cargo bottom 0.14.9 utils/general/::sort_partial_fnrust-analyzer cargo bottom 0.14.9 utils/general/sort_partial_fn()., |
| 15 | }, |
| 16 | }; |
| 17 | |
| 18 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:)] |
| 19 | pub struct DiskWidgetDatarust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData# { |
| 20 | pub namerust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#name.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#, |
| 21 | pub mount_pointrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#mount_point.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#, |
| 22 | pub free_bytesrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#free_bytes.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<u64>, |
| 23 | pub used_bytesrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#used_bytes.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<u64>, |
| 24 | pub total_bytesrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#total_bytes.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<u64>, |
| 25 | pub summed_total_bytesrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#summed_total_bytes.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<u64>, |
| 26 | pub io_read_rate_bytesrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#io_read_rate_bytes.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<u64>, |
| 27 | pub io_write_rate_bytesrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#io_write_rate_bytes.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<u64>, |
| 28 | } |
| 29 | |
| 30 | impl DiskWidgetDatarust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData# { |
| 31 | fn total_spacerust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskWidgetData]total_space().(&self) -> Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'static, str> { |
| 32 | if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(total_bytes) = self.total_bytesrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#total_bytes. { |
| 33 | let converted_total_space = get_decimal_bytesrust-analyzer cargo bottom 0.14.9 utils/data_units/get_decimal_bytes().(total_bytes); |
| 34 | formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{:.0}{}", converted_total_space.0, converted_total_space.1).intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().() |
| 35 | } else { |
| 36 | "N/A".intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().() |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | fn free_spacerust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskWidgetData]free_space().(&self) -> Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'static, str> { |
| 41 | if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(free_bytes) = self.free_bytesrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#free_bytes. { |
| 42 | let converted_free_space = get_decimal_bytesrust-analyzer cargo bottom 0.14.9 utils/data_units/get_decimal_bytes().(free_bytes); |
| 43 | formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{:.0}{}", converted_free_space.0, converted_free_space.1).intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().() |
| 44 | } else { |
| 45 | "N/A".intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().() |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | fn used_spacerust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskWidgetData]used_space().(&self) -> Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'static, str> { |
| 50 | if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(used_bytes) = self.used_bytesrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#used_bytes. { |
| 51 | let converted_free_space = get_decimal_bytesrust-analyzer cargo bottom 0.14.9 utils/data_units/get_decimal_bytes().(used_bytes); |
| 52 | formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{:.0}{}", converted_free_space.0, converted_free_space.1).intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().() |
| 53 | } else { |
| 54 | "N/A".intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().() |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | fn free_percentrust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskWidgetData]free_percent().(&self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<f64> { |
| 59 | if let (Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(free_bytes), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(summed_total_bytes)) = |
| 60 | (self.free_bytesrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#free_bytes., self.summed_total_bytesrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#summed_total_bytes.) |
| 61 | { |
| 62 | if summed_total_bytes rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().0 { |
| 63 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(free_bytes as f64 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Div<Self>`]div().summed_total_bytes as f64 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul().100_f64) |
| 64 | } else { |
| 65 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# |
| 66 | } |
| 67 | } else { |
| 68 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | fn used_percentrust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskWidgetData]used_percent().(&self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<f64> { |
| 73 | if let (Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(used_bytes), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(summed_total_bytes)) = |
| 74 | (self.used_bytesrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#used_bytes., self.summed_total_bytesrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#summed_total_bytes.) |
| 75 | { |
| 76 | if summed_total_bytes rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().0 { |
| 77 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(used_bytes as f64 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Div<Self>`]div().summed_total_bytes as f64 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul().100_f64) |
| 78 | } else { |
| 79 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# |
| 80 | } |
| 81 | } else { |
| 82 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | fn io_readrust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskWidgetData]io_read().(&self) -> Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'static, str> { |
| 87 | self.io_read_rate_bytesrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#io_read_rate_bytes..map_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map_or().("N/A".intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |r_rate| { |
| 88 | dec_bytes_per_second_stringrust-analyzer cargo bottom 0.14.9 utils/conversion/dec_bytes_per_second_string().(r_rate).intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().() |
| 89 | }) |
| 90 | } |
| 91 | |
| 92 | fn io_writerust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskWidgetData]io_write().(&self) -> Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'static, str> { |
| 93 | self.io_write_rate_bytesrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#io_write_rate_bytes..map_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map_or().("N/A".intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |w_rate| { |
| 94 | dec_bytes_per_second_stringrust-analyzer cargo bottom 0.14.9 utils/conversion/dec_bytes_per_second_string().(w_rate).intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().() |
| 95 | }) |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:)] |
| 100 | #[cfg_attr( |
| 101 | feature = "generate_schema", |
| 102 | derive(schemars::JsonSchema, strum::VariantArray) |
| 103 | )] |
| 104 | pub enum DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn# { |
| 105 | Diskrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Disk#, |
| 106 | Mountrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Mount#, |
| 107 | Usedrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Used#, |
| 108 | Freerust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Free#, |
| 109 | Totalrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Total#, |
| 110 | UsedPercentrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#UsedPercent#, |
| 111 | FreePercentrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#FreePercent#, |
| 112 | IoReadrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#IoRead#, |
| 113 | IoWriterust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#IoWrite#, |
| 114 | } |
| 115 | |
| 116 | impl<'de> Deserializerust-analyzer cargo serde_core 1.0.228 de/Deserialize#<'de> for DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn# { |
| 117 | fn deserializerust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskWidgetColumn][`Deserialize<'de>`]deserialize().<D>(deserializer: D) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskWidgetColumn][`Deserialize<'de>`], D::Errorrust-analyzer cargo serde_core 1.0.228 de/Deserializer#Error#> |
| 118 | where |
| 119 | D: serderust-analyzer cargo serde 1.0.228 crate/::Deserializerrust-analyzer cargo serde_core 1.0.228 de/Deserializer#<'de>, |
| 120 | { |
| 121 | let value = Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::deserializerust-analyzer cargo serde_core 1.0.228 de/impls/impl#[String][`Deserialize<'de>`]deserialize().(deserializer)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()..to_lowercaserust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str]to_lowercase().(); |
| 122 | match value.as_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]as_str().() { |
| 123 | "disk" => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Diskrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Disk#), |
| 124 | "mount" => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Mountrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Mount#), |
| 125 | "used" => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Usedrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Used#), |
| 126 | "free" => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Freerust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Free#), |
| 127 | "total" => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Totalrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Total#), |
| 128 | "usedpercent" | "used%" => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::UsedPercentrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#UsedPercent#), |
| 129 | "freepercent" | "free%" => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::FreePercentrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#FreePercent#), |
| 130 | "r/s" | "read" | "rps" => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::IoReadrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#IoRead#), |
| 131 | "w/s" | "write" | "wps" => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::IoWriterust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#IoWrite#), |
| 132 | _ => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(serderust-analyzer cargo serde 1.0.228 crate/::derust-analyzer cargo serde_core 1.0.228 de/::Errorrust-analyzer cargo serde_core 1.0.228 de/Error#::customrust-analyzer cargo serde_core 1.0.228 de/Error#custom().( |
| 133 | "doesn't match any disk column name", |
| 134 | )), |
| 135 | } |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | impl DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn# { |
| 140 | /// An ugly hack to generate the JSON schema. |
| 141 | #[cfg(feature = "generate_schema")] |
| 142 | pub fn get_schema_names(&self) -> &[&'static str] { |
| 143 | match selfrust-analyzer cargo bottom 0.14.9 widgets/disk_table/ { |
| 144 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Diskrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Disk# => &["Disk"], |
| 145 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Mountrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Mount# => &["Mount"], |
| 146 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Usedrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Used# => &["Used"], |
| 147 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Freerust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Free# => &["Free"], |
| 148 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Totalrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Total# => &["Total"], |
| 149 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::UsedPercentrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#UsedPercent# => &["Used%"], |
| 150 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::FreePercentrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#FreePercent# => &["Free%"], |
| 151 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::IoReadrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#IoRead# => &["R/s", "Read", "Rps"], |
| 152 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::IoWriterust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#IoWrite# => &["W/s", "Write", "Wps"], |
| 153 | } |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | impl ColumnHeaderrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/column/ColumnHeader# for DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn# { |
| 158 | fn textrust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskWidgetColumn][ColumnHeader]text().(&self) -> Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'static, str> { |
| 159 | match self { |
| 160 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Diskrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Disk# => "Disk(d)", |
| 161 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Mountrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Mount# => "Mount(m)", |
| 162 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Usedrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Used# => "Used(u)", |
| 163 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Freerust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Free# => "Free(n)", |
| 164 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Totalrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Total# => "Total(t)", |
| 165 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::UsedPercentrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#UsedPercent# => "Used%(p)", |
| 166 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::FreePercentrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#FreePercent# => "Free%", |
| 167 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::IoReadrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#IoRead# => "R/s(r)", |
| 168 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::IoWriterust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#IoWrite# => "W/s(w)", |
| 169 | } |
| 170 | .intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().() |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | impl DataToCellrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/data_type/DataToCell#<DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#> for DiskWidgetDatarust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData# { |
| 175 | // FIXME: (points_rework_v1) Can we change the return type to 'a instead of |
| 176 | // 'static? |
| 177 | fn to_cell_textrust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskWidgetData][`DataToCell<DiskWidgetColumn>`]to_cell_text().( |
| 178 | &self, column: &DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#, _calculated_width: NonZeroU16rust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/NonZeroU16#, |
| 179 | ) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'static, str>> { |
| 180 | fn percent_stringrust-analyzer cargo bottom 0.14.9 widgets/disk_table/percent_string().(value: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<f64>) -> Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'static, str> { |
| 181 | match value { |
| 182 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(val) => formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{val:.1}%").intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |
| 183 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => "N/A".intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | let text = match column { |
| 188 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Diskrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Disk# => self.namerust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#name..clonerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][Clone]clone().().intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |
| 189 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Mountrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Mount# => self.mount_pointrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#mount_point..clonerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][Clone]clone().().intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |
| 190 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Usedrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Used# => self.used_spacerust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskWidgetData]used_space().(), |
| 191 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Freerust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Free# => self.free_spacerust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskWidgetData]free_space().(), |
| 192 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::UsedPercentrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#UsedPercent# => percent_stringrust-analyzer cargo bottom 0.14.9 widgets/disk_table/percent_string().(self.used_percentrust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskWidgetData]used_percent().()), |
| 193 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::FreePercentrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#FreePercent# => percent_stringrust-analyzer cargo bottom 0.14.9 widgets/disk_table/percent_string().(self.free_percentrust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskWidgetData]free_percent().()), |
| 194 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Totalrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Total# => self.total_spacerust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskWidgetData]total_space().(), |
| 195 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::IoReadrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#IoRead# => self.io_readrust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskWidgetData]io_read().(), |
| 196 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::IoWriterust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#IoWrite# => self.io_writerust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskWidgetData]io_write().(), |
| 197 | }; |
| 198 | |
| 199 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(text) |
| 200 | } |
| 201 | |
| 202 | fn column_widthsrust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskWidgetData][`DataToCell<DiskWidgetColumn>`]column_widths().<C: DataTableColumnrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/column/DataTableColumn#<DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#>>( |
| 203 | data: &[Selfrust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskWidgetData][`DataToCell<DiskWidgetColumn>`]], _columns: &[C], |
| 204 | ) -> Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u16> |
| 205 | where |
| 206 | Selfrust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskWidgetData][`DataToCell<DiskWidgetColumn>`]: Sizedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sized#, |
| 207 | { |
| 208 | let mut widths = vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![0; 7]; |
| 209 | |
| 210 | data.iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().for_eachrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/iter/impl#[`Iter<'a, T>`][Iterator]for_each().(|row| { |
| 211 | widths[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut().0]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut(). = maxrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/max().(widths[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().0]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index()., row.namerust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#name..lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]len().() as u16); |
| 212 | widths[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut().1]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut(). = maxrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/max().(widths[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().1]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index()., row.mount_pointrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#mount_point..lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]len().() as u16); |
| 213 | }); |
| 214 | |
| 215 | widths |
| 216 | } |
| 217 | } |
| 218 | |
| 219 | pub struct DiskTableWidgetrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskTableWidget# { |
| 220 | pub(craterust-analyzer cargo bottom 0.14.9 crate/) tablerust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskTableWidget#table.: SortDataTablerust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/SortDataTable#<DiskWidgetDatarust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#, DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#>, |
| 221 | pub(craterust-analyzer cargo bottom 0.14.9 crate/) force_update_datarust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskTableWidget#force_update_data.: bool, |
| 222 | pub(craterust-analyzer cargo bottom 0.14.9 crate/) show_unmountedrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskTableWidget#show_unmounted.: bool, |
| 223 | } |
| 224 | |
| 225 | impl SortsRowrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/SortsRow# for DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn# { |
| 226 | type DataTyperust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskWidgetColumn][SortsRow]DataType# = DiskWidgetDatarust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#; |
| 227 | |
| 228 | fn sort_datarust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskWidgetColumn][SortsRow]sort_data().(&self, data: &mut [Selfrust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskWidgetColumn][SortsRow]::DataTyperust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/SortsRow#DataType#], descending: bool) { |
| 229 | match self { |
| 230 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Diskrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Disk# => { |
| 231 | data.sort_byrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]sort_by().(|a, b| sort_partial_fnrust-analyzer cargo bottom 0.14.9 utils/general/sort_partial_fn().(descending)(&a.namerust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#name., &b.namerust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#name.)); |
| 232 | } |
| 233 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Mountrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Mount# => { |
| 234 | data.sort_byrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]sort_by().(|a, b| sort_partial_fnrust-analyzer cargo bottom 0.14.9 utils/general/sort_partial_fn().(descending)(&a.mount_pointrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#mount_point., &b.mount_pointrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#mount_point.)); |
| 235 | } |
| 236 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Usedrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Used# => { |
| 237 | data.sort_byrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]sort_by().(|a, b| sort_partial_fnrust-analyzer cargo bottom 0.14.9 utils/general/sort_partial_fn().(descending)(&a.used_bytesrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#used_bytes., &b.used_bytesrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#used_bytes.)); |
| 238 | } |
| 239 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::UsedPercentrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#UsedPercent# => { |
| 240 | data.sort_byrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]sort_by().(|a, b| { |
| 241 | sort_partial_fnrust-analyzer cargo bottom 0.14.9 utils/general/sort_partial_fn().(descending)(&a.used_percentrust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskWidgetData]used_percent().(), &b.used_percentrust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskWidgetData]used_percent().()) |
| 242 | }); |
| 243 | } |
| 244 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Freerust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Free# => { |
| 245 | data.sort_byrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]sort_by().(|a, b| sort_partial_fnrust-analyzer cargo bottom 0.14.9 utils/general/sort_partial_fn().(descending)(&a.free_bytesrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#free_bytes., &b.free_bytesrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#free_bytes.)); |
| 246 | } |
| 247 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::FreePercentrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#FreePercent# => { |
| 248 | data.sort_byrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]sort_by().(|a, b| { |
| 249 | sort_partial_fnrust-analyzer cargo bottom 0.14.9 utils/general/sort_partial_fn().(descending)(&a.free_percentrust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskWidgetData]free_percent().(), &b.free_percentrust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskWidgetData]free_percent().()) |
| 250 | }); |
| 251 | } |
| 252 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Totalrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Total# => { |
| 253 | data.sort_byrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]sort_by().(|a, b| sort_partial_fnrust-analyzer cargo bottom 0.14.9 utils/general/sort_partial_fn().(descending)(&a.total_bytesrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#total_bytes., &b.total_bytesrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#total_bytes.)); |
| 254 | } |
| 255 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::IoReadrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#IoRead# => { |
| 256 | data.sort_byrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]sort_by().(|a, b| { |
| 257 | sort_partial_fnrust-analyzer cargo bottom 0.14.9 utils/general/sort_partial_fn().(descending)(&a.io_read_rate_bytesrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#io_read_rate_bytes., &b.io_read_rate_bytesrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#io_read_rate_bytes.) |
| 258 | }); |
| 259 | } |
| 260 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::IoWriterust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#IoWrite# => { |
| 261 | data.sort_byrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]sort_by().(|a, b| { |
| 262 | sort_partial_fnrust-analyzer cargo bottom 0.14.9 utils/general/sort_partial_fn().(descending)(&a.io_write_rate_bytesrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#io_write_rate_bytes., &b.io_write_rate_bytesrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#io_write_rate_bytes.) |
| 263 | }); |
| 264 | } |
| 265 | } |
| 266 | } |
| 267 | } |
| 268 | |
| 269 | const fn create_columnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/create_column().(column_type: &DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#) -> SortColumnrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/SortColumn#<DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#> { |
| 270 | match column_type { |
| 271 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Diskrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Disk# => SortColumnrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/SortColumn#::softrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/impl#[`SortColumn<T>`]soft().(DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Diskrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Disk#, Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(0.2)), |
| 272 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Mountrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Mount# => SortColumnrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/SortColumn#::softrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/impl#[`SortColumn<T>`]soft().(DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Mountrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Mount#, Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(0.2)), |
| 273 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Usedrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Used# => SortColumnrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/SortColumn#::hardrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/impl#[`SortColumn<T>`]hard().(DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Usedrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Used#, 8).default_descendingrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/impl#[`SortColumn<T>`]default_descending().(), |
| 274 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Freerust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Free# => SortColumnrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/SortColumn#::hardrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/impl#[`SortColumn<T>`]hard().(DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Freerust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Free#, 8).default_descendingrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/impl#[`SortColumn<T>`]default_descending().(), |
| 275 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Totalrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Total# => { |
| 276 | SortColumnrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/SortColumn#::hardrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/impl#[`SortColumn<T>`]hard().(DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Totalrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Total#, 9).default_descendingrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/impl#[`SortColumn<T>`]default_descending().() |
| 277 | } |
| 278 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::UsedPercentrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#UsedPercent# => { |
| 279 | SortColumnrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/SortColumn#::hardrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/impl#[`SortColumn<T>`]hard().(DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::UsedPercentrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#UsedPercent#, 9).default_descendingrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/impl#[`SortColumn<T>`]default_descending().() |
| 280 | } |
| 281 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::FreePercentrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#FreePercent# => { |
| 282 | SortColumnrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/SortColumn#::hardrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/impl#[`SortColumn<T>`]hard().(DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::FreePercentrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#FreePercent#, 9).default_descendingrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/impl#[`SortColumn<T>`]default_descending().() |
| 283 | } |
| 284 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::IoReadrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#IoRead# => { |
| 285 | SortColumnrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/SortColumn#::hardrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/impl#[`SortColumn<T>`]hard().(DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::IoReadrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#IoRead#, 10).default_descendingrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/impl#[`SortColumn<T>`]default_descending().() |
| 286 | } |
| 287 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::IoWriterust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#IoWrite# => { |
| 288 | SortColumnrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/SortColumn#::hardrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/impl#[`SortColumn<T>`]hard().(DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::IoWriterust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#IoWrite#, 11).default_descendingrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/impl#[`SortColumn<T>`]default_descending().() |
| 289 | } |
| 290 | } |
| 291 | } |
| 292 | |
| 293 | const fn default_disk_column_listrust-analyzer cargo bottom 0.14.9 widgets/disk_table/default_disk_column_list().() -> [DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#; 8] { |
| 294 | [ |
| 295 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Diskrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Disk#, |
| 296 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Mountrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Mount#, |
| 297 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Usedrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Used#, |
| 298 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Freerust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Free#, |
| 299 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Totalrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Total#, |
| 300 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::UsedPercentrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#UsedPercent#, |
| 301 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::IoReadrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#IoRead#, |
| 302 | DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::IoWriterust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#IoWrite#, |
| 303 | ] |
| 304 | } |
| 305 | |
| 306 | const fn default_disk_columnsrust-analyzer cargo bottom 0.14.9 widgets/disk_table/default_disk_columns().() -> [SortColumnrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/SortColumn#<DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#>; 8] { |
| 307 | [ |
| 308 | create_columnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/create_column().(&DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Diskrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Disk#), |
| 309 | create_columnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/create_column().(&DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Mountrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Mount#), |
| 310 | create_columnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/create_column().(&DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Usedrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Used#), |
| 311 | create_columnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/create_column().(&DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Freerust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Free#), |
| 312 | create_columnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/create_column().(&DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::Totalrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#Total#), |
| 313 | create_columnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/create_column().(&DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::UsedPercentrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#UsedPercent#), |
| 314 | create_columnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/create_column().(&DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::IoReadrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#IoRead#), |
| 315 | create_columnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/create_column().(&DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#::IoWriterust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#IoWrite#), |
| 316 | ] |
| 317 | } |
| 318 | |
| 319 | impl DiskTableWidgetrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskTableWidget# { |
| 320 | pub fn newrust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskTableWidget]new().( |
| 321 | config: &AppConfigFieldsrust-analyzer cargo bottom 0.14.9 app/AppConfigFields#, palette: &Stylesrust-analyzer cargo bottom 0.14.9 options/config/style/Styles#, columns: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&[DiskWidgetColumnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetColumn#]>, |
| 322 | show_unmounted: bool, |
| 323 | ) -> Selfrust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskTableWidget] { |
| 324 | let props = SortDataTablePropsrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/SortDataTableProps# { |
| 325 | innerrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/SortDataTableProps#inner.: DataTablePropsrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/props/DataTableProps# { |
| 326 | titlerust-analyzer cargo bottom 0.14.9 canvas/components/data_table/props/DataTableProps#title.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(" Disks ".intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()), |
| 327 | table_gaprust-analyzer cargo bottom 0.14.9 canvas/components/data_table/props/DataTableProps#table_gap.: config.table_gaprust-analyzer cargo bottom 0.14.9 app/AppConfigFields#table_gap., |
| 328 | left_to_rightrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/props/DataTableProps#left_to_right.: true, |
| 329 | is_basicrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/props/DataTableProps#is_basic.: config.use_basic_moderust-analyzer cargo bottom 0.14.9 app/AppConfigFields#use_basic_mode., |
| 330 | show_table_scroll_positionrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/props/DataTableProps#show_table_scroll_position.: config.show_table_scroll_positionrust-analyzer cargo bottom 0.14.9 app/AppConfigFields#show_table_scroll_position., |
| 331 | show_table_scroll_barrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/props/DataTableProps#show_table_scroll_bar.: config.show_table_scroll_barrust-analyzer cargo bottom 0.14.9 app/AppConfigFields#show_table_scroll_bar., |
| 332 | show_current_entry_when_unfocusedrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/props/DataTableProps#show_current_entry_when_unfocused.: false, |
| 333 | }, |
| 334 | sort_indexrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/SortDataTableProps#sort_index.: match &config.default_disk_sort_columnrust-analyzer cargo bottom 0.14.9 app/AppConfigFields#default_disk_sort_column. { |
| 335 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(column) => { |
| 336 | // Must check that the column used exists. If not, fall back to 0. |
| 337 | |
| 338 | let existing_columns = match columns { |
| 339 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(c) => c, |
| 340 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => &default_disk_column_listrust-analyzer cargo bottom 0.14.9 widgets/disk_table/default_disk_column_list().(), |
| 341 | }; |
| 342 | |
| 343 | existing_columns |
| 344 | .iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().() |
| 345 | .positionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/iter/impl#[`Iter<'a, T>`][Iterator]position().(|c| c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq().column) |
| 346 | .unwrap_or_defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap_or_default().() |
| 347 | } |
| 348 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => 0, |
| 349 | }, |
| 350 | orderrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/SortDataTableProps#order.: config.default_disk_sort_orderrust-analyzer cargo bottom 0.14.9 app/AppConfigFields#default_disk_sort_order., |
| 351 | }; |
| 352 | |
| 353 | let styling = DataTableStylingrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/styling/DataTableStyling#::from_paletterust-analyzer cargo bottom 0.14.9 canvas/components/data_table/styling/impl#[DataTableStyling]from_palette().(palette); |
| 354 | |
| 355 | match columns { |
| 356 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(columns) => { |
| 357 | let columns = columns.iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(create_columnrust-analyzer cargo bottom 0.14.9 widgets/disk_table/create_column().).collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().::<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<_>>(); |
| 358 | Selfrust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskTableWidget] { |
| 359 | tablerust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskTableWidget#table.: SortDataTablerust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/SortDataTable#::new_sortablerust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/impl#[`DataTable<D, H, Sortable, SortColumn<H>>`]new_sortable().(columns, props, styling), |
| 360 | force_update_datarust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskTableWidget#force_update_data.: false, |
| 361 | show_unmountedrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskTableWidget#show_unmounted., |
| 362 | } |
| 363 | } |
| 364 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => Selfrust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskTableWidget] { |
| 365 | tablerust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskTableWidget#table.: SortDataTablerust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/SortDataTable#::new_sortablerust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/impl#[`DataTable<D, H, Sortable, SortColumn<H>>`]new_sortable().(default_disk_columnsrust-analyzer cargo bottom 0.14.9 widgets/disk_table/default_disk_columns().(), props, styling), |
| 366 | force_update_datarust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskTableWidget#force_update_data.: false, |
| 367 | show_unmountedrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskTableWidget#show_unmounted., |
| 368 | }, |
| 369 | } |
| 370 | } |
| 371 | |
| 372 | /// Forces an update of the data stored. |
| 373 | #[inline] |
| 374 | pub fn force_data_updaterust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskTableWidget]force_data_update().(&mut self) { |
| 375 | self.force_update_datarust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskTableWidget#force_update_data. = true; |
| 376 | } |
| 377 | |
| 378 | /// Update the current table data. |
| 379 | pub fn set_table_datarust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskTableWidget]set_table_data().(&mut self, data: &InnerDatarust-analyzer cargo bottom 0.14.9 app/data/store/InnerData#) { |
| 380 | // Note that the data may contain unmounted disks (e.g. we enable it for another disk widget), |
| 381 | // so we have to potentially filter it out here too. |
| 382 | let mut data: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<DiskWidgetDatarust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#> = if self.show_unmountedrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskTableWidget#show_unmounted. { |
| 383 | data.disk_harvestrust-analyzer cargo bottom 0.14.9 app/data/store/InnerData#disk_harvest..clonerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][Clone]clone().() |
| 384 | } else { |
| 385 | #[cfg(target_os = "linux")] |
| 386 | { |
| 387 | data.disk_harvestrust-analyzer cargo bottom 0.14.9 app/data/store/InnerData#disk_harvest. |
| 388 | .iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().() |
| 389 | .filterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#filter().(|disk| !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().disk.mount_pointrust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskWidgetData#mount_point..is_emptyrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]is_empty().()) |
| 390 | .clonedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#cloned().() |
| 391 | .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().() |
| 392 | } |
| 393 | #[cfg(not(target_os = "linux"))] |
| 394 | { |
| 395 | data.disk_harvest.clone() |
| 396 | } |
| 397 | }; |
| 398 | |
| 399 | if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(column) = self.tablerust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskTableWidget#table..columnsrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/DataTable#columns..getrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]get().(self.tablerust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskTableWidget#table..sort_indexrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/impl#[`DataTable<D, H, Sortable, SortColumn<H>>`]sort_index().()) { |
| 400 | column.sort_byrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/impl#[`SortColumn<T>`]sort_by().(&mut data, self.tablerust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskTableWidget#table..orderrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/impl#[`DataTable<D, H, Sortable, SortColumn<H>>`]order().()); |
| 401 | } |
| 402 | self.tablerust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskTableWidget#table..set_datarust-analyzer cargo bottom 0.14.9 canvas/components/data_table/impl#[`DataTable<DataType, H, S, C>`]set_data().(data); |
| 403 | self.force_update_datarust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskTableWidget#force_update_data. = false; |
| 404 | } |
| 405 | |
| 406 | pub fn set_indexrust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskTableWidget]set_index().(&mut self, index: usize) { |
| 407 | self.tablerust-analyzer cargo bottom 0.14.9 widgets/disk_table/DiskTableWidget#table..set_sort_indexrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/sortable/impl#[`DataTable<D, H, Sortable, SortColumn<H>>`]set_sort_index().(index); |
| 408 | self.force_data_updaterust-analyzer cargo bottom 0.14.9 widgets/disk_table/impl#[DiskTableWidget]force_data_update().(); |
| 409 | } |
| 410 | } |