pub struct ProtocolNegotiator { /* private fields */ }Expand description
Protocol negotiator for handling RESP2/RESP3 protocol selection
Implementations§
Source§impl ProtocolNegotiator
 
impl ProtocolNegotiator
Sourcepub const fn new(preferred_version: ProtocolVersion) -> Self
 
pub const fn new(preferred_version: ProtocolVersion) -> Self
Create a new protocol negotiator
Sourcepub async fn negotiate<T>(
    &self,
    connection: &mut T,
) -> RedisResult<ProtocolNegotiation>where
    T: ProtocolConnection,
 
pub async fn negotiate<T>(
    &self,
    connection: &mut T,
) -> RedisResult<ProtocolNegotiation>where
    T: ProtocolConnection,
Negotiate protocol version with the server
This method attempts to negotiate the preferred protocol version. If RESP3 is preferred, it sends a HELLO command to negotiate. Falls back to RESP2 if negotiation fails.
§Errors
Returns an error if protocol negotiation fails completely.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProtocolNegotiator
impl RefUnwindSafe for ProtocolNegotiator
impl Send for ProtocolNegotiator
impl Sync for ProtocolNegotiator
impl Unpin for ProtocolNegotiator
impl UnwindSafe for ProtocolNegotiator
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