Add optional chunk reader interface to generate_manifest_rusty#2
Add optional chunk reader interface to generate_manifest_rusty#2quexeky wants to merge 13 commits into
Conversation
Still doesn't run log_sfn or progress_sfn, but most functionality is implemented
Signed-off-by: quexeky <git@quexeky.dev>
Signed-off-by: quexeky <git@quexeky.dev>
Signed-off-by: quexeky <git@quexeky.dev>
DecDuck
left a comment
There was a problem hiding this comment.
Is the generate_manifest function just completely copy and pasted?
|
The existing generate_manifest function should be identical, yeah. I decided that it's probably better to just not touch it for compatibility reasons |
|
It's fine, you can replace it. Compatibility can just be based on version. |
|
Aight cheers - I'll do that in a moment then |
…go clippy Signed-off-by: quexeky <git@quexeky.dev>
Signed-off-by: quexeky <git@quexeky.dev>
|
I think that that should be everything now |
… of buffered futures Signed-off-by: quexeky <git@quexeky.dev>
Signed-off-by: quexeky <git@quexeky.dev>
Signed-off-by: quexeky <git@quexeky.dev>
Signed-off-by: quexeky <git@quexeky.dev>
| pub async fn generate_manifest_rusty<P, LogFn, ProgFn, FactoryFn, Writer, CloseFn>( | ||
| dir: P, | ||
| progress_sfn: ProgFn, | ||
| log_sfn: LogFn, | ||
| factory: FactoryFn, | ||
| closer: CloseFn, | ||
| semaphore: Option<&Semaphore>, | ||
| ) -> anyhow::Result<Manifest> | ||
| where | ||
| P: AsRef<Path>, | ||
| LogFn: Fn(String) + Clone, | ||
| ProgFn: Fn(f32), | ||
| Writer: AsyncWrite + Unpin, | ||
| FactoryFn: AsyncFn(String) -> Writer + Clone, | ||
| CloseFn: AsyncFn(Writer) + Clone, | ||
| { |
There was a problem hiding this comment.
This signature is too complicated, you need to simplify it.
It should be easy and quickly parseable without additional complexity.
There was a problem hiding this comment.
Which bits would you have me simplify? Because to be entirely honest, I'm not sure how much simpler this can be made
There was a problem hiding this comment.
A lot of the generics can be inline to function arguments.
What's the factory pattern for?
And I'm pretty sure you can call close on a writer, maybe handle the close there?
Signed-off-by: quexeky <git@quexeky.dev>
Signed-off-by: quexeky <git@quexeky.dev>
Adds additional writers for downpour