Skip to content

Commit 2e5f100

Browse files
committed
Updating constructor docs
1 parent a815986 commit 2e5f100

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/lib.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,13 @@ where
250250
T: embedded_io::Write + embedded_io::Read + embedded_io::ReadReady,
251251
{
252252
/// Create a new `Runner`. You need to supply a top-level menu, and a
253-
/// buffer that the `Runner` can use. Feel free to pass anything as the
254-
/// `context` type - the only requirement is that the `Runner` can
255-
/// `write!` to the context, which it will do for all text output.
253+
/// buffer that the `Runner` can use.
254+
///
255+
/// The `context` parameter is used for handling I/O of the menu. It must implement the
256+
/// respective [`embedded-io`] traits to enable the menu to process input and output.
257+
///
258+
/// The `context` is also passed to menu callback functions, so it can be used for maintaining
259+
/// state of anything that the menu may control as well.
256260
pub fn new(menu: Menu<'a, T>, buffer: &'a mut [u8], context: &mut T) -> Self {
257261
if let Some(cb_fn) = menu.entry {
258262
cb_fn(&menu, context);

0 commit comments

Comments
 (0)