logo
pub struct DamlCommandService<'a> { /* private fields */ }
Expand description

Submit commands to a Daml ledger and await the completion.

The Command Service is able to correlate submitted commands with completion data, identify timeouts, and return contextual information with each tracking result. This supports the implementation of stateless clients.

Implementations

Create a DamlCommandService for a given GRPC channel and ledger_id.

Override the JWT token to use for this service.

Override the ledger id to use for this service.

Submits a composite DamlCommands and await the completion.

This method executes commands synchronously on the ledger server (unlike the DamlCommandSubmissionService which is executed asynchronously on the ledger server). This service only waits for the completion of the execution of the command, not the propagation of any resulting events which must be consumed via the DamlTransactionService.

Note that this method is executed asynchronously on the client side and so will immediately return a future which must be driven to completion before a result can be observed.

Errors

Propagates communication failure errors as GrpcTransportError and Daml server failures as GRPCStatusError errors.

Examples
futures::executor::block_on(async {
let ledger_client = DamlGrpcClientBuilder::uri("http://127.0.0.1").connect().await?;
let future_command = ledger_client.command_service().submit_and_wait(commands).await;
match future_command {
    Ok(command_id) => assert_eq!("1234", command_id),
    Err(e) => panic!("submit_and_wait failed, error was {}", e.to_string()),
}

Submits a composite DamlCommands and returns the resulting transaction id.

DOCME fully document this TODO ugly API returning a tuple as completion_offset was recently added, refactor

Submits a composite DamlCommands and returns the resulting DamlTransaction.

DOCME fully document this TODO ugly API returning a tuple as completion_offset was recently added, refactor

Submits a composite DamlCommands and returns the resulting DamlTransactionTree. DOCME fully document this TODO ugly API returning a tuple as completion_offset was recently added, refactor

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Wrap the input message T in a tonic::Request

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more