pub struct ClientSession { /* private fields */ }Expand description
Represents an active client session
Implementations§
Source§impl ClientSession
impl ClientSession
Sourcepub fn new(client_addr: SocketAddr, buffer_pool: BufferPool) -> Self
pub fn new(client_addr: SocketAddr, buffer_pool: BufferPool) -> Self
Create a new client session for 1:1 mode
Sourcepub fn new_with_router(
client_addr: SocketAddr,
buffer_pool: BufferPool,
router: Arc<BackendSelector>,
) -> Self
pub fn new_with_router( client_addr: SocketAddr, buffer_pool: BufferPool, router: Arc<BackendSelector>, ) -> Self
Create a new client session for per-command routing mode
Sourcepub fn is_per_command_routing(&self) -> bool
pub fn is_per_command_routing(&self) -> bool
Check if this session is using per-command routing
Sourcepub async fn handle_with_pooled_backend<T>(
&self,
client_stream: TcpStream,
backend_conn: T,
) -> Result<(u64, u64)>
pub async fn handle_with_pooled_backend<T>( &self, client_stream: TcpStream, backend_conn: T, ) -> Result<(u64, u64)>
Handle client connection with a pooled backend connection This keeps the pooled connection object alive and returns it to the pool when done Intercepts authentication commands since backend connection is already authenticated
Auto Trait Implementations§
impl Freeze for ClientSession
impl !RefUnwindSafe for ClientSession
impl Send for ClientSession
impl Sync for ClientSession
impl Unpin for ClientSession
impl !UnwindSafe for ClientSession
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