Closed ryo33 closed 4 months ago
Is it safe to ignore the bytes and frames though?
Is it safe to ignore the bytes and frames though?
Ignoring Frame is safe because we should not get it when reading a message as https://github.com/snapview/tungstenite-rs/pull/250.
IMO ignoring Bytes is also safe because cdp is a JSON-based protocol and I suppose it uses only the text type of frame.
CDP actually can stream the responses - which would suggest using the advanced websocket capabilities - but I checked and it indeed only uses text with data embedded as base64.
See:
As the title, this is based on #195, but zero-copy.
Also, it changes from doing
serde_json::from_slice(&data.into_data())
to doingserde_json::from_str(&text)
ofWsMessage::Text(text)
. Other variants ofWsMessage
are handled as follows:Ping
andPong
: IgnoredBytes
andFrames
: IgnoredClose
: Ends the stream