Struct indy_vdr::pool::PreparedRequest

source ·
pub struct PreparedRequest {
    pub protocol_version: ProtocolVersion,
    pub txn_type: String,
    pub req_id: String,
    pub req_json: Value,
    pub method: RequestMethod,
}
Expand description

A ledger transaction request which has been prepared for dispatch

Fields§

§protocol_version: ProtocolVersion

The protocol version used in pool communication

§txn_type: String

The numeric transaction type

§req_id: String

The numeric transaction request ID

§req_json: Value

The request body as a serde_json::Value instance

§method: RequestMethod

Determine the request handler to use

Implementations§

source§

impl PreparedRequest

source

pub fn new( protocol_version: ProtocolVersion, txn_type: String, req_id: String, req_json: SJsonValue, method: Option<RequestMethod> ) -> Self

Create a new PreparedRequest

source

pub fn get_cache_key(&self) -> VdrResult<String>

source

pub fn get_signature_input(&self) -> VdrResult<String>

Generate the normalized representation of a transaction for signing the request

source

pub fn set_endorser(&mut self, endorser: &DidValue) -> VdrResult<()>

Assign the endorser property of the prepared request

source

pub fn set_signature(&mut self, signature: &[u8]) -> VdrResult<()>

Assign the signature property of the prepared request

source

pub fn set_multi_signature( &mut self, identifier: &DidValue, signature: &[u8] ) -> VdrResult<()>

Add a signature to the prepared request

source

pub fn set_txn_author_agreement_acceptance( &mut self, acceptance: &TxnAuthrAgrmtAcceptanceData ) -> VdrResult<()>

Decorate the prepared request with the transaction author agreement acceptance

source

pub fn from_request_json<T: AsRef<[u8]>>( message: T ) -> VdrResult<PreparedRequest>

Construct a prepared request from user-provided JSON

source

pub fn from_request_json_ext( req_json: SJsonValue, auto_pop: bool, method: Option<RequestMethod> ) -> VdrResult<PreparedRequest>

Construct a prepared request from user-provided JSON

Trait Implementations§

source§

impl Debug for PreparedRequest

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V