Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions mysql/src/resultset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ impl<'a, W: AsyncWrite + Unpin> QueryResultWriter<'a, W> {
/// Note that if no columns are emitted, any written rows are ignored.
///
/// See [`RowWriter`](struct.RowWriter.html).
pub async fn start(mut self, columns: &'a [Column]) -> io::Result<RowWriter<'a, W>> {
pub async fn start<'b>(mut self, columns: &'b [Column]) -> io::Result<RowWriter<'a, 'b, W>> {
self.finalize(true).await?;
RowWriter::new(self, columns).await
}
Expand Down Expand Up @@ -215,27 +215,27 @@ impl<'a, W: AsyncWrite + Unpin> QueryResultWriter<'a, W> {
/// if an I/O error occurs when sending the end-of-records marker to the client. To avoid this,
/// call [`finish`](struct.RowWriter.html#method.finish) explicitly.
#[must_use]
pub struct RowWriter<'a, W: AsyncWrite + Unpin> {
pub struct RowWriter<'a, 'b, W: AsyncWrite + Unpin> {
client_capabilities: CapabilityFlags,
result: Option<QueryResultWriter<'a, W>>,
bitmap_len: usize,
data: Vec<u8>,
columns: &'a [Column],
columns: &'b [Column],

// next column to write for the current row
// NOTE: (ab)used to track number of *rows* for a zero-column resultset
col: usize,
finished: bool,
}

impl<'a, W> RowWriter<'a, W>
impl<'a, 'b, W> RowWriter<'a, 'b, W>
where
W: 'a + AsyncWrite + Unpin,
{
async fn new(
result: QueryResultWriter<'a, W>,
columns: &'a [Column],
) -> io::Result<RowWriter<'a, W>> {
columns: &'b [Column],
) -> io::Result<RowWriter<'a, 'b, W>> {
let bitmap_len = (columns.len() + 7 + 2) / 8;
let client_capabilities = result.client_capabilities;
let mut rw = RowWriter {
Expand Down Expand Up @@ -370,7 +370,7 @@ where
}
}

impl<'a, W: AsyncWrite + Unpin + 'a> RowWriter<'a, W> {
impl<'a, 'b, W: AsyncWrite + Unpin + 'a> RowWriter<'a, 'b, W> {
async fn finish_inner(&mut self, extra_info: &str, complete: bool) -> io::Result<()> {
if self.finished {
return Ok(());
Expand Down
Loading