-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add streaming API #2
Conversation
This makes me realise that the approach of having multiple extensions implemented in one backend is a bit complex on the side of the dispatcher, because there are multiple implementation of the same methods where just the trait changes, so the compiler can't infer which actual implementation to use. This leads to code like <StagingBackend as ExtensionImpl<ChunkedExtension>>::extension_request_serialized(
&mut self.backend,
&mut ctx.core,
&mut ctx.backends,
request,
resources,
) It's also a semver hazard as |
Maybe we should add a dummy extension that is always enabled. That way it forces everyone to use the fully qualified path instead of relying on type inference when only one extension is enabled. |
Also, we will probably have the same issue as with trussed-auth where a breaking change in the backend requires us to bump the dependency version for the clients that only use the extension. What do you think about having the extensions as separate crates within this repository, e. g. |
I see the point regarding breaking changes and semver,but I don't see how this would fix the naming when implementing dispatch |
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.
Looks good! Maybe I missed it but helper functions that take a &[u8]
or return a Bytes<N>
and implement the chunking would also be useful.
There is the What I think we may want to do some function that reads a file and insert it to a In opcard and PIV we have a Maybe we could have something like |
Also there are many cases where we want to have the length of the file before we begin writing stuff to the output. This is for example the case when dealing with TLV data. |
I think an |
No description provided.