pub struct ChoiceContext { /* private fields */ }Expand description
A choice context, ready to be used against either transport.
Implementations§
Source§impl ChoiceContext
impl ChoiceContext
Sourcepub fn from_wire(wire: WireChoiceContext) -> Result<Self>
pub fn from_wire(wire: WireChoiceContext) -> Result<Self>
Translate what the registry returned.
§Errors
Error::UnexpectedResponse if a template id is not
<package>:<Module>:<Entity>, or a blob is not valid base64. Both are
the registry’s mistake rather than the caller’s, and both would
otherwise reach the participant as something it cannot parse.
Sourcepub fn decode<T: DeserializeOwned>(&self) -> Result<T>
pub fn decode<T: DeserializeOwned>(&self) -> Result<T>
Decode the context data into a generated type.
The registry encodes it with the Daml JSON API’s rules, which is what
canton-daml implements, so the generated ChoiceContext deserializes
straight from it — no hand-written mapping.
§Errors
Error::UnexpectedResponse if the data does not match T.
Sourcepub fn disclosed_contracts(&self) -> &[DisclosedContract]
pub fn disclosed_contracts(&self) -> &[DisclosedContract]
The contracts to disclose, for a gRPC submission.
Sourcepub fn disclosed_contracts_json(&self) -> &[Value]
pub fn disclosed_contracts_json(&self) -> &[Value]
The contracts to disclose, for the JSON transport.
Sourcepub fn into_disclosed_contracts(self) -> Vec<DisclosedContract>
pub fn into_disclosed_contracts(self) -> Vec<DisclosedContract>
Take ownership of the disclosed contracts, for attaching to a submission.
Trait Implementations§
Source§impl Clone for ChoiceContext
impl Clone for ChoiceContext
Auto Trait Implementations§
impl Freeze for ChoiceContext
impl RefUnwindSafe for ChoiceContext
impl Send for ChoiceContext
impl Sync for ChoiceContext
impl Unpin for ChoiceContext
impl UnsafeUnpin for ChoiceContext
impl UnwindSafe for ChoiceContext
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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::Request