Trait odbc_safe::Diagnostics [] [src]

pub trait Diagnostics {
    fn diagnostics(
        &self,
        rec_number: SQLSMALLINT,
        message_text: &mut [SQLCHAR]
    ) -> ReturnOption<DiagResult>; }

A type implementing this trait is able to provide diagnostic information regarding the last method call.

Required Methods

Returns the current values of multiple fields of a diagnostic record that contains error, warning, and status information.

# Arguments

  • rec_number - Indicates the status record from which the application seeks information. Status records are numbered from 1.
  • message_text - Buffer in which to return the diagnostic message text string. If the number of characters to return is greater than the buffer length, the diagnostic message is truncated to max(message_text.len() - 1, 0). For the format of the string, see Diagnostic Messages

    Result

    `

  • Success - The function successfully returned diagnostic information.

  • Info - The message_text buffer was too small to hold the requested diagnostic message. No diagnostic records were generated. To determine that a truncation occurred, the application must compare the buffer length to the actual number of bytes available, which is found in DiagResult::text_length

  • Error - rec_number was negative or 0.

  • NoData - rec_number was greater than the number of diagnostic records that existed for the specified Handle. The function also returns NoData for any positive rec_number if there are no diagnostic records available.

Implementors