Skip to content
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

Why does WireTx require send_log_{str,fmt}? #61

Open
hvraven opened this issue Nov 26, 2024 · 1 comment
Open

Why does WireTx require send_log_{str,fmt}? #61

hvraven opened this issue Nov 26, 2024 · 1 comment

Comments

@hvraven
Copy link
Contributor

hvraven commented Nov 26, 2024

I am currently working on a custom wire implementation for a project and ran into the logging functions required by the WireTx trait. These are annoying to implement, and not needed in every project. I think they shouldn't be on this code level and would expect logging functionality to be implemented on top of the WireTx trait.

Is there a specific reason why these are required in WireTx? If not I will try to make a proper patch to remove them from the trait.

@jamesmunns
Copy link
Owner

I am open to ideas on how they could be implemented on top of the wire trait, but they are difficult to implement without either:

  • exposing the temporary buffer for usage (which might also require exposing the underlying locking mechanism)
  • requiring alloc
  • Using another temporary buffer just for formatting

So, I'm in the awkward position where:

  • Punching through the abstraction is desirable for efficiency reasons
  • It's an additional burden on wire implementors

that being said - postcard-rpc itself never uses these endpoints, if you don't need them in your application, you could return an error (or panic) if they are called. We could also add a default impl that does that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants