pub struct QwenXmlParser {
text: ChannelState,
reasoning: ChannelState,
next_id: u32,
}Expand description
Parser for the Qwen XML tool-call dialect. See module docs.
Fields§
§text: ChannelState§reasoning: ChannelState§next_id: u32Monotonic counter for synthesised tool-call IDs. Shared across both channels so IDs remain globally unique within a single stream.
Implementations§
Source§impl QwenXmlParser
impl QwenXmlParser
Sourcefn scan(&mut self, channel: Channel, chunk: &str) -> ParserOutput
fn scan(&mut self, channel: Channel, chunk: &str) -> ParserOutput
Drive the state machine for one channel.
All scanning logic lives here; push_text and push_reasoning are
thin dispatch wrappers that pick the right ChannelState and route
flushed bytes to the right output field.
Sourcefn flush_channel(&mut self, channel: Channel) -> ParserOutput
fn flush_channel(&mut self, channel: Channel) -> ParserOutput
Flush a single channel at end-of-stream.
Trait Implementations§
Source§impl Debug for QwenXmlParser
impl Debug for QwenXmlParser
Source§impl Default for QwenXmlParser
impl Default for QwenXmlParser
Source§fn default() -> QwenXmlParser
fn default() -> QwenXmlParser
Returns the “default value” for a type. Read more
Source§impl ToolCallParser for QwenXmlParser
impl ToolCallParser for QwenXmlParser
Source§fn push_text(&mut self, chunk: &str) -> ParserOutput
fn push_text(&mut self, chunk: &str) -> ParserOutput
Feed a chunk that arrived on the upstream text channel.
Source§fn push_reasoning(&mut self, chunk: &str) -> ParserOutput
fn push_reasoning(&mut self, chunk: &str) -> ParserOutput
Feed a chunk that arrived on the upstream reasoning channel.
Source§fn finish(&mut self) -> ParserOutput
fn finish(&mut self) -> ParserOutput
Flush any buffered partial state at end-of-stream. Read more
Auto Trait Implementations§
impl Freeze for QwenXmlParser
impl RefUnwindSafe for QwenXmlParser
impl Send for QwenXmlParser
impl Sync for QwenXmlParser
impl Unpin for QwenXmlParser
impl UnwindSafe for QwenXmlParser
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