MemorySize Type
This crate provides the MemorySize
data type as a size unit. This might help errors during conversion between different
units as well as comfort for printing the managed size as a human-readable value.
Usage
To use this library, you just have to add the following lines into your projects Cargo.toml
:
[]
= "0.5.0"
= false
= ["std"]
Features
The crate is seperated into several features to reduce its size (even with this small crate). You can use the following features to enable the stuff you really need in your project:
Feature | Description |
---|---|
std | Include features like implementations for std::fmt::Debug and std::fmt::Display |
deprecated | Include the deprecated features like the MemorySize type. |
Examples
There are different use-cases for this library. The following examples represent just some possible usages.
Creating an instance from raw byte information
use Byte;
let size_info_byte = from;
Calculating with memory sizes
use Byte;
let some_bytes = from;
let some_more_bytes = from;
assert_eq!;