Struct novax_executor::TypedScQuery
source · pub struct TypedScQuery<OriginalResult> {
pub sc_query_step: ScQueryStep,
/* private fields */
}Fields§
§sc_query_step: ScQueryStepImplementations§
source§impl<OriginalResult> TypedScQuery<OriginalResult>
impl<OriginalResult> TypedScQuery<OriginalResult>
pub fn function(self, expr: &str) -> TypedScQuery<OriginalResult>
pub fn argument<A>(self, expr: A) -> TypedScQuery<OriginalResult>where BytesValue: From<A>,
pub fn to<A>(self, address: A) -> TypedScQuery<OriginalResult>where AddressValue: From<A>,
sourcepub fn expect(self, expect: TxExpect) -> TypedScQuery<OriginalResult>
pub fn expect(self, expect: TxExpect) -> TypedScQuery<OriginalResult>
Adds a custom expect section to the tx.
sourcepub fn no_expect(self) -> TypedScQuery<OriginalResult>
pub fn no_expect(self) -> TypedScQuery<OriginalResult>
Explicitly states that no tx expect section should be added and no checks should be performed.
Note: by default a basic TxExpect::ok() is added, which checks that status is 0 and nothing else.
sourcepub fn expect_value<ExpectedResult>(
self,
expected_value: ExpectedResult
) -> TypedScQuery<OriginalResult>where
OriginalResult: TopEncodeMulti,
ExpectedResult: CodecFrom<OriginalResult> + TopEncodeMulti,
pub fn expect_value<ExpectedResult>( self, expected_value: ExpectedResult ) -> TypedScQuery<OriginalResult>where OriginalResult: TopEncodeMulti, ExpectedResult: CodecFrom<OriginalResult> + TopEncodeMulti,
Shorthand for creating a tx expect with status “Ok” and the given value.
The given value is type-checked agains the tx return type.
sourcepub fn response(&self) -> &TxResponse
pub fn response(&self) -> &TxResponse
Unwraps the response, if available.
source§impl<OriginalResult> TypedScQuery<OriginalResult>where
OriginalResult: TopEncodeMulti,
impl<OriginalResult> TypedScQuery<OriginalResult>where OriginalResult: TopEncodeMulti,
sourcepub fn execute<E, RequestedResult>(self, executor: &mut E) -> RequestedResultwhere
E: TypedScQueryExecutor,
RequestedResult: CodecFrom<OriginalResult>,
pub fn execute<E, RequestedResult>(self, executor: &mut E) -> RequestedResultwhere E: TypedScQueryExecutor, RequestedResult: CodecFrom<OriginalResult>,
Executes the operation, on the given executor.
Trait Implementations§
source§impl<OriginalResult> AsMut<ScQueryStep> for TypedScQuery<OriginalResult>
impl<OriginalResult> AsMut<ScQueryStep> for TypedScQuery<OriginalResult>
source§fn as_mut(&mut self) -> &mut ScQueryStep
fn as_mut(&mut self) -> &mut ScQueryStep
Converts this type into a mutable reference of the (usually inferred) input type.
source§impl<OriginalResult> Debug for TypedScQuery<OriginalResult>where
OriginalResult: Debug,
impl<OriginalResult> Debug for TypedScQuery<OriginalResult>where OriginalResult: Debug,
source§impl<OriginalResult> Default for TypedScQuery<OriginalResult>where
OriginalResult: Default,
impl<OriginalResult> Default for TypedScQuery<OriginalResult>where OriginalResult: Default,
source§fn default() -> TypedScQuery<OriginalResult>
fn default() -> TypedScQuery<OriginalResult>
Returns the “default value” for a type. Read more
source§impl<OriginalResult> From<ScQueryStep> for TypedScQuery<OriginalResult>
impl<OriginalResult> From<ScQueryStep> for TypedScQuery<OriginalResult>
source§fn from(untyped: ScQueryStep) -> TypedScQuery<OriginalResult>
fn from(untyped: ScQueryStep) -> TypedScQuery<OriginalResult>
Converts to this type from the input type.
source§impl<OriginalResult> From<TypedScQuery<OriginalResult>> for ScQueryStep
impl<OriginalResult> From<TypedScQuery<OriginalResult>> for ScQueryStep
source§fn from(typed: TypedScQuery<OriginalResult>) -> ScQueryStep
fn from(typed: TypedScQuery<OriginalResult>) -> ScQueryStep
Converts to this type from the input type.
Auto Trait Implementations§
impl<OriginalResult> CodecFromSelf for TypedScQuery<OriginalResult>where OriginalResult: CodecFromSelf,
impl<OriginalResult> RefUnwindSafe for TypedScQuery<OriginalResult>where OriginalResult: RefUnwindSafe,
impl<OriginalResult> Send for TypedScQuery<OriginalResult>where OriginalResult: Send,
impl<OriginalResult> Sync for TypedScQuery<OriginalResult>where OriginalResult: Sync,
impl<OriginalResult> Unpin for TypedScQuery<OriginalResult>where OriginalResult: Unpin,
impl<OriginalResult> UnwindSafe for TypedScQuery<OriginalResult>where OriginalResult: UnwindSafe,
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