Skip to content

Clarify that AlignedCursor is about padding #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions epserde/src/utils/aligned_cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ use mem_dbg::{MemDbg, MemSize};
/// An aligned version of [`Cursor`](std::io::Cursor).
///
/// The standard library implementation of a [cursor](std::io::Cursor) is not
/// aligned, and thus cannot be used to create examples or unit tests for
/// ε-serde. This version has a [settable alignment](maligned::Alignment) that
/// is guaranteed to be respected by the underlying storage.
/// aligned, meaning that its length is exactly the number of bytes written.
/// Thus cannot be used to create examples or unit tests for ε-serde.
/// This version has a [settable alignment](maligned::Alignment) that
/// is guaranteed to be respected by the underlying storage, by adding padding
/// bytes at the end of the underlying vector.
///
/// Note that length and position are stored as `usize` values, so the maximum
/// length and position are `usize::MAX`. This is different from
Expand Down