pub struct Submission { /* private fields */ }Expand description
A command with its identity fixed, ready to send and to recover.
Built by CantonClient::submission. The three send methods mirror the
client’s own; Submission::recover is the one that has no equivalent
without a handle, because it needs the change ID the send did not return.
Implementations§
Source§impl Submission
impl Submission
Sourcepub fn change_id(&self) -> &ChangeId
pub fn change_id(&self) -> &ChangeId
The command’s complete identity — available before anything is sent.
Sourcepub async fn submit(&self) -> Result<()>
pub async fn submit(&self) -> Result<()>
Submit without waiting (CommandSubmissionService.Submit).
§Errors
Returns an Error if authentication or the RPC
fails. A failure here is ambiguous: use Self::recover.
Sourcepub async fn submit_and_wait(&self) -> Result<SubmitAndWaitResponse>
pub async fn submit_and_wait(&self) -> Result<SubmitAndWaitResponse>
Submit and wait for the completion (CommandService.SubmitAndWait).
§Errors
Returns an Error if authentication fails or the
command is rejected. A transport failure is ambiguous: use
Self::recover.
Sourcepub async fn submit_and_wait_for_transaction(&self) -> Result<Transaction>
pub async fn submit_and_wait_for_transaction(&self) -> Result<Transaction>
Submit and wait for the committed transaction.
§Errors
Returns an Error if authentication fails, the
command is rejected, or the response carries no transaction. A transport
failure is ambiguous: use Self::recover.
Sourcepub async fn recover(
&self,
begin_offset: i64,
timeout: Duration,
) -> Result<Completion>
pub async fn recover( &self, begin_offset: i64, timeout: Duration, ) -> Result<Completion>
Read this command’s outcome back from the completion stream, matching on the whole change ID.
begin_offset must be an offset from before the submission —
CantonClient::ledger_end taken beforehand is the usual source, since
a completion that has already gone past cannot be read again.
§Errors
Returns Error::Timeout if no completion
arrives within timeout (which, for a command that never reached the
participant, is the correct answer), or
Error::CommandRejected if the
ledger rejected it.
Trait Implementations§
Source§impl Clone for Submission
impl Clone for Submission
Source§fn clone(&self) -> Submission
fn clone(&self) -> Submission
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for Submission
impl !UnwindSafe for Submission
impl Freeze for Submission
impl Send for Submission
impl Sync for Submission
impl Unpin for Submission
impl UnsafeUnpin for Submission
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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>
T in a tonic::RequestSource§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>
T in a tonic::Request