[−][src]Struct msql_srv::QueryResultWriter
Convenience type for providing query results to clients.
This type should not be dropped without calling
start
,
completed
, or
error
.
To send multiple resultsets, use
RowWriter::finish_one
and
complete_one
. These are similar to
RowWriter::finish
and completed
, but both eventually yield back the QueryResultWriter
so
that another resultset can be sent. To indicate that no more resultset will be sent, call
no_more_results
. All methods on
QueryResultWriter
(except no_more_results
) automatically start a new resultset. The
QueryResultWriter
may be dropped without calling no_more_results
, but in this case the
program may panic if an I/O error occurs when sending the end-of-records marker to the client.
To handle such errors, call no_more_results
explicitly.
Methods
impl<'a, W: Write> QueryResultWriter<'a, W>
[src]
pub fn start(self, columns: &'a [Column]) -> Result<RowWriter<'a, W>>
[src]
Start a resultset response to the client that conforms to the given columns
.
Note that if no columns are emitted, any written rows are ignored.
See RowWriter
.
pub fn complete_one(self, rows: u64, last_insert_id: u64) -> Result<Self>
[src]
Send an empty resultset response to the client indicating that rows
rows were affected by
the query in this resultset. last_insert_id
may be given to communiate an identifier for
a client's most recent insertion.
pub fn completed(self, rows: u64, last_insert_id: u64) -> Result<()>
[src]
Send an empty resultset response to the client indicating that rows
rows were affected by
the query. last_insert_id
may be given to communiate an identifier for a client's most
recent insertion.
pub fn error<E: ?Sized>(self, kind: ErrorKind, msg: &E) -> Result<()> where
E: Borrow<[u8]>,
[src]
E: Borrow<[u8]>,
Reply to the client's query with an error.
pub fn no_more_results(self) -> Result<()>
[src]
Send the last bits of the last resultset to the client, and indicate that there are no more resultsets coming.
Trait Implementations
Auto Trait Implementations
impl<'a, W> Send for QueryResultWriter<'a, W> where
W: Send,
W: Send,
impl<'a, W> Sync for QueryResultWriter<'a, W> where
W: Sync,
W: Sync,
impl<'a, W> Unpin for QueryResultWriter<'a, W>
impl<'a, W> !UnwindSafe for QueryResultWriter<'a, W>
impl<'a, W> RefUnwindSafe for QueryResultWriter<'a, W> where
W: RefUnwindSafe,
W: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
fn vzip(self) -> V
impl<T> Same<T> for T
type Output = T
Should always be Self