#[non_exhaustive]pub struct WriteRequest<'a> {
pub function: &'a str,
pub args: &'a [Value],
pub session_vars: &'a [(&'a str, &'a str)],
pub changelog: Option<&'a ChangeLogWrite<'a>>,
pub mode: WriteMode,
pub derived_cascade: Option<&'a DerivedCascade<'a>>,
pub report_changes: Option<i32>,
}Expand description
One call of a write function.
#[non_exhaustive]: build it with WriteRequest::new and the with_* builders, so a
field added later breaks no adapter and no caller.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.function: &'a strThe function to call.
args: &'a [Value]Its arguments, positionally.
session_vars: &'a [(&'a str, &'a str)]Transaction-local settings applied before the call (set_config(.., true)).
changelog: Option<&'a ChangeLogWrite<'a>>The change-log outbox row to write in the same transaction, if any.
mode: WriteModeWhether the write commits.
derived_cascade: Option<&'a DerivedCascade<'a>>The pg_tviews report to attach before the gate, if any (#1391).
report_changes: Option<i32>Report the rows the call changed, at most this many (#1576): see
CHANGED_ROWS_KEY. A call with a DerivedCascade carries its report there
instead.
Implementations§
Source§impl<'a> WriteRequest<'a>
impl<'a> WriteRequest<'a>
Sourcepub const fn new(function: &'a str, args: &'a [Value]) -> Self
pub const fn new(function: &'a str, args: &'a [Value]) -> Self
A committing call of function with args, no session variables and no outbox row.
Sourcepub const fn with_changes_reported(self, max_entities: Option<i32>) -> Self
pub const fn with_changes_reported(self, max_entities: Option<i32>) -> Self
Reporting the rows the call changes, at most max_entities (#1576).
Sourcepub const fn with_derived_cascade(
self,
derived_cascade: Option<&'a DerivedCascade<'a>>,
) -> Self
pub const fn with_derived_cascade( self, derived_cascade: Option<&'a DerivedCascade<'a>>, ) -> Self
With the pg_tviews report attached before the gate (#1391).
Sourcepub const fn with_session_vars(
self,
session_vars: &'a [(&'a str, &'a str)],
) -> Self
pub const fn with_session_vars( self, session_vars: &'a [(&'a str, &'a str)], ) -> Self
With these transaction-local session variables.
Sourcepub const fn with_changelog(
self,
changelog: Option<&'a ChangeLogWrite<'a>>,
) -> Self
pub const fn with_changelog( self, changelog: Option<&'a ChangeLogWrite<'a>>, ) -> Self
With this change-log outbox row, written in the write’s transaction.