pub struct WebSocketJsonZeroCopy;Expand description
Zero-copy JSON utilities specifically for WebSocket messages
Implementations§
Source§impl WebSocketJsonZeroCopy
impl WebSocketJsonZeroCopy
Sourcepub fn parse_websocket_message<T>(message_bytes: &mut [u8]) -> Result<T>where
T: for<'de> Deserialize<'de>,
pub fn parse_websocket_message<T>(message_bytes: &mut [u8]) -> Result<T>where
T: for<'de> Deserialize<'de>,
Parse WebSocket JSON message with minimal allocation
Sourcepub fn parse_websocket_text<T>(message_text: &str) -> Result<T>where
T: for<'de> Deserialize<'de>,
pub fn parse_websocket_text<T>(message_text: &str) -> Result<T>where
T: for<'de> Deserialize<'de>,
Parse WebSocket JSON message from text with buffer reuse
Sourcepub fn parse_to_borrowed<'a>(
message_bytes: &'a mut [u8],
) -> Result<BorrowedValue<'a>>
pub fn parse_to_borrowed<'a>( message_bytes: &'a mut [u8], ) -> Result<BorrowedValue<'a>>
Parse WebSocket message to BorrowedValue for zero allocation
Sourcepub fn create_websocket_response<T>(value: &T) -> Result<SmartString>where
T: Serialize,
pub fn create_websocket_response<T>(value: &T) -> Result<SmartString>where
T: Serialize,
Create a JSON response for WebSocket using minimal allocation
Sourcepub fn parse_multiple_messages<T>(buffer: &mut [u8]) -> Result<SmallVec<[T; 4]>>where
T: for<'de> Deserialize<'de>,
pub fn parse_multiple_messages<T>(buffer: &mut [u8]) -> Result<SmallVec<[T; 4]>>where
T: for<'de> Deserialize<'de>,
Parse multiple WebSocket messages from a buffer
Auto Trait Implementations§
impl Freeze for WebSocketJsonZeroCopy
impl RefUnwindSafe for WebSocketJsonZeroCopy
impl Send for WebSocketJsonZeroCopy
impl Sync for WebSocketJsonZeroCopy
impl Unpin for WebSocketJsonZeroCopy
impl UnwindSafe for WebSocketJsonZeroCopy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more