1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//! # mssql-codec
//!
//! Async framing layer for TDS packet handling.
//!
//! This crate transforms raw byte streams into high-level TDS packets,
//! handling packet reassembly across TCP segment boundaries and packet
//! continuation for large messages.
//!
//! ## Features
//!
//! - Packet reassembly across TCP segments
//! - Message reassembly from multiple packets
//! - IO splitting for cancellation safety (ADR-005)
//! - Integration with tokio-util's codec framework
//!
//! ## Architecture
//!
//! The codec layer sits between raw TCP streams and the higher-level client:
//!
//! ```text
//! TCP Stream → TdsCodec (packet framing) → MessageAssembler → Client
//! ```
//!
//! ### Cancellation Safety
//!
//! Per ADR-005, the connection splits the TCP stream into read and write halves.
//! This allows sending Attention packets for query cancellation even while
//! blocked reading a large result set.
//!
//! ```rust,ignore
//! use mssql_codec::Connection;
//!
//! let conn = Connection::new(tcp_stream);
//! let cancel = conn.cancel_handle();
//!
//! // Cancel from another task
//! tokio::spawn(async move {
//! cancel.cancel().await?;
//! });
//! ```
pub use ;
pub use CodecError;
pub use ;
pub use ;
pub use ;