pub struct LobTextDecoder { /* private fields */ }Expand description
Stateful, incremental decoder for streamed CLOB/NCLOB text.
decode_lob_text decodes a whole LOB buffer in one shot. A lazy LOB
reader instead pulls the LOB in chunks, and a chunk boundary can fall in the
middle of a multi-byte codepoint — an incomplete UTF-8 sequence, or (for the
UTF-16 / AL16UTF16 form the server uses for multi-byte CLOBs) an odd trailing
byte or a high surrogate whose low half is in the next chunk. Feeding those
chunks to this decoder yields exactly the same String as decoding the whole
buffer at once: the incomplete tail is carried across push
calls and stitched to the next chunk, and finish reports a
truncated stream.
This is a new untrusted-decode surface (LOB bytes come off the wire), so its
boundary handling is validated offline against decode_lob_text at every
split point and is a fuzz target.
Implementations§
Source§impl LobTextDecoder
impl LobTextDecoder
Sourcepub fn new(use_utf16: bool, little_endian: bool) -> Self
pub fn new(use_utf16: bool, little_endian: bool) -> Self
Build a decoder for the given character-set form and encoding direction.
Sourcepub fn from_lob(csfrm: u8, locator: Option<&[u8]>) -> Self
pub fn from_lob(csfrm: u8, locator: Option<&[u8]>) -> Self
Build a decoder for a LOB from its csfrm and locator flags, matching the
same UTF-16/endianness decision decode_lob_text makes.
Trait Implementations§
Source§impl Clone for LobTextDecoder
impl Clone for LobTextDecoder
Source§fn clone(&self) -> LobTextDecoder
fn clone(&self) -> LobTextDecoder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more