pub struct TokenStream<'a> { /* private fields */ }Expand description
Reads a reassembled response message one token at a time.
The stream is stateful because rows carry no types of their own: they are decoded against the COLMETADATA that preceded them.
Implementations§
Source§impl<'a> TokenStream<'a>
impl<'a> TokenStream<'a>
pub fn new(bytes: &'a [u8]) -> Self
Sourcepub fn columns(&self) -> &Arc<Vec<Column>> ⓘ
pub fn columns(&self) -> &Arc<Vec<Column>> ⓘ
The columns of the result set currently being read.
Sourcepub fn next_token(&mut self) -> Result<Option<Token>>
pub fn next_token(&mut self) -> Result<Option<Token>>
The next token, or None at the end of the message.
Not an Iterator: a token can fail to parse, and a stream that hides
that behind None would silently truncate a result set.
Auto Trait Implementations§
impl<'a> Freeze for TokenStream<'a>
impl<'a> RefUnwindSafe for TokenStream<'a>
impl<'a> Send for TokenStream<'a>
impl<'a> Sync for TokenStream<'a>
impl<'a> Unpin for TokenStream<'a>
impl<'a> UnsafeUnpin for TokenStream<'a>
impl<'a> UnwindSafe for TokenStream<'a>
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