pub struct Connection { /* private fields */ }Expand description
Manages a client connection with RESP protocol handling
Handles command parsing, execution, and response buffering.
Implementations§
Source§impl Connection
impl Connection
Sourcepub fn new(fd: RawFd, buffer_size: usize, store: Arc<FeoxStore>) -> Self
pub fn new(fd: RawFd, buffer_size: usize, store: Arc<FeoxStore>) -> Self
Create a new connection handler
pub fn fd(&self) -> RawFd
pub fn is_closed(&self) -> bool
pub fn close(&mut self)
Sourcepub fn process_read(&mut self, data: &[u8]) -> Result<()>
pub fn process_read(&mut self, data: &[u8]) -> Result<()>
Process incoming data with inline execution
Sourcepub fn pending_writes(&mut self) -> Option<&[u8]>
pub fn pending_writes(&mut self) -> Option<&[u8]>
Get pending write data as a single buffer slice
Sourcepub fn consume_writes(&mut self, n: usize)
pub fn consume_writes(&mut self, n: usize)
Mark bytes as written
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Connection
impl !RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl !UnwindSafe for Connection
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