Repository navigation
Correct more doc comments that describe earlier code #81
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
Changes from all commits
03777f8
cebe428
d19edf5
cb01bf6
34eb9f9
73f8c66
1c3c9cc
df728ea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -9,6 +9,10 @@ | |||||||||||
| //! A tool whose call is open asks the caller for each file operation it | ||||||||||||
| //! needs, and the caller reports the request with [`Run::request_file`], | ||||||||||||
| //! so the run issues that operation as an effect too. | ||||||||||||
| //! A [`Step::Pending`] with no effects and `waiting_for_input` set means only | ||||||||||||
| //! [`Run::deliver`] or a cancel can move the run: the main chain is waiting on | ||||||||||||
| //! a `tasks.receive()`. Every other pending step returns the effects the run | ||||||||||||
| //! waits on. | ||||||||||||
|
Comment on lines
+14
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Describe returned effects as newly issued, not as all awaited effects.
Suggested doc fix
Committable suggestion
|
||||||||||||
| //! The run ends at [`Step::Done`] with its result: the final text, or the | ||||||||||||
| //! [`Error`] that ended it. A cancel is the error whose code | ||||||||||||
| //! is [`ErrorCode::Canceled`]. | ||||||||||||
|
|
@@ -22,7 +26,8 @@ | |||||||||||
| //! [`RequirementsUnmet`](ErrorCode::RequirementsUnmet) failure that names | ||||||||||||
| //! every gap. | ||||||||||||
| //! | ||||||||||||
| //! The crate's `greeter` example is that whole loop in one program. | ||||||||||||
| //! The crate's `greeter` example is the loop for a prompt that never waits on | ||||||||||||
| //! a message, so it takes no `waiting_for_input` arm. | ||||||||||||
|
|
||||||||||||
| pub use runvil_prompt::Prompt; | ||||||||||||
| pub use runvil_prompt::PromptFinder; | ||||||||||||
|
|
||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,8 +40,12 @@ pub fn phrase(code: ErrorCode) -> &'static str { | |
| } | ||
|
|
||
| /// Builds the failure of a model round or a catalog fetch, with `message` as | ||
| /// both its message and its prose. `code` is one of the model codes, and | ||
| /// `message` is its phrase, extended as the module page says. | ||
| /// both its message and its prose. | ||
| /// | ||
| /// `code` is one of the model codes. The prose a model reads is the code's own | ||
| /// phrase from [`ErrorCode::prose`], extended with `message` when the failure | ||
| /// carries a specific fact, such as the provider's text or the field that was | ||
| /// refused. | ||
|
Comment on lines
+45
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Describe the prose that the helper actually returns. If a caller passes
|
||
| #[must_use] | ||
| pub fn make_completion_error(code: ErrorCode, message: impl Into<String>) -> Error { | ||
| let message = message.into(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name answers to outstanding effects as a way to advance a waiting run.
The note at lines 12-13 states that only
Run::deliveror a cancel can move a run whose pending step has no effects and setswaiting_for_input. This is incomplete.waiting_for_inputdepends only on the main chain's inbox. It does not depend on effects that earlier steps issued. A spawned task can still await one of those effects. Answering that effect throughRun::resumereadies the task, and the run advances.A caller that follows the note literally, and stops answering outstanding effects while it waits for input, stalls the run. Revise the note so it states that
Run::resumewith an answer to an outstanding effect also moves the run. Also state that a caller must answer every effect it was handed, including while it waits for input.