Skip to content

Commit

Permalink
Add a SessionReport::result() helper method
Browse files Browse the repository at this point in the history
  • Loading branch information
fjarri committed Nov 13, 2024
1 parent f7ac30f commit a027271
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions manul/src/session/transcript.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,12 @@ where
missing_messages: transcript.missing_messages,
}
}

/// Returns the protocol result if the session outcome contains it, otherwise `None`.
pub fn result(self) -> Option<P::Result> {
match self.outcome {
SessionOutcome::Result(result) => Some(result),
_ => None,
}
}
}

0 comments on commit a027271

Please sign in to comment.