[−][src]Struct msql_srv::RowWriter
Convenience type for sending rows of a resultset to a client.
Rows can either be written out one column at a time (using
write_col
and
end_row
), or one row at a time (using
write_row
).
This type may be dropped without calling
write_row
or
finish
. However, in this case, the program may panic
if an I/O error occurs when sending the end-of-records marker to the client. To avoid this,
call finish
explicitly.
Methods
impl<'a, W> RowWriter<'a, W> where
W: Write + 'a,
[src]
W: Write + 'a,
pub fn write_col<T>(&mut self, v: T) -> Result<()> where
T: ToMysqlValue,
[src]
T: ToMysqlValue,
Write a value to the next column of the current row as a part of this resultset.
If you do not call end_row
after the last row,
any errors that occur when writing out the last row will be returned by
finish
. If you do not call finish
either, any
errors will cause a panic when the RowWriter
is dropped.
Note that the row must conform to the column specification provided to
QueryResultWriter::start
. If it does not,
this method will return an error indicating that an invalid value type or specification was
provided.
pub fn end_row(&mut self) -> Result<()>
[src]
Indicate that no more column data will be written for the current row.
pub fn write_row<I, E>(&mut self, row: I) -> Result<()> where
I: IntoIterator<Item = E>,
E: ToMysqlValue,
[src]
I: IntoIterator<Item = E>,
E: ToMysqlValue,
Write a single row as a part of this resultset.
Note that the row must conform to the column specification provided to
QueryResultWriter::start
. If it does not,
this method will return an error indicating that an invalid value type or specification was
provided.
impl<'a, W: Write + 'a> RowWriter<'a, W>
[src]
pub fn finish(self) -> Result<()>
[src]
Indicate to the client that no more rows are coming.
pub fn finish_one(self) -> Result<QueryResultWriter<'a, W>>
[src]
End this resultset response, and indicate to the client that no more rows are coming.
Trait Implementations
Auto Trait Implementations
impl<'a, W> Send for RowWriter<'a, W> where
W: Send,
W: Send,
impl<'a, W> Sync for RowWriter<'a, W> where
W: Sync,
W: Sync,
impl<'a, W> Unpin for RowWriter<'a, W>
impl<'a, W> !UnwindSafe for RowWriter<'a, W>
impl<'a, W> RefUnwindSafe for RowWriter<'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