pub struct TtcWriter { /* private fields */ }Implementations§
Source§impl TtcWriter
impl TtcWriter
pub fn new() -> Self
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
A writer whose backing buffer is preallocated to capacity bytes. A
TtcWriter::new() starts at zero capacity, so a payload built from many
small write_* pushes grows the Vec through several doublings — each a
separate heap allocation. Sizing the buffer once (to a small-payload
default or an exact known length) collapses those growth reallocs to a
single allocation. The written bytes are byte-identical either way; this
is a pure allocation optimization.
pub fn into_bytes(self) -> Vec<u8> ⓘ
pub fn write_u8(&mut self, value: u8)
pub fn write_u16be(&mut self, value: u16)
pub fn write_u16le(&mut self, value: u16)
pub fn write_u32be(&mut self, value: u32)
pub fn write_u64be(&mut self, value: u64)
pub fn write_ub2(&mut self, value: u16)
pub fn write_ub4(&mut self, value: u32)
pub fn write_ub8(&mut self, value: u64)
pub fn write_seq_num(&mut self)
pub fn write_raw(&mut self, value: &[u8])
pub fn write_bytes_with_length(&mut self, value: &[u8]) -> Result<()>
pub fn write_bytes_with_two_lengths( &mut self, value: Option<&[u8]>, ) -> Result<()>
pub fn write_str_two_lengths(&mut self, value: &str) -> Result<()>
Sourcepub fn write_sb4(&mut self, value: i32)
pub fn write_sb4(&mut self, value: i32)
Writes a 32-bit signed integer in Oracle universal (sign-magnitude)
format: a length byte whose high bit (0x80) is set for negatives,
followed by the big-endian magnitude bytes. Mirrors the reference
WriteBuffer.write_sb4 (impl/base/buffer.pyx).
Sourcepub fn write_keyword_value_pair(
&mut self,
text_value: Option<&[u8]>,
binary_value: Option<&[u8]>,
keyword: u16,
) -> Result<()>
pub fn write_keyword_value_pair( &mut self, text_value: Option<&[u8]>, binary_value: Option<&[u8]>, keyword: u16, ) -> Result<()>
Writes a keyword/value pair (text and binary values plus a ub2 keyword)
as used by the AQ message-property extension list. Mirrors the reference
WriteBuffer.write_keyword_value_pair (impl/thin/packet.pyx:859).