# [−] [src] Trait memory_units::RoundUpTo

    pub trait RoundUpTo<T> {
        fn round_up_to(self) -> T;
    }

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

### `fn round_up_to(self) -> T`

Returns minimum number of `T` to fit amount of space occupied by `self`.

Loading content...

## Implementors

### `impl<T: Into<Bytes>> RoundUpTo<Bytes> for T` [src]

#### `fn round_up_to(self) -> Bytes` [src]

### `impl<T: Into<Bytes>> RoundUpTo<Pages> for T` [src]

#### `fn round_up_to(self) -> Pages` [src]

### `impl<T: Into<Bytes>> RoundUpTo<Words> for T` [src]

#### `fn round_up_to(self) -> Words` [src]

### `impl<T: Into<Bytes>> RoundUpTo<Pages> for T` [src]

#### `fn round_up_to(self) -> Pages` [src]

### `impl<T: Into<Bytes>> RoundUpTo<Words> for T` [src]

#### `fn round_up_to(self) -> Words` [src]

Loading content...

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g., `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g., `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g., `str,u8` or `String,struct:Vec,test`)