Skip to content

Commit

Permalink
docs(error): Document trait assumptions
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Jan 29, 2025
1 parent ee423c3 commit 3ff1dbe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,12 +403,17 @@ pub trait ParserError<I: Stream>: Sized {
fn into_inner(self) -> Result<Self::Inner, Self>;

/// Is more data [`Needed`]
///
/// This must be the same as [`err.needed().is_some()`][ParserError::needed]
#[inline(always)]
fn is_incomplete(&self) -> bool {
false
}

/// Extract the [`Needed`] data, if present
///
/// `Self::needed().is_some()` must be the same as
/// [`err.is_incomplete()`][ParserError::is_incomplete]
#[inline(always)]
fn needed(&self) -> Option<Needed> {
None
Expand Down

0 comments on commit 3ff1dbe

Please sign in to comment.