Totodore / socketioxide

A socket.io server implementation in Rust that integrates with the Tower ecosystem and the Tokio stack.
https://docs.rs/socketioxide
MIT License
1.13k stars 49 forks source link

feat(socketio/packet): switch to `Str` type for ns path storage #334

Closed Totodore closed 3 weeks ago

Totodore commented 3 weeks ago

Motivation

Currently the namespace path is decoded from a Str payload, meaning that we can extract it in a zero copy manner by slicing the Str and storing it like that. It also fixes a lifetime issue for PR #333 with path params. Because the path need to outlive the decoded params from the matchit router as long as they are not decoded by the user.

Solution