[][src]Struct libpq::result::Result

pub struct Result { /* fields omitted */ }

Implementations

impl Result[src]

pub fn new(conn: &Connection, status: Status) -> Self[src]

Constructs an empty Result object with the given status.

See PQmakeEmptyPGresult.

pub fn status(&self) -> Status[src]

Returns the result status of the command.

See PQresultStatus.

pub fn error_message(&self) -> Option<String>[src]

Returns the error message associated with the command, or an empty string if there was no error.

See PQresultErrorMessage.

pub fn error_field(&self, field: ErrorField) -> Option<&'static str>[src]

Returns a reformatted version of the error message associated with a libpq::Result object.

See PQresultErrorField.

pub fn ntuples(&self) -> usize[src]

Returns the number of rows (tuples) in the query result.

See PQntuples.

pub fn nfields(&self) -> usize[src]

Returns the number of columns (fields) in each row of the query result.

See PQnfields.

pub fn field_name(&self, number: usize) -> Option<String>[src]

Returns the column name associated with the given column number.

See PQfname.

pub fn field_number(&self, name: &str) -> Option<usize>[src]

Returns the column number associated with the given column name.

See PQfnumber.

pub fn field_table(&self, column: usize) -> Option<Oid>[src]

Returns the OID of the table from which the given column was fetched.

See PQftable.

pub fn field_tablecol(&self, column: usize) -> usize[src]

Returns the column number (within its table) of the column making up the specified query result column.

See PQftablecol.

pub fn field_format(&self, column: usize) -> Format[src]

Returns the format code indicating the format of the given column.

See PQfformat.

pub fn field_type(&self, column: usize) -> Oid[src]

Returns the data type associated with the given column number.

See PQftype.

pub fn field_mod(&self, column: usize) -> Option<i32>[src]

Returns the type modifier of the column associated with the given column number.

See PQfmod.

pub fn field_size(&self, column: usize) -> Option<usize>[src]

Returns the size in bytes of the column associated with the given column number.

None indicates the data type is variable-length.

See PQfsize.

pub fn binary_tuples(&self) -> bool[src]

Returns true if the Result contains binary data and false if it contains text data.

See PQbinaryTuples.

pub fn value(&self, row: usize, column: usize) -> Option<&[u8]>[src]

Returns a single field value of one row of a Result.

See PQgetvalue.

pub fn is_null(&self, row: usize, column: usize) -> bool[src]

Tests a field for a null value.

See PQgetisnull.

pub fn length(&self, row: usize, column: usize) -> usize[src]

Returns the actual length of a field value in bytes.

See PQgetlength.

pub fn nparams(&self) -> usize[src]

Returns the number of parameters of a prepared statement.

See PQnparams.

pub fn param_type(&self, param: usize) -> Option<Oid>[src]

Returns the data type of the indicated statement parameter.

See PQparamtype.

pub fn print(&self, output: &dyn AsRawFd, option: &Options)[src]

Prints out all the rows and, optionally, the column names to the specified output stream.

See PQprint.

pub fn cmd_status(&self) -> Option<String>[src]

Returns the command status tag from the SQL command that generated the Result.

See PQcmdStatus.

pub fn cmd_tuples(&self) -> usize[src]

Returns the number of rows affected by the SQL command.

See PQcmdTuples.

pub fn oid_value(&self) -> Option<Oid>[src]

Returns the OID of the inserted row.

See PQoidValue.

pub fn oid_status(&self) -> Option<String>[src]

👎 Deprecated:

This function is deprecated in favor of libpq::Result::oid_value and is not thread-safe.

pub fn copy(&self, flags: i32) -> Result<Self, ()>[src]

Makes a copy of a Result object.

See PQcopyResult.

pub fn set_attrs(&mut self, attributes: &[&Attribute]) -> Result<(), ()>[src]

Sets the attributes of a PGresult object.

See PQsetResultAttrs.

pub fn set_value(
    &mut self,
    tuple: usize,
    field: usize,
    value: Option<&str>
) -> Result<(), ()>
[src]

Sets a tuple field value of a Result object.

See PQsetvalue.

pub unsafe fn alloc(&mut self, nbytes: usize) -> Result<*mut c_void, ()>[src]

Allocate subsidiary storage for a Result object.

See PQresultAlloc.

Safety

This function return a void* pointer.

pub fn display_tuples(
    &self,
    file: File,
    fill_align: bool,
    field_sep: Option<&str>,
    print_header: bool,
    quiet: bool
)
[src]

Really old printing routines.

Trait Implementations

impl Debug for Result[src]

impl Drop for Result[src]

impl Send for Result[src]

impl Sync for Result[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.