pub struct OptimizedRespEncoder { /* private fields */ }Expand description
Optimized RESP2 encoder with buffer pre-sizing and zero-copy optimizations
Implementations§
Source§impl OptimizedRespEncoder
 
impl OptimizedRespEncoder
Sourcepub fn with_capacity(capacity: usize) -> Self
 
pub fn with_capacity(capacity: usize) -> Self
Create a new encoder with specific initial capacity
Sourcepub fn encode(&mut self, value: &RespValue) -> RedisResult<Bytes>
 
pub fn encode(&mut self, value: &RespValue) -> RedisResult<Bytes>
Encode a RESP value into the internal buffer with pre-sizing
Sourcepub fn encode_command(
    &mut self,
    command: &str,
    args: &[RespValue],
) -> RedisResult<Bytes>
 
pub fn encode_command( &mut self, command: &str, args: &[RespValue], ) -> RedisResult<Bytes>
Encode a command with arguments using pre-sizing
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OptimizedRespEncoder
impl RefUnwindSafe for OptimizedRespEncoder
impl Send for OptimizedRespEncoder
impl Sync for OptimizedRespEncoder
impl Unpin for OptimizedRespEncoder
impl UnwindSafe for OptimizedRespEncoder
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