| 1 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::{ |
| 2 | 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#, |
| 3 | cmprust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/::{Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#, maxrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/max().}, |
| 4 | fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display#, |
| 5 | 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#, |
| 6 | opsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/::Addrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#, |
| 7 | syncrust-analyzer cargo std https://github.com/rust-lang/rust/library/std sync/::Arcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc sync/Arc#, |
| 8 | timerust-analyzer cargo std https://github.com/rust-lang/rust/library/std time/::Durationrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/Duration#, |
| 9 | }; |
| 10 | |
| 11 | use concat_stringrust-analyzer cargo concat-string 1.0.1 crate/::concat_stringrust-analyzer cargo concat-string 1.0.1 concat_string!; |
| 12 | use ratatuirust-analyzer cargo ratatui 0.30.2 crate/::widgetsrust-analyzer cargo ratatui 0.30.2 widgets/::Rowrust-analyzer cargo ratatui-widgets 0.3.2 table/row/Row#; |
| 13 | |
| 14 | use superrust-analyzer cargo bottom 0.14.9 widgets/process_table/::process_columnsrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/::ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#; |
| 15 | #[cfg(target_os = "linux")] |
| 16 | use craterust-analyzer cargo bottom 0.14.9 crate/::collectionrust-analyzer cargo bottom 0.14.9 collection/::processesrust-analyzer cargo bottom 0.14.9 collection/processes/::ProcessTyperust-analyzer cargo bottom 0.14.9 collection/processes/ProcessType#; |
| 17 | use craterust-analyzer cargo bottom 0.14.9 crate/::{ |
| 18 | canvasrust-analyzer cargo bottom 0.14.9 canvas/::{ |
| 19 | Painterrust-analyzer cargo bottom 0.14.9 canvas/Painter#, |
| 20 | componentsrust-analyzer cargo bottom 0.14.9 canvas/components/::data_tablerust-analyzer cargo bottom 0.14.9 canvas/components/data_table/::{DataTableColumnrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/column/DataTableColumn#, DataToCellrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/data_type/DataToCell#}, |
| 21 | }, |
| 22 | collectionrust-analyzer cargo bottom 0.14.9 collection/::processesrust-analyzer cargo bottom 0.14.9 collection/processes/::{Pidrust-analyzer cargo bottom 0.14.9 collection/processes/Pid#, ProcessHarvestrust-analyzer cargo bottom 0.14.9 collection/processes/ProcessHarvest#}, |
| 23 | dec_bytes_per_second_stringrust-analyzer cargo bottom 0.14.9 utils/conversion/dec_bytes_per_second_string()., |
| 24 | utilsrust-analyzer cargo bottom 0.14.9 utils/::data_unitsrust-analyzer cargo bottom 0.14.9 utils/data_units/::{GIBI_LIMITrust-analyzer cargo bottom 0.14.9 utils/data_units/GIBI_LIMIT., GIGA_LIMITrust-analyzer cargo bottom 0.14.9 utils/data_units/GIGA_LIMIT., get_binary_bytesrust-analyzer cargo bottom 0.14.9 utils/data_units/get_binary_bytes()., get_decimal_bytesrust-analyzer cargo bottom 0.14.9 utils/data_units/get_decimal_bytes().}, |
| 25 | }; |
| 26 | |
| 27 | #[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:)] |
| 28 | enum IdTyperust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/IdType# { |
| 29 | Namerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/IdType#Name#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#), |
| 30 | Commandrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/IdType#Command#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#), |
| 31 | } |
| 32 | |
| 33 | #[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:)] |
| 34 | pub struct Idrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/Id# { |
| 35 | id_typerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/Id#id_type.: IdTyperust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/IdType#, |
| 36 | prefixrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/Id#prefix.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>, |
| 37 | } |
| 38 | |
| 39 | impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<&'static str> for Idrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/Id# { |
| 40 | fn fromrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[Id][`From<&'static str>`]from().(s: &'static str) -> Selfrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[Id][`From<&'static str>`] { |
| 41 | Idrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/Id# { |
| 42 | id_typerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/Id#id_type.: IdTyperust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/IdType#::Namerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/IdType#Name#(s.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()), |
| 43 | prefixrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/Id#prefix.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 44 | } |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | impl Idrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/Id# { |
| 49 | /// Returns the ID as a lowercase [`String`], with no prefix. This is |
| 50 | /// primarily useful for cases like sorting where we treat everything as |
| 51 | /// the same case (e.g. `Discord` comes before `dkms`). |
| 52 | pub fn to_lowercaserust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[Id]to_lowercase().(&self) -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# { |
| 53 | match &self.id_typerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/Id#id_type. { |
| 54 | IdTyperust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/IdType#::Namerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/IdType#Name#(name) => name.to_lowercaserust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str]to_lowercase().(), |
| 55 | IdTyperust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/IdType#::Commandrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/IdType#Command#(cmd) => cmd.to_lowercaserust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str]to_lowercase().(), |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | /// Return the ID as a borrowed [`str`] with no prefix. |
| 60 | pub fn as_strrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[Id]as_str().(&self) -> &str { |
| 61 | match &self.id_typerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/Id#id_type. { |
| 62 | IdTyperust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/IdType#::Namerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/IdType#Name#(name) => name.as_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]as_str().(), |
| 63 | IdTyperust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/IdType#::Commandrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/IdType#Command#(cmd) => cmd.as_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]as_str().(), |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | /// Returns the ID as a [`String`] with prefix. |
| 68 | pub fn to_prefixed_stringrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[Id]to_prefixed_string().(&self) -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# { |
| 69 | if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(prefix) = &self.prefixrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/Id#prefix. { |
| 70 | concat_stringrust-analyzer cargo concat-string 1.0.1 concat_string!!( |
| 71 | prefix, |
| 72 | match &self.id_typerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/Id#id_type. { |
| 73 | IdTyperust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/IdType#::Namerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/IdType#Name#(name) => name, |
| 74 | IdTyperust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/IdType#::Commandrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/IdType#Command#(cmd) => cmd, |
| 75 | } |
| 76 | ) |
| 77 | } else { |
| 78 | match &self.id_typerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/Id#id_type. { |
| 79 | IdTyperust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/IdType#::Namerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/IdType#Name#(name) => name.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 80 | IdTyperust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/IdType#::Commandrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/IdType#Command#(cmd) => cmd.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 81 | } |
| 82 | } |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | impl Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display# for Idrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/Id# { |
| 87 | fn fmtrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[Id][Display]fmt().(&self, f: &mut stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#<'_>) -> stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# { |
| 88 | f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().(self.as_strrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[Id]as_str().()) |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, 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:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:)] |
| 93 | pub enum MemUsagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage# { |
| 94 | Percentrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#Percent#(f32), |
| 95 | Bytesrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#Bytes#(u64), |
| 96 | } |
| 97 | |
| 98 | impl Addrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add# for MemUsagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage# { |
| 99 | type Outputrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[MemUsage][`Add<Self>`]Output# = Selfrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[MemUsage][`Add<Self>`]; |
| 100 | |
| 101 | fn addrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[MemUsage][`Add<Self>`]add().(self, rhs: Selfrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[MemUsage][`Add<Self>`]) -> Selfrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[MemUsage][`Add<Self>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#Output# { |
| 102 | match (self, rhs) { |
| 103 | (MemUsagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#::Percentrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#Percent#(a), MemUsagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#::Percentrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#Percent#(b)) => MemUsagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#::Percentrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#Percent#(a rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().b), |
| 104 | (MemUsagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#::Bytesrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#Bytes#(a), MemUsagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#::Bytesrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#Bytes#(b)) => MemUsagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#::Bytesrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#Bytes#(a rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Add<Self>`]add().b), |
| 105 | (MemUsagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#::Bytesrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#Bytes#(_), MemUsagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#::Percentrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#Percent#(_)) |
| 106 | | (MemUsagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#::Percentrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#Percent#(_), MemUsagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#::Bytesrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#Bytes#(_)) => { |
| 107 | unreachablerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/unreachable!!("trying to add together two different memory usage types!") |
| 108 | } |
| 109 | } |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | impl PartialOrdrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd# for MemUsagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage# { |
| 114 | fn partial_cmprust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[MemUsage][`PartialOrd<Self>`]partial_cmp().(&self, other: &Selfrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[MemUsage][`PartialOrd<Self>`]) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#> { |
| 115 | match (self, other) { |
| 116 | (MemUsagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#::Percentrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#Percent#(a), MemUsagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#::Percentrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#Percent#(b)) => a.partial_cmprust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[f32][`PartialOrd<Self>`]partial_cmp().(b), |
| 117 | (MemUsagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#::Bytesrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#Bytes#(a), MemUsagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#::Bytesrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#Bytes#(b)) => a.partial_cmprust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]partial_cmp().(b), |
| 118 | _ => unreachablerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/unreachable!!(), |
| 119 | } |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | impl Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display# for MemUsagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage# { |
| 124 | fn fmtrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[MemUsage][Display]fmt().(&self, f: &mut stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#<'_>) -> stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# { |
| 125 | match self { |
| 126 | MemUsagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#::Percentrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#Percent#(percent) => f.write_fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_fmt().(format_argsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/format_args!!("{percent:.1}%")), |
| 127 | MemUsagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#::Bytesrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#Bytes#(bytes) => f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().(&binary_byte_stringrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/binary_byte_string().(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().bytes)), |
| 128 | } |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | trait DurationExtrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/DurationExt# { |
| 133 | fn num_daysrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/DurationExt#num_days().(&self) -> u64; |
| 134 | fn num_hoursrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/DurationExt#num_hours().(&self) -> u64; |
| 135 | fn num_minutesrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/DurationExt#num_minutes().(&self) -> u64; |
| 136 | } |
| 137 | |
| 138 | const SECS_PER_DAYrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/SECS_PER_DAY.: u64 = SECS_PER_HOURrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/SECS_PER_HOUR. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Mul<Self>`]mul().24; |
| 139 | const SECS_PER_HOURrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/SECS_PER_HOUR.: u64 = SECS_PER_MINUTErust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/SECS_PER_MINUTE. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Mul<Self>`]mul().60; |
| 140 | const SECS_PER_MINUTErust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/SECS_PER_MINUTE.: u64 = 60; |
| 141 | |
| 142 | impl DurationExtrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/DurationExt# for Durationrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/Duration# { |
| 143 | /// Number of full days in this duration. |
| 144 | #[inline] |
| 145 | fn num_daysrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[Duration][DurationExt]num_days().(&self) -> u64 { |
| 146 | self.as_secsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]as_secs().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Div<Self>`]div().SECS_PER_DAYrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/SECS_PER_DAY. |
| 147 | } |
| 148 | |
| 149 | /// Number of full hours in this duration. |
| 150 | #[inline] |
| 151 | fn num_hoursrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[Duration][DurationExt]num_hours().(&self) -> u64 { |
| 152 | self.as_secsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]as_secs().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Div<Self>`]div().SECS_PER_HOURrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/SECS_PER_HOUR. |
| 153 | } |
| 154 | |
| 155 | /// Number of full minutes in this duration. |
| 156 | #[inline] |
| 157 | fn num_minutesrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[Duration][DurationExt]num_minutes().(&self) -> u64 { |
| 158 | self.as_secsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]as_secs().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Div<Self>`]div().SECS_PER_MINUTErust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/SECS_PER_MINUTE. |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | fn format_timerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/format_time().(dur: Durationrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/Duration#) -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# { |
| 163 | if dur.num_daysrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[Duration][DurationExt]num_days().() 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 { |
| 164 | formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!( |
| 165 | "{}d {}h {}m", |
| 166 | dur.num_daysrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[Duration][DurationExt]num_days().(), |
| 167 | dur.num_hoursrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[Duration][DurationExt]num_hours().() %rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Rem<Self>`]rem(). 24, |
| 168 | dur.num_minutesrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[Duration][DurationExt]num_minutes().() %rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Rem<Self>`]rem(). 60 |
| 169 | ) |
| 170 | } else if dur.num_hoursrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[Duration][DurationExt]num_hours().() 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 { |
| 171 | formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!( |
| 172 | "{}h {}m {}s", |
| 173 | dur.num_hoursrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[Duration][DurationExt]num_hours().(), |
| 174 | dur.num_minutesrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[Duration][DurationExt]num_minutes().() %rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Rem<Self>`]rem(). 60, |
| 175 | dur.as_secsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]as_secs().() %rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Rem<Self>`]rem(). 60 |
| 176 | ) |
| 177 | } else if dur.num_minutesrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[Duration][DurationExt]num_minutes().() 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 { |
| 178 | formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!( |
| 179 | "{}m {}.{:02}s", |
| 180 | dur.num_minutesrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[Duration][DurationExt]num_minutes().(), |
| 181 | dur.as_secsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]as_secs().() %rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Rem<Self>`]rem(). 60, |
| 182 | dur.as_millisrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]as_millis().() %rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u128][`Rem<Self>`]rem(). 1000 /rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u128][`Div<Self>`]div(). 10 |
| 183 | ) |
| 184 | } else { |
| 185 | formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{}.{:03}s", dur.as_secsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]as_secs().(), dur.as_millisrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]as_millis().() %rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u128][`Rem<Self>`]rem(). 1000) |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | /// Returns a string given a value that is converted to the closest binary |
| 190 | /// variant. If the value is greater than a gibibyte, then it will return a |
| 191 | /// decimal place. |
| 192 | #[inline] |
| 193 | fn binary_byte_stringrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/binary_byte_string().(value: u64) -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# { |
| 194 | let converted_values = get_binary_bytesrust-analyzer cargo bottom 0.14.9 utils/data_units/get_binary_bytes().(value); |
| 195 | if value rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]ge().GIBI_LIMITrust-analyzer cargo bottom 0.14.9 utils/data_units/GIBI_LIMIT. { |
| 196 | formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{:.1}{}", converted_values.0, converted_values.1) |
| 197 | } else { |
| 198 | formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{:.0}{}", converted_values.0, converted_values.1) |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | /// Returns a string given a value that is converted to the closest SI-variant. |
| 203 | /// If the value is greater than a giga-X, then it will return a decimal place. |
| 204 | fn dec_bytes_stringrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/dec_bytes_string().(value: u64) -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# { |
| 205 | let converted_values = get_decimal_bytesrust-analyzer cargo bottom 0.14.9 utils/data_units/get_decimal_bytes().(value); |
| 206 | if value rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]ge().GIGA_LIMITrust-analyzer cargo bottom 0.14.9 utils/data_units/GIGA_LIMIT. { |
| 207 | formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{:.1}{}", converted_values.0, converted_values.1) |
| 208 | } else { |
| 209 | formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{:.0}{}", converted_values.0, converted_values.1) |
| 210 | } |
| 211 | } |
| 212 | |
| 213 | #[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:)] |
| 214 | pub struct ProcWidgetDatarust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData# { |
| 215 | pub pidrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#pid.: Pidrust-analyzer cargo bottom 0.14.9 collection/processes/Pid#, |
| 216 | #[allow(dead_code)] |
| 217 | pub ppidrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#ppid.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Pidrust-analyzer cargo bottom 0.14.9 collection/processes/Pid#>, |
| 218 | pub idrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#id.: Idrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/Id#, |
| 219 | pub cpu_usage_percentrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#cpu_usage_percent.: f32, |
| 220 | pub mem_usagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#mem_usage.: MemUsagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#, |
| 221 | pub virtual_memrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#virtual_mem.: u64, |
| 222 | pub rpsrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#rps.: u64, |
| 223 | pub wpsrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#wps.: u64, |
| 224 | pub total_readrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#total_read.: u64, |
| 225 | pub total_writerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#total_write.: u64, |
| 226 | pub process_staterust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#process_state.: &'static str, |
| 227 | pub process_charrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#process_char.: char, |
| 228 | pub userrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#user.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Arcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc sync/Arc#<str>>, |
| 229 | pub num_similarrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#num_similar.: u64, |
| 230 | pub disabledrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#disabled.: bool, |
| 231 | pub timerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#time.: Durationrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/Duration#, |
| 232 | #[cfg(feature = "gpu")] |
| 233 | pub gpu_mem_usagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#gpu_mem_usage.: MemUsagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#, |
| 234 | #[cfg(feature = "gpu")] |
| 235 | pub gpu_usagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#gpu_usage.: u32, |
| 236 | /// The process "type". Used to colour things. |
| 237 | #[cfg(target_os = "linux")] |
| 238 | pub process_typerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#process_type.: ProcessTyperust-analyzer cargo bottom 0.14.9 collection/processes/ProcessType#, |
| 239 | #[cfg(unix)] |
| 240 | pub nicerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#nice.: i32, |
| 241 | pub priorityrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#priority.: i32, |
| 242 | } |
| 243 | |
| 244 | impl ProcWidgetDatarust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData# { |
| 245 | pub fn from_datarust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[ProcWidgetData]from_data().(process: &ProcessHarvestrust-analyzer cargo bottom 0.14.9 collection/processes/ProcessHarvest#, is_command: bool, is_mem_percent: bool) -> Selfrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[ProcWidgetData] { |
| 246 | let id = Idrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/Id# { |
| 247 | id_typerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/Id#id_type.: if is_command { |
| 248 | IdTyperust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/IdType#::Commandrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/IdType#Command#(process.commandrust-analyzer cargo bottom 0.14.9 collection/processes/ProcessHarvest#command..clonerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][Clone]clone().()) |
| 249 | } else { |
| 250 | IdTyperust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/IdType#::Namerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/IdType#Name#(process.namerust-analyzer cargo bottom 0.14.9 collection/processes/ProcessHarvest#name..clonerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][Clone]clone().()) |
| 251 | }, |
| 252 | prefixrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/Id#prefix.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 253 | }; |
| 254 | |
| 255 | let mem_usage = if is_mem_percent { |
| 256 | MemUsagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#::Percentrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#Percent#(process.mem_usage_percentrust-analyzer cargo bottom 0.14.9 collection/processes/ProcessHarvest#mem_usage_percent.) |
| 257 | } else { |
| 258 | MemUsagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#::Bytesrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#Bytes#(process.mem_usagerust-analyzer cargo bottom 0.14.9 collection/processes/ProcessHarvest#mem_usage.) |
| 259 | }; |
| 260 | |
| 261 | Selfrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[ProcWidgetData] { |
| 262 | pidrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#pid.: process.pidrust-analyzer cargo bottom 0.14.9 collection/processes/ProcessHarvest#pid., |
| 263 | ppidrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#ppid.: process.parent_pidrust-analyzer cargo bottom 0.14.9 collection/processes/ProcessHarvest#parent_pid., |
| 264 | idrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#id., |
| 265 | cpu_usage_percentrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#cpu_usage_percent.: process.cpu_usage_percentrust-analyzer cargo bottom 0.14.9 collection/processes/ProcessHarvest#cpu_usage_percent., |
| 266 | mem_usagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#mem_usage., |
| 267 | virtual_memrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#virtual_mem.: process.virtual_memrust-analyzer cargo bottom 0.14.9 collection/processes/ProcessHarvest#virtual_mem., |
| 268 | rpsrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#rps.: process.read_per_secrust-analyzer cargo bottom 0.14.9 collection/processes/ProcessHarvest#read_per_sec., |
| 269 | wpsrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#wps.: process.write_per_secrust-analyzer cargo bottom 0.14.9 collection/processes/ProcessHarvest#write_per_sec., |
| 270 | total_readrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#total_read.: process.total_readrust-analyzer cargo bottom 0.14.9 collection/processes/ProcessHarvest#total_read., |
| 271 | total_writerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#total_write.: process.total_writerust-analyzer cargo bottom 0.14.9 collection/processes/ProcessHarvest#total_write., |
| 272 | process_staterust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#process_state.: process.process_staterust-analyzer cargo bottom 0.14.9 collection/processes/ProcessHarvest#process_state..0, |
| 273 | process_charrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#process_char.: process.process_staterust-analyzer cargo bottom 0.14.9 collection/processes/ProcessHarvest#process_state..1, |
| 274 | userrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#user.: process.userrust-analyzer cargo bottom 0.14.9 collection/processes/ProcessHarvest#user..clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][Clone]clone().(), |
| 275 | num_similarrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#num_similar.: 1, |
| 276 | disabledrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#disabled.: false, |
| 277 | timerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#time.: process.timerust-analyzer cargo bottom 0.14.9 collection/processes/ProcessHarvest#time., |
| 278 | #[cfg(feature = "gpu")] |
| 279 | gpu_mem_usagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#gpu_mem_usage.: if is_mem_percent { |
| 280 | MemUsagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#::Percentrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#Percent#(process.gpu_mem_percentrust-analyzer cargo bottom 0.14.9 collection/processes/ProcessHarvest#gpu_mem_percent.) |
| 281 | } else { |
| 282 | MemUsagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#::Bytesrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/MemUsage#Bytes#(process.gpu_memrust-analyzer cargo bottom 0.14.9 collection/processes/ProcessHarvest#gpu_mem.) |
| 283 | }, |
| 284 | #[cfg(feature = "gpu")] |
| 285 | gpu_usagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#gpu_usage.: process.gpu_utilrust-analyzer cargo bottom 0.14.9 collection/processes/ProcessHarvest#gpu_util., |
| 286 | #[cfg(target_os = "linux")] |
| 287 | process_typerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#process_type.: process.process_typerust-analyzer cargo bottom 0.14.9 collection/processes/ProcessHarvest#process_type., |
| 288 | #[cfg(unix)] |
| 289 | nicerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#nice.: process.nicerust-analyzer cargo bottom 0.14.9 collection/processes/ProcessHarvest#nice., |
| 290 | priorityrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#priority.: process.priorityrust-analyzer cargo bottom 0.14.9 collection/processes/ProcessHarvest#priority., |
| 291 | } |
| 292 | } |
| 293 | |
| 294 | pub fn disabledrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[ProcWidgetData]disabled().(mut self, disabled: bool) -> Selfrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[ProcWidgetData] { |
| 295 | self.disabledrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#disabled. = disabled; |
| 296 | self |
| 297 | } |
| 298 | |
| 299 | pub fn prefixrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[ProcWidgetData]prefix().(mut self, prefix: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>) -> Selfrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[ProcWidgetData] { |
| 300 | self.idrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#id..prefixrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/Id#prefix. = prefix; |
| 301 | self |
| 302 | } |
| 303 | |
| 304 | pub fn addrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[ProcWidgetData]add().(&mut self, other: &Selfrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[ProcWidgetData]) { |
| 305 | self.cpu_usage_percentrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#cpu_usage_percent. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`AddAssign<Self>`]add_assign().other.cpu_usage_percentrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#cpu_usage_percent.; |
| 306 | self.mem_usagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#mem_usage. = self.mem_usagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#mem_usage. rust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[MemUsage][`Add<Self>`]add().+rust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[MemUsage][`Add<Self>`]add(). rust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[MemUsage][`Add<Self>`]add().other.mem_usagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#mem_usage.; |
| 307 | self.rpsrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#rps. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`AddAssign<Self>`]add_assign().other.rpsrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#rps.; |
| 308 | self.wpsrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#wps. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`AddAssign<Self>`]add_assign().other.wpsrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#wps.; |
| 309 | self.total_readrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#total_read. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`AddAssign<Self>`]add_assign().other.total_readrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#total_read.; |
| 310 | self.total_writerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#total_write. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`AddAssign<Self>`]add_assign().other.total_writerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#total_write.; |
| 311 | self.timerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#time. = self.timerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#time..maxrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ord#max().(other.timerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#time.); |
| 312 | #[cfg(feature = "gpu")] |
| 313 | { |
| 314 | self.gpu_mem_usagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#gpu_mem_usage. = self.gpu_mem_usagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#gpu_mem_usage. rust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[MemUsage][`Add<Self>`]add().+rust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[MemUsage][`Add<Self>`]add(). rust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[MemUsage][`Add<Self>`]add().other.gpu_mem_usagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#gpu_mem_usage.; |
| 315 | self.gpu_usagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#gpu_usage. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`AddAssign<Self>`]add_assign().other.gpu_usagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#gpu_usage.; |
| 316 | } |
| 317 | } |
| 318 | |
| 319 | fn to_stringrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[ProcWidgetData]to_string().(&self, column: &ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#) -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# { |
| 320 | match column { |
| 321 | &ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::Priorityrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#Priority# => self.priorityrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#priority..to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 322 | #[cfg(unix)] |
| 323 | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::Nicerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#Nice# => self.nicerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#nice..to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 324 | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::CpuPercentrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#CpuPercent# => formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{:.1}%", self.cpu_usage_percentrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#cpu_usage_percent.), |
| 325 | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::MemValuerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#MemValue# | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::MemPercentrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#MemPercent# => self.mem_usagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#mem_usage..to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 326 | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::VirtualMemrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#VirtualMem# => binary_byte_stringrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/binary_byte_string().(self.virtual_memrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#virtual_mem.), |
| 327 | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::Pidrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#Pid# => self.pidrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#pid..to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 328 | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::Countrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#Count# => self.num_similarrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#num_similar..to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 329 | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::Namerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#Name# | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::Commandrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#Command# => self.idrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#id..to_prefixed_stringrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[Id]to_prefixed_string().(), |
| 330 | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::ReadPerSecondrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#ReadPerSecond# => dec_bytes_per_second_stringrust-analyzer cargo bottom 0.14.9 utils/conversion/dec_bytes_per_second_string().(self.rpsrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#rps.), |
| 331 | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::WritePerSecondrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#WritePerSecond# => dec_bytes_per_second_stringrust-analyzer cargo bottom 0.14.9 utils/conversion/dec_bytes_per_second_string().(self.wpsrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#wps.), |
| 332 | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::TotalReadrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#TotalRead# => dec_bytes_stringrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/dec_bytes_string().(self.total_readrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#total_read.), |
| 333 | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::TotalWriterust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#TotalWrite# => dec_bytes_stringrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/dec_bytes_string().(self.total_writerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#total_write.), |
| 334 | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::Staterust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#State# => self.process_charrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#process_char..to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 335 | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::Userrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#User# => self |
| 336 | .userrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#user. |
| 337 | .as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]as_ref().() |
| 338 | .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map().(|user| user.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()) |
| 339 | .unwrap_or_elserust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap_or_else().(|| "N/A".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()), |
| 340 | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::Timerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#Time# => format_timerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/format_time().(self.timerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#time.), |
| 341 | #[cfg(feature = "gpu")] |
| 342 | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::GpuMemValuerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#GpuMemValue# | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::GpuMemPercentrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#GpuMemPercent# => self.gpu_mem_usagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#gpu_mem_usage..to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 343 | #[cfg(feature = "gpu")] |
| 344 | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::GpuUtilPercentrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#GpuUtilPercent# => formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{:.1}%", self.gpu_usagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#gpu_usage.), |
| 345 | } |
| 346 | } |
| 347 | } |
| 348 | |
| 349 | impl DataToCellrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/data_type/DataToCell#<ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#> for ProcWidgetDatarust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData# { |
| 350 | fn to_cell_textrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[ProcWidgetData][`DataToCell<ProcColumn>`]to_cell_text().( |
| 351 | &self, column: &ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#, calculated_width: NonZeroU16rust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/NonZeroU16#, |
| 352 | ) -> 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>> { |
| 353 | // TODO: Optimize the string allocations here... |
| 354 | // TODO: Also maybe just pull in the to_string call but add a variable for the |
| 355 | // differences. |
| 356 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(match column { |
| 357 | #[cfg(unix)] |
| 358 | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::Nicerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#Nice# => self.nicerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#nice..to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().().intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |
| 359 | &ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::Priorityrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#Priority# => self.priorityrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#priority..to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().().intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |
| 360 | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::CpuPercentrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#CpuPercent# => formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{:.1}%", self.cpu_usage_percentrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#cpu_usage_percent.).intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |
| 361 | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::MemValuerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#MemValue# | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::MemPercentrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#MemPercent# => self.mem_usagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#mem_usage..to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().().intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |
| 362 | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::VirtualMemrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#VirtualMem# => binary_byte_stringrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/binary_byte_string().(self.virtual_memrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#virtual_mem.).intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |
| 363 | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::Pidrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#Pid# => self.pidrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#pid..to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().().intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |
| 364 | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::Countrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#Count# => self.num_similarrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#num_similar..to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().().intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |
| 365 | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::Namerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#Name# | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::Commandrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#Command# => self.idrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#id..to_prefixed_stringrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[Id]to_prefixed_string().().intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |
| 366 | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::ReadPerSecondrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#ReadPerSecond# => dec_bytes_per_second_stringrust-analyzer cargo bottom 0.14.9 utils/conversion/dec_bytes_per_second_string().(self.rpsrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#rps.).intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |
| 367 | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::WritePerSecondrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#WritePerSecond# => dec_bytes_per_second_stringrust-analyzer cargo bottom 0.14.9 utils/conversion/dec_bytes_per_second_string().(self.wpsrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#wps.).intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |
| 368 | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::TotalReadrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#TotalRead# => dec_bytes_stringrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/dec_bytes_string().(self.total_readrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#total_read.).intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |
| 369 | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::TotalWriterust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#TotalWrite# => dec_bytes_stringrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/dec_bytes_string().(self.total_writerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#total_write.).intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |
| 370 | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::Staterust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#State# => { |
| 371 | if calculated_width.getrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/impl#[`NonZero<T>`]get().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialOrd<Self>`]lt().8 { |
| 372 | self.process_charrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#process_char..to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().().intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().() |
| 373 | } else { |
| 374 | self.process_staterust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#process_state..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().() |
| 375 | } |
| 376 | } |
| 377 | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::Userrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#User# => self |
| 378 | .userrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#user. |
| 379 | .as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]as_ref().() |
| 380 | .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map().(|user| user.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().().intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()) |
| 381 | .unwrap_or_elserust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap_or_else().(|| "N/A".intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()), |
| 382 | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::Timerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#Time# => format_timerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/format_time().(self.timerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#time.).intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |
| 383 | #[cfg(feature = "gpu")] |
| 384 | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::GpuMemValuerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#GpuMemValue# | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::GpuMemPercentrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#GpuMemPercent# => { |
| 385 | self.gpu_mem_usagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#gpu_mem_usage..to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().().intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().() |
| 386 | } |
| 387 | #[cfg(feature = "gpu")] |
| 388 | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::GpuUtilPercentrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#GpuUtilPercent# => formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{:.1}%", self.gpu_usagerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#gpu_usage.).intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |
| 389 | }) |
| 390 | } |
| 391 | |
| 392 | #[cfg(target_os = "linux")] |
| 393 | #[inline(always)] |
| 394 | fn style_cellrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[ProcWidgetData][`DataToCell<ProcColumn>`]style_cell().(&self, column: &ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#, painter: &Painterrust-analyzer cargo bottom 0.14.9 canvas/Painter#) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<ratatuirust-analyzer cargo ratatui 0.30.2 crate/::stylerust-analyzer cargo ratatui-core 0.1.2 style/::Stylerust-analyzer cargo ratatui-core 0.1.2 style/Style#> { |
| 395 | match column { |
| 396 | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::Namerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#Name# | ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#::Commandrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#Command# if self.process_typerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#process_type..is_threadrust-analyzer cargo bottom 0.14.9 collection/processes/impl#[ProcessType]is_thread().() => { |
| 397 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(painter.stylesrust-analyzer cargo bottom 0.14.9 canvas/Painter#styles..thread_text_stylerust-analyzer cargo bottom 0.14.9 options/config/style/Styles#thread_text_style.) |
| 398 | } |
| 399 | _ => Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 400 | } |
| 401 | } |
| 402 | |
| 403 | #[inline(always)] |
| 404 | fn style_rowrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[ProcWidgetData][`DataToCell<ProcColumn>`]style_row().<'a>(&self, row: Rowrust-analyzer cargo ratatui-widgets 0.3.2 table/row/Row#<'a>, painter: &Painterrust-analyzer cargo bottom 0.14.9 canvas/Painter#) -> Rowrust-analyzer cargo ratatui-widgets 0.3.2 table/row/Row#<'a> { |
| 405 | if self.disabledrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/ProcWidgetData#disabled. { |
| 406 | row.stylerust-analyzer cargo ratatui-widgets 0.3.2 table/row/impl#[`Row<'a>`]style().(painter.stylesrust-analyzer cargo bottom 0.14.9 canvas/Painter#styles..disabled_text_stylerust-analyzer cargo bottom 0.14.9 options/config/style/Styles#disabled_text_style.) |
| 407 | } else { |
| 408 | row |
| 409 | } |
| 410 | } |
| 411 | |
| 412 | fn column_widthsrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[ProcWidgetData][`DataToCell<ProcColumn>`]column_widths().<C: DataTableColumnrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/column/DataTableColumn#<ProcColumnrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_columns/ProcColumn#>>(data: &[Selfrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[ProcWidgetData][`DataToCell<ProcColumn>`]], columns: &[C]) -> Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u16> |
| 413 | where |
| 414 | Selfrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[ProcWidgetData][`DataToCell<ProcColumn>`]: Sizedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sized#, |
| 415 | { |
| 416 | let mut widths = vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![0; columns.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().()]; |
| 417 | |
| 418 | for d in data { |
| 419 | for (w, c) in widths.iter_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter_mut().().ziprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#zip().(columns) { |
| 420 | *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().w = maxrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/max().(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().w, d.to_stringrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/impl#[ProcWidgetData]to_string().(c.innerrust-analyzer cargo bottom 0.14.9 canvas/components/data_table/column/DataTableColumn#inner().()).lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]len().() as u16); |
| 421 | } |
| 422 | } |
| 423 | |
| 424 | widths |
| 425 | } |
| 426 | } |
| 427 | |
| 428 | #[cfg(test)] |
| 429 | mod testrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/test/ { |
| 430 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::timerust-analyzer cargo std https://github.com/rust-lang/rust/library/std time/::Durationrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/Duration#; |
| 431 | |
| 432 | use superrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/::*; |
| 433 | use craterust-analyzer cargo bottom 0.14.9 crate/::utilsrust-analyzer cargo bottom 0.14.9 utils/::data_unitsrust-analyzer cargo bottom 0.14.9 utils/data_units/::*; |
| 434 | |
| 435 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 436 | fn test_format_timerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/test/test_format_time().() { |
| 437 | const ONE_DAYrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/test/ONE_DAY.: u64 = 24 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Mul<Self>`]mul().60 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Mul<Self>`]mul().60; |
| 438 | |
| 439 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(format_timerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/format_time().(Durationrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/Duration#::from_millisrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]from_millis().(500)), "0.500s"); |
| 440 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(format_timerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/format_time().(Durationrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/Duration#::from_millisrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]from_millis().(900)), "0.900s"); |
| 441 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(format_timerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/format_time().(Durationrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/Duration#::from_secsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]from_secs().(1)), "1.000s"); |
| 442 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(format_timerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/format_time().(Durationrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/Duration#::from_secsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]from_secs().(10)), "10.000s"); |
| 443 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(format_timerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/format_time().(Durationrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/Duration#::from_secsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]from_secs().(60)), "1m 0.00s"); |
| 444 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(format_timerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/format_time().(Durationrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/Duration#::from_secsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]from_secs().(61)), "1m 1.00s"); |
| 445 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(format_timerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/format_time().(Durationrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/Duration#::from_secsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]from_secs().(600)), "10m 0.00s"); |
| 446 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(format_timerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/format_time().(Durationrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/Duration#::from_secsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]from_secs().(601)), "10m 1.00s"); |
| 447 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(format_timerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/format_time().(Durationrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/Duration#::from_secsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]from_secs().(3600)), "1h 0m 0s"); |
| 448 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(format_timerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/format_time().(Durationrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/Duration#::from_secsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]from_secs().(3601)), "1h 0m 1s"); |
| 449 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(format_timerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/format_time().(Durationrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/Duration#::from_secsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]from_secs().(3660)), "1h 1m 0s"); |
| 450 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(format_timerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/format_time().(Durationrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/Duration#::from_secsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]from_secs().(3661)), "1h 1m 1s"); |
| 451 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(format_timerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/format_time().(Durationrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/Duration#::from_secsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]from_secs().(ONE_DAYrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/test/ONE_DAY. -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Sub<Self>`]sub(). 1)), "23h 59m 59s"); |
| 452 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(format_timerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/format_time().(Durationrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/Duration#::from_secsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]from_secs().(ONE_DAYrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/test/ONE_DAY.)), "1d 0h 0m"); |
| 453 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(format_timerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/format_time().(Durationrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/Duration#::from_secsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]from_secs().(ONE_DAYrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/test/ONE_DAY. +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Add<Self>`]add(). 1)), "1d 0h 0m"); |
| 454 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(format_timerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/format_time().(Durationrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/Duration#::from_secsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]from_secs().(ONE_DAYrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/test/ONE_DAY. +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Add<Self>`]add(). 60)), "1d 0h 1m"); |
| 455 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 456 | format_timerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/format_time().(Durationrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/Duration#::from_secsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]from_secs().(ONE_DAYrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/test/ONE_DAY. +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Add<Self>`]add(). 3600 -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Sub<Self>`]sub(). 1)), |
| 457 | "1d 0h 59m" |
| 458 | ); |
| 459 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(format_timerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/format_time().(Durationrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/Duration#::from_secsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]from_secs().(ONE_DAYrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/test/ONE_DAY. +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Add<Self>`]add(). 3600)), "1d 1h 0m"); |
| 460 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 461 | format_timerust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/format_time().(Durationrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/Duration#::from_secsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core time/impl#[Duration]from_secs().(ONE_DAYrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/test/ONE_DAY. *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Mul<Self>`]mul(). 365 -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Sub<Self>`]sub(). 1)), |
| 462 | "364d 23h 59m" |
| 463 | ); |
| 464 | } |
| 465 | |
| 466 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 467 | fn test_binary_byte_stringrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/test/test_binary_byte_string().() { |
| 468 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(binary_byte_stringrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/binary_byte_string().(0), "0B".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()); |
| 469 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(binary_byte_stringrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/binary_byte_string().(1), "1B".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()); |
| 470 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(binary_byte_stringrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/binary_byte_string().(1000), "1000B".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()); |
| 471 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(binary_byte_stringrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/binary_byte_string().(1023), "1023B".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()); |
| 472 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(binary_byte_stringrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/binary_byte_string().(KIBI_LIMITrust-analyzer cargo bottom 0.14.9 utils/data_units/KIBI_LIMIT.), "1KiB".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()); |
| 473 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(binary_byte_stringrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/binary_byte_string().(KIBI_LIMITrust-analyzer cargo bottom 0.14.9 utils/data_units/KIBI_LIMIT. +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Add<Self>`]add(). 1), "1KiB".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()); |
| 474 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(binary_byte_stringrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/binary_byte_string().(MEBI_LIMITrust-analyzer cargo bottom 0.14.9 utils/data_units/MEBI_LIMIT.), "1MiB".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()); |
| 475 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(binary_byte_stringrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/binary_byte_string().(GIBI_LIMITrust-analyzer cargo bottom 0.14.9 utils/data_units/GIBI_LIMIT.), "1.0GiB".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()); |
| 476 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(binary_byte_stringrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/binary_byte_string().(2 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Mul<Self>`]mul(). GIBI_LIMITrust-analyzer cargo bottom 0.14.9 utils/data_units/GIBI_LIMIT.), "2.0GiB".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()); |
| 477 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 478 | binary_byte_stringrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/binary_byte_string().((2.5 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul(). GIBI_LIMITrust-analyzer cargo bottom 0.14.9 utils/data_units/GIBI_LIMIT. as f64) as u64), |
| 479 | "2.5GiB".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().() |
| 480 | ); |
| 481 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 482 | binary_byte_stringrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/binary_byte_string().((10.34 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul(). TEBI_LIMITrust-analyzer cargo bottom 0.14.9 utils/data_units/TEBI_LIMIT. as f64) as u64), |
| 483 | "10.3TiB".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().() |
| 484 | ); |
| 485 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 486 | binary_byte_stringrust-analyzer cargo bottom 0.14.9 widgets/process_table/process_data/binary_byte_string().((10.36 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul(). TEBI_LIMITrust-analyzer cargo bottom 0.14.9 utils/data_units/TEBI_LIMIT. as f64) as u64), |
| 487 | "10.4TiB".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().() |
| 488 | ); |
| 489 | } |
| 490 | } |