Struct hdbconnect::HdbResponse
source · pub struct HdbResponse { /* private fields */ }
Expand description
Represents all possible non-error responses to a database command.
Technically, it is a list of single database response values, each of which can be
- a resultset of a query
- a list of numbers of affected rows
- values of output parameters of a procedure call
- just an indication that a db call was successful
- a list of
XaTransactionId
s
Typically, i.e. in all simple cases, you just have a single database
response value, and can use the respective into_
message to convert the
HdbResponse directly into this single value, whose type is predetermined by
the nature of the database call.
Procedure calls e.g. belong to the more complex cases where the database
response can consist of e.g. multiple result sets. In this case, you need
to evaluate the HdbResponse using the get_
methods.
Implementations§
source§impl HdbResponse
impl HdbResponse
sourcepub fn into_resultset(self) -> HdbResult<ResultSet>
pub fn into_resultset(self) -> HdbResult<ResultSet>
Turns itself into a single resultset.
If this cannot be done without loss of information, an error is returned.
sourcepub fn into_affected_rows(self) -> HdbResult<Vec<usize>>
pub fn into_affected_rows(self) -> HdbResult<Vec<usize>>
Turns itself into a Vector of numbers (each number representing a number of affected rows).
If this cannot be done without loss of information, an error is returned.
sourcepub fn into_output_parameters(self) -> HdbResult<OutputParameters>
pub fn into_output_parameters(self) -> HdbResult<OutputParameters>
Turns itself into a Vector of numbers (each number representing a number of affected rows).
If this cannot be done without loss of information, an error is returned.
sourcepub fn into_success(self) -> HdbResult<()>
pub fn into_success(self) -> HdbResult<()>
Turns itself into (), if the statement had returned successfully.
If this cannot be done without loss of information, an error is returned.
sourcepub fn into_single_retval(self) -> HdbResult<HdbReturnValue>
pub fn into_single_retval(self) -> HdbResult<HdbReturnValue>
Turns itself into a single return value, if there is exactly one.
sourcepub fn get_success(&mut self) -> HdbResult<()>
pub fn get_success(&mut self) -> HdbResult<()>
Returns () if a successful execution was signaled by the database explicitly, or an error otherwise.
sourcepub fn get_resultset(&mut self) -> HdbResult<ResultSet>
pub fn get_resultset(&mut self) -> HdbResult<ResultSet>
Returns the next ResultSet
, or an error if there is none.
sourcepub fn get_parameter_descriptor(&mut self) -> HdbResult<ParameterDescriptor>
pub fn get_parameter_descriptor(&mut self) -> HdbResult<ParameterDescriptor>
Returns the next ParameterDescriptor
, or an error if there is none.
sourcepub fn get_affected_rows(&mut self) -> HdbResult<Vec<usize>>
pub fn get_affected_rows(&mut self) -> HdbResult<Vec<usize>>
Returns the next set of affected rows counters, or an error if there is none.
sourcepub fn get_output_parameters(&mut self) -> HdbResult<OutputParameters>
pub fn get_output_parameters(&mut self) -> HdbResult<OutputParameters>
Returns the next OutputParameters
, or an error if there is none.