Skip to content

Impossible to get a BytesMut (or owned bytes buffer) of a Message without copying it #503

@elenakrittik

Description

@elenakrittik

Calling Bytes::is_unique on a Message's Bytes instance always (seemingly at least) returns false, making it impossible to get a &mut [u8] of said Bytes instance without copying it. That, from what i could understand reading bytes's documentation, means that tungstenite keeps references to the messsage bytes somewhere inside. I need at least mutable (better owned) access to all bytes i receive, and copying everything passing over the websocket connection is a giant waste. Where does tungstenite store those references (or does it at all?), and how can i make it not do that (or otherwise give me the ownership of the message bytes)? Thank you.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions