Created
October 4, 2022 09:54
-
-
Save berkes/69d1b785d2e98ea05c912fd0e51ce8cb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
impl PageSize { | |
pub fn new_from_kilobytes(value: usize) -> Result<Self, DomainError> { | |
Ok(Self { value }) | |
} | |
pub fn as_bytes(&self) -> usize { | |
&self.value / 1_000 | |
} | |
pub fn as_kilobytes(&self) -> usize { | |
self.value | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment