Trait wasmi::memory_units::RoundUpTo [−][src]
A trait defining round up conversion between various memory units.
Example
// `bytes` contains the size of 1 memory page in bytes. let mut bytes: Bytes = Pages(1).into(); // Adding 1 to `bytes` makes it larger than the single page. bytes.0 += 1; let pages: Pages = bytes.round_up_to(); assert_eq!(pages, Pages(2));
Required methods
pub fn round_up_to(self) -> T
[src]
Returns minimum number of T
to fit amount of space occupied by self
.
Implementors
impl<T> RoundUpTo<Pages> for T where
T: Into<Bytes>,
[src]
T: Into<Bytes>,
pub fn round_up_to(self) -> Pages
[src]
impl<T> RoundUpTo<Words> for T where
T: Into<Bytes>,
[src]
T: Into<Bytes>,
pub fn round_up_to(self) -> Words
[src]
impl<T> RoundUpTo<Bytes> for T where
T: Into<Bytes>,
[src]
T: Into<Bytes>,
pub fn round_up_to(self) -> Bytes
[src]
impl<T> RoundUpTo<Pages> for T where
T: Into<Bytes>,
[src]
T: Into<Bytes>,
pub fn round_up_to(self) -> Pages
[src]
impl<T> RoundUpTo<Words> for T where
T: Into<Bytes>,
[src]
T: Into<Bytes>,