Skip to content

Writer should accept Buffer #4465

Closed

Description

@Xuanwo

Write API Design

We want to implement the follwing APIs upon Writer:

The name is still being decided, but the semantics should be fine as they are.

In general, we will provide three kinds of API:

  • Buffer native (the best performance API without extra copy): write and into_sink
  • Bytes based: write_from and into_bytes_sink
  • Async Write based: into_futures_async_write

Activity

  1. zjregee commented on Apr 12, 2024

    @zjregee
    Member

    Can I try some of them like write and write_from?

  2. Xuanwo commented on Apr 12, 2024

    @Xuanwo
    MemberAuthor

    Can I try some of them like write and write_from?

    Welcome to have a try!

  3. tisonkun commented on Apr 16, 2024

    @tisonkun
    Member

    @Xuanwo there is no copy_from and pipe_from now?

  4. Xuanwo commented on Apr 16, 2024

    @Xuanwo
    MemberAuthor

    @Xuanwo there is no copy_from and pipe_from now?

    Yes, not implemented.

  5. tisonkun commented on Apr 16, 2024

    @tisonkun
    Member

    @Xuanwo could you then update the issue description and add related source code any contributor can start from?

  6. tisonkun commented on Apr 16, 2024

    @tisonkun
    Member

    @Xuanwo any dangling APIs here? I saw #4498 do something for this issue.

  7. Xuanwo commented on Apr 16, 2024

    @Xuanwo
    MemberAuthor

    The only API left is into_sink and into_bytes_sink. They can replace the existing sink API.


    I'm still hesitate about the into_sink API. We can keep it internal use only.

  8. tisonkun commented on Apr 18, 2024

    @tisonkun
    Member

    The API design is still quite abstract. As a developer unfamiliar with this scope, what does it mean BufferSink and FuturesBytesSink? Which trait should they implement? What APIs do they want to replace?

  9. Xuanwo commented on Apr 22, 2024

    @Xuanwo
    MemberAuthor

    what does it mean BufferSink and FuturesBytesSink?

    Also, into_bytes_sink() -> FuturesBytesSink will replace existing sink(&mut self, sink_from: S).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions