#[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,
}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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
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.
Implementations§
Source§impl<'a> WriteRequest<'a>
impl<'a> WriteRequest<'a>
Sourcepub const fn new(function: &'a str, args: &'a [Value]) -> WriteRequest<'a>
pub const fn new(function: &'a str, args: &'a [Value]) -> WriteRequest<'a>
A committing call of function with args, no session variables and no outbox row.
Sourcepub const fn with_session_vars(
self,
session_vars: &'a [(&'a str, &'a str)],
) -> WriteRequest<'a>
pub const fn with_session_vars( self, session_vars: &'a [(&'a str, &'a str)], ) -> WriteRequest<'a>
With these transaction-local session variables.
Sourcepub const fn with_changelog(
self,
changelog: Option<&'a ChangeLogWrite<'a>>,
) -> WriteRequest<'a>
pub const fn with_changelog( self, changelog: Option<&'a ChangeLogWrite<'a>>, ) -> WriteRequest<'a>
With this change-log outbox row, written in the write’s transaction.
Sourcepub const fn with_mode(self, mode: WriteMode) -> WriteRequest<'a>
pub const fn with_mode(self, mode: WriteMode) -> WriteRequest<'a>
In mode.
Trait Implementations§
Source§impl<'a> Clone for WriteRequest<'a>
impl<'a> Clone for WriteRequest<'a>
Source§fn clone(&self) -> WriteRequest<'a>
fn clone(&self) -> WriteRequest<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for WriteRequest<'a>
Auto Trait Implementations§
impl<'a> Freeze for WriteRequest<'a>
impl<'a> RefUnwindSafe for WriteRequest<'a>
impl<'a> Send for WriteRequest<'a>
impl<'a> Sync for WriteRequest<'a>
impl<'a> Unpin for WriteRequest<'a>
impl<'a> UnsafeUnpin for WriteRequest<'a>
impl<'a> UnwindSafe for WriteRequest<'a>
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