pub struct StateChangeBuilder { /* private fields */ }Expand description
Implementations§
Source§impl StateChangeBuilder
impl StateChangeBuilder
Sourcepub fn new(
connection: Connection,
name: String,
version: StateChangeVersion,
) -> Self
pub fn new( connection: Connection, name: String, version: StateChangeVersion, ) -> Self
Create a new state change builder.
Sourcepub fn json<T: Serialize>(self, value: &T) -> Result<Self, CommandRequestError>
pub fn json<T: Serialize>(self, value: &T) -> Result<Self, CommandRequestError>
Set the request body as JSON.
Sourcepub fn request(self, request: CommandRequest) -> Self
pub fn request(self, request: CommandRequest) -> Self
Set the raw command request.
Sourcepub fn with_transaction_id(self, transaction_id: impl Into<String>) -> Self
pub fn with_transaction_id(self, transaction_id: impl Into<String>) -> Self
Set a specific transaction ID for idempotency.
Sourcepub fn with_correlation_id(self, correlation_id: impl Into<String>) -> Self
pub fn with_correlation_id(self, correlation_id: impl Into<String>) -> Self
Set the correlation ID for grouping related events in a business flow.
See: https://github.com/cloudevents/spec/blob/main/cloudevents/extensions/correlation.md
Sourcepub fn with_causation_id(self, causation_id: impl Into<String>) -> Self
pub fn with_causation_id(self, causation_id: impl Into<String>) -> Self
Set the causation ID for parent-child event relationships.
See: https://github.com/cloudevents/spec/blob/main/cloudevents/extensions/correlation.md
Sourcepub fn content_type(self, content_type: impl Into<String>) -> Self
pub fn content_type(self, content_type: impl Into<String>) -> Self
Sourcepub fn content_schema(self, schema_url: impl Into<String>) -> Self
pub fn content_schema(self, schema_url: impl Into<String>) -> Self
Sourcepub async fn execute(self) -> Result<DatabaseAtRevisionImpl, StateChangeError>
pub async fn execute(self) -> Result<DatabaseAtRevisionImpl, StateChangeError>
Execute the state change synchronously.
Sourcepub async fn execute_async(self) -> Result<CorrelationId, StateChangeError>
pub async fn execute_async(self) -> Result<CorrelationId, StateChangeError>
Execute the state change asynchronously.
Auto Trait Implementations§
impl Freeze for StateChangeBuilder
impl !RefUnwindSafe for StateChangeBuilder
impl Send for StateChangeBuilder
impl Sync for StateChangeBuilder
impl Unpin for StateChangeBuilder
impl !UnwindSafe for StateChangeBuilder
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
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request