Skip to content

Box::pin vs pin_mut!(s);  #25

@kornelski

Description

@kornelski

Requiring pin_mut!(s); at the usage site may be efficient, but it is an awkward requirement for users of such API.

I've found that wrapping returned stream in Box::pin makes it "just work". I suspect that for network-bound streams the overhead will be negligible.

Could you mention this alternative in the docs?

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