pub struct JsonCommands { /* private fields */ }Expand description
A set of commands to submit over the JSON transport (dynamic path).
Build with JsonCommands::new then add commands (JsonCommands::add_create
or JsonCommands::add_command) and optional metadata. command_id
defaults to a fresh UUID so ledger-side de-duplication behaves correctly.
Implementations§
Source§impl JsonCommands
impl JsonCommands
Sourcepub fn new(act_as: Vec<String>) -> Self
pub fn new(act_as: Vec<String>) -> Self
Start a command set acting as act_as, with a generated command_id
and no commands yet.
Sourcepub fn with_command_id(self, command_id: impl Into<String>) -> Self
pub fn with_command_id(self, command_id: impl Into<String>) -> Self
Set an explicit change-ID command_id (for exactly-once / de-duplication).
Sourcepub fn change_id(&self) -> ChangeId
pub fn change_id(&self) -> ChangeId
This command set’s complete identity — available before it is sent, and the only way back to the outcome of a submission whose result was lost.
Sourcepub fn with_user_id(self, user_id: impl Into<String>) -> Self
pub fn with_user_id(self, user_id: impl Into<String>) -> Self
Set the acting user id (defaults to the one derived from the token).
Sourcepub fn with_read_as(self, read_as: Vec<String>) -> Self
pub fn with_read_as(self, read_as: Vec<String>) -> Self
Add read-as parties.
Sourcepub fn with_workflow_id(self, workflow_id: impl Into<String>) -> Self
pub fn with_workflow_id(self, workflow_id: impl Into<String>) -> Self
Set the workflow id.
Sourcepub fn with_synchronizer_id(self, synchronizer_id: impl Into<String>) -> Self
pub fn with_synchronizer_id(self, synchronizer_id: impl Into<String>) -> Self
Pin the submission to a specific synchronizer.
Sourcepub fn add_create(
self,
template_id: impl Into<String>,
create_arguments: Value,
) -> Self
pub fn add_create( self, template_id: impl Into<String>, create_arguments: Value, ) -> Self
Add a CreateCommand for template_id ("<pkg>:<Module>:<Entity>") with
create_arguments in Daml-LF JSON (a record is an object keyed by field).
Sourcepub fn add_command(self, command: Value) -> Self
pub fn add_command(self, command: Value) -> Self
Add a raw command value (e.g. an ExerciseCommand), for shapes the
convenience builders don’t cover.
Sourcepub fn with_submission_id(self, submission_id: impl Into<String>) -> Self
pub fn with_submission_id(self, submission_id: impl Into<String>) -> Self
Set an explicit submission id, to correlate this particular submission attempt in completions. Defaults to participant-generated.
Sourcepub fn add_disclosed_contract(self, contract: Value) -> Self
pub fn add_disclosed_contract(self, contract: Value) -> Self
Attach a disclosed contract (raw JSON: {"templateId": …, "contractId": …, "createdEventBlob": …, "synchronizerId": …}, with the
blob obtained from a read with created-event blobs enabled). May be
called repeatedly.
Sourcepub fn with_package_id_selection_preference(
self,
package_ids: Vec<String>,
) -> Self
pub fn with_package_id_selection_preference( self, package_ids: Vec<String>, ) -> Self
Restrict package selection for interpretation to these package ids (at most one preference per package name) — the SCU upgrade pin.
Sourcepub fn with_deduplication_period(self, period: Value) -> Self
pub fn with_deduplication_period(self, period: Value) -> Self
Set the de-duplication period (raw JSON, e.g.
{"DeduplicationDuration": {"value": {"duration": "5s"}}}), matching
the JSON API’s deduplicationPeriod encoding.
Sourcepub fn with_min_ledger_time_abs(self, time: Value) -> Self
pub fn with_min_ledger_time_abs(self, time: Value) -> Self
Set the absolute lower bound for the ledger-effective time (raw JSON,
an ISO-8601 timestamp string). Mutually exclusive with
Self::with_min_ledger_time_rel.
Sourcepub fn with_min_ledger_time_rel(self, duration: Value) -> Self
pub fn with_min_ledger_time_rel(self, duration: Value) -> Self
Set the relative lower bound for the ledger-effective time (raw JSON,
a proto duration like "5s"). Mutually exclusive with
Self::with_min_ledger_time_abs.
Trait Implementations§
Source§impl Clone for JsonCommands
impl Clone for JsonCommands
Source§fn clone(&self) -> JsonCommands
fn clone(&self) -> JsonCommands
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for JsonCommands
impl Debug for JsonCommands
Auto Trait Implementations§
impl Freeze for JsonCommands
impl RefUnwindSafe for JsonCommands
impl Send for JsonCommands
impl Sync for JsonCommands
impl Unpin for JsonCommands
impl UnsafeUnpin for JsonCommands
impl UnwindSafe for JsonCommands
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