Skip to content

Commit

Permalink
Document that page cound cannot be higher than u16::MAX
Browse files Browse the repository at this point in the history
  • Loading branch information
avsaase committed Jul 19, 2024
1 parent 571a9c8 commit bd31e92
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ pub const PAGE_SIZE: usize = raw::PAGE_SIZE;
/// This value is just a compile-time upper limit, used to size some in-memory and on-disk data
/// structures. This allows supporting different memory sizes with the same binary.
///
/// The [`PageID`](crate::types::PageID) is backed by a `u16` so the maximum page count is 65535.
///
/// Default: 256
pub const MAX_PAGE_COUNT: usize = raw::MAX_PAGE_COUNT;

Expand Down
2 changes: 2 additions & 0 deletions src/flash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ pub trait Flash {
type Error: Debug;

/// Get the page count of the flash storage.
///
/// The [`PageID`](crate::types::PageID) is backed by a `u16` so the maximum page count is 65535.
fn page_count(&self) -> usize;

/// Erase a page.
Expand Down

0 comments on commit bd31e92

Please sign in to comment.