pub struct QueryResult {
pub status: StatusCode,
pub rows: Vec<Value>,
pub total_count: Option<i64>,
pub content_range: Option<ContentRange>,
pub location: Option<String>,
pub allow: Option<String>,
pub guc_headers: Option<String>,
pub guc_status: Option<String>,
pub omit_body: bool,
pub affected: usize,
pub singular: bool,
pub raw_body: Option<(String, Vec<u8>)>,
}Expand description
Query result for response formatting.
Fields§
§status: StatusCodeHTTP status code
rows: Vec<Value>Result rows
total_count: Option<i64>Total row count (for pagination)
content_range: Option<ContentRange>Content range
location: Option<String>Location header (for POST)
allow: Option<String>The methods an OPTIONS request is answering about.
Only an OPTIONS sets this; every other response leaves it None and
sends no Allow, since the question was not asked.
guc_headers: Option<String>Custom headers from GUC
guc_status: Option<String>Custom status from GUC
omit_body: boolWhether to send no body at all.
Set for a mutation the caller asked no representation from: the
response carries headers and a status but no payload, where an empty
row set would otherwise render as [].
affected: usizeHow many rows the statement affected.
Distinct from rows.len(), which is empty when no representation was
asked for. How many rows a write touched is a fact about the write, and
a caller that asked for exactly one object is owed an answer about it
whether or not it wanted the object back.
singular: boolWhether the result should be rendered as a single (un-arrayed) value.
Set for PostgREST-compatibility RPC responses where the underlying function is not set-returning: the bare object/scalar is returned instead of a one-element array.
raw_body: Option<(String, Vec<u8>)>A body the database rendered in full, with the media type it is in.
Set when the request asked for a media type the schema declares its own renderer for. The value is the whole payload, so it replaces the usual JSON rendering rather than being wrapped in it.
Trait Implementations§
Source§impl Clone for QueryResult
impl Clone for QueryResult
Source§impl Debug for QueryResult
impl Debug for QueryResult
Auto Trait Implementations§
impl Freeze for QueryResult
impl RefUnwindSafe for QueryResult
impl Send for QueryResult
impl Sync for QueryResult
impl Unpin for QueryResult
impl UnsafeUnpin for QueryResult
impl UnwindSafe for QueryResult
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more