pub struct ErrorReport { /* private fields */ }Expand description
Represents the set of information necessary for pgx to promote a Rust panic!() to a Postgres
ERROR (or any PgLogLevel level)
Implementations§
Source§impl ErrorReport
impl ErrorReport
Sourcepub fn new<S: Into<String>>(
sqlerrcode: PgSqlErrorCode,
message: S,
funcname: &'static str,
) -> Self
pub fn new<S: Into<String>>( sqlerrcode: PgSqlErrorCode, message: S, funcname: &'static str, ) -> Self
Create a [PgErrorReport] which can be raised via Rust’s std::panic::panic_any() or as a specific Postgres “ereport()` level via [PgErrorReport::report(self, PgLogLevel)]
Embedded “file:line:col” location information is taken from the caller’s location
Sourcepub fn set_detail<S: Into<String>>(self, detail: S) -> Self
pub fn set_detail<S: Into<String>>(self, detail: S) -> Self
Set the detail property, whose default is None
Sourcepub fn set_hint<S: Into<String>>(self, hint: S) -> Self
pub fn set_hint<S: Into<String>>(self, hint: S) -> Self
Set the hint property, whose default is None
Sourcepub fn report(self, level: PgLogLevel)
pub fn report(self, level: PgLogLevel)
Report this [PgErrorReport], which will ultimately be reported by Postgres at the specified PgLogLevel
If the provided level is >= PgLogLevel::ERROR this function will not return.
Trait Implementations§
Source§impl Debug for ErrorReport
impl Debug for ErrorReport
Auto Trait Implementations§
impl !Freeze for ErrorReport
impl RefUnwindSafe for ErrorReport
impl Send for ErrorReport
impl Sync for ErrorReport
impl Unpin for ErrorReport
impl UnwindSafe for ErrorReport
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more