pub struct StatementStream { /* private fields */ }
Expand description
A struct which can parse queries statements by statement
Implementations§
Source§impl StatementStream
impl StatementStream
pub fn new() -> Self
pub fn new_with_settings(settings: ParserSettings) -> Self
Sourcepub fn parse_partial(
&mut self,
buffer: &mut BytesMut,
) -> Result<Option<Statement>, RenderedError>
pub fn parse_partial( &mut self, buffer: &mut BytesMut, ) -> Result<Option<Statement>, RenderedError>
Parses a statement if the buffer contains sufficient data to parse a statement.
When it will have done so the it will remove the read bytes from the buffer and return Ok(Some()). In case of a parsing error it will return Err(), this will not consume data.
If the function returns Ok(None), not enough data was in the buffer to fully parse a statement, the function might still consume data from the buffer, like whitespace between statements, when a none is returned.
Sourcepub fn parse_complete(
&mut self,
buffer: &mut BytesMut,
) -> Result<Option<Statement>, RenderedError>
pub fn parse_complete( &mut self, buffer: &mut BytesMut, ) -> Result<Option<Statement>, RenderedError>
Parse remaining statements once the buffer is complete.
Auto Trait Implementations§
impl !Freeze for StatementStream
impl !RefUnwindSafe for StatementStream
impl Send for StatementStream
impl Sync for StatementStream
impl Unpin for StatementStream
impl UnwindSafe for StatementStream
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more