MCPcopy Index your code
hub / github.com/bytesize-rs/bytesize / factor

Method factor

src/parse.rs:119–137  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

117
118impl Unit {
119 fn factor(&self) -> u64 {
120 match self {
121 Self::Byte => 1,
122 // decimal units
123 Self::KiloByte => crate::KB,
124 Self::MegaByte => crate::MB,
125 Self::GigaByte => crate::GB,
126 Self::TeraByte => crate::TB,
127 Self::PetaByte => crate::PB,
128 Self::ExaByte => crate::EB,
129 // binary units
130 Self::KibiByte => crate::KIB,
131 Self::MebiByte => crate::MIB,
132 Self::GibiByte => crate::GIB,
133 Self::TebiByte => crate::TIB,
134 Self::PebiByte => crate::PIB,
135 Self::ExbiByte => crate::EIB,
136 }
137 }
138}
139
140mod impl_ops {

Callers 3

from_strMethod · 0.80
addMethod · 0.80
mulMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected