✨ commands: Add Write#39
Draft
chrysn wants to merge 1 commit into
Draft
Conversation
Teufelchen1
reviewed
Oct 6, 2025
|
|
||
| use super::Command; | ||
| use super::CommandHandler; | ||
| // use super::CommandRegistry; // Look moo no handler! |
Owner
There was a problem hiding this comment.
Yes, I took that thought and run with it. Removed in 0bdde23
Teufelchen1
reviewed
Oct 6, 2025
| MultiEndpointSample::cmd(), | ||
| MemRead::cmd(), | ||
| Ps::cmd(), | ||
| write::cmd(), |
Owner
There was a problem hiding this comment.
Initially, I did not like it this way but now after some time has passed, I believe this is the better way to do it. Less confusing, less mixing of things that don't really belong together.
Teufelchen1
reviewed
Oct 6, 2025
| struct WriteCommand { | ||
| path: String, | ||
| value: Vec<u8>, | ||
| // We only get &self in display but the error comes up in handle where we can't print; shoving |
Owner
There was a problem hiding this comment.
Would you prefer fn handle(&mut self, ..) -> Result<Option<CoapRequest<String>>, (error-)String>?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a first sketch of a PUTting write command.
Quoting the module docs:
Open issues:
prefer resources that are annotated to be writable … oh, core-interfaces is still stalled)