feat(core): Expose Reader::into_stream and Writer::into_sink#5698
feat(core): Expose Reader::into_stream and Writer::into_sink#5698
Conversation
Signed-off-by: Xuanwo <[email protected]>
core/src/types/read/buffer_stream.rs
Outdated
| state: State, | ||
| } | ||
|
|
||
| /// # Notes |
There was a problem hiding this comment.
This comment would now go to State's? Looks weird.
There was a problem hiding this comment.
This comment would now go to
State's? Looks weird.
Yep, I don't want users (from public API) to read this.
There was a problem hiding this comment.
But it's not for State? Maybe // on BufferStream.
There was a problem hiding this comment.
I moved to inner of BufferStream, PTAL.
Signed-off-by: Xuanwo <[email protected]>
|
@Xuanwo so now with this API in place if i want to copy a file from local fs to s3 in near zero copy manner, how will a sample code look? because using |
Hi, we can use let mut osink = op.writer(path).await?.into_sink();
let mut ostream = op.reader(path).await?.into_stream(..).await?;
osink.send_all(&mut ostream).await?;
osink.close().await?; |
|
@Xuanwo BufferStream is still not completely public, probably needs to be added to exports.
|
Which issue does this PR close?
Closes #4592
Rationale for this change
This PR will expose
into_streamandinto_sinkAPI for users allowing them to fetch or sink fixed size buffer inside.What changes are included in this PR?
Expose new APIs and add docs.
Are there any user-facing changes?
Expose new APIs.