Struct TransactionReport
pub struct TransactionReport {
pub receipts: Vec<Report>,
pub client_request_id: Option<Arc<str>>,
pub timestamp_ms: u64,
pub success: bool,
pub errors: Option<HashMap<String, Errors>>,
pub rate_limit: RateLimitInfo,
pub warnings: Vec<Warning>,
}Expand description
A comprehensive report of a transaction containing one or more trading operations.
This structure aggregates multiple operation receipts (order submissions, cancellations) into a single transaction report with overall success/failure status, timestamp, and optional error details.
Fields§
§receipts: Vec<Report>Individual receipts for each operation in this transaction. Omitted from serialization if empty.
client_request_id: Option<Arc<str>>Optional client-provided request ID for tracking and correlation. Omitted from serialization if None.
timestamp_ms: u64When the report was generated, in milliseconds since the Unix epoch.
success: boolWhether the transaction was admitted and executed.
true once the engine has run it; false only when admission rejected
the whole transaction, in which case receipts is empty and errors is
populated. An individual order the engine refuses still arrives under
success: true, as a receipt whose order.status is Rejected and whose
order.error says why — check the receipts, not just this flag.
errors: Option<HashMap<String, Errors>>Detailed error information if the transaction failed. Maps error identifiers to specific error details. Omitted from serialization if None.
rate_limit: RateLimitInfoRate-limit snapshot captured at admission time. Always present so clients can pace requests on every outcome (success, validation error, rate-limit rejection).
warnings: Vec<Warning>Conditions this transaction was accepted with but that a future release
will reject — see [crate::api::warnings]. Each carries the release it
becomes an error in. Omitted from serialization when empty, so a client
that never triggers one never sees the field.
Implementations§
§impl TransactionReport
impl TransactionReport
pub fn new_error(
client_request_id: Option<Arc<str>>,
errors: HashMap<String, Errors>,
rate_limit: RateLimitInfo,
) -> TransactionReport
pub fn new_error( client_request_id: Option<Arc<str>>, errors: HashMap<String, Errors>, rate_limit: RateLimitInfo, ) -> TransactionReport
Creates a new error transaction report.
Use this constructor when a transaction fails due to validation errors, system errors, or other issues preventing successful execution.
§Arguments
client_request_id- Optional client request ID for trackingerrors- Map of error identifiers to error details
§Returns
A TransactionReport with success: false, the current timestamp,
and no receipts.
pub fn new_success(
client_request_id: Option<Arc<str>>,
receipts: Vec<Report>,
rate_limit: RateLimitInfo,
) -> TransactionReport
pub fn new_success( client_request_id: Option<Arc<str>>, receipts: Vec<Report>, rate_limit: RateLimitInfo, ) -> TransactionReport
Creates a new success transaction report.
Use this constructor when a transaction completes successfully, potentially with one or more operation receipts.
§Arguments
client_request_id- Optional client request ID for trackingreceipts- Vector of operation receipts (orders placed, canceled, etc.)
§Returns
A TransactionReport with success: true, the current timestamp,
and no errors.
§Example
use types::api::transaction_report::{TransactionReport, Report};
use types::api::RateLimitInfo;
use types::core::AccountId;
let rate_limit = RateLimitInfo {
account_id: AccountId::default(),
account_remaining: 0,
account_burst: 0,
account_reset_secs: 0,
global_remaining: 0,
global_burst: 0,
global_reset_secs: 0,
is_exempt: false,
retry_after_ms: None,
rejected_by: None,
};
let receipts = vec![]; // Would contain actual receipts
let report = TransactionReport::new_success(
Some("req-456".into()),
receipts,
rate_limit,
);
assert!(report.success);
assert!(report.errors.is_none());pub fn with_warnings(self, warnings: Vec<Warning>) -> TransactionReport
pub fn with_warnings(self, warnings: Vec<Warning>) -> TransactionReport
Attaches advisories to a report.
A setter rather than a constructor parameter: new_success / new_error
are public SDK API, and most reports carry no warnings, so call sites stay
untouched.
let report = TransactionReport::new_success(client_request_id, receipts, rate_limit)
.with_warnings(warnings);Trait Implementations§
§impl Clone for TransactionReport
impl Clone for TransactionReport
§fn clone(&self) -> TransactionReport
fn clone(&self) -> TransactionReport
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for TransactionReport
impl Debug for TransactionReport
§impl<'de> Deserialize<'de> for TransactionReport
impl<'de> Deserialize<'de> for TransactionReport
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TransactionReport, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TransactionReport, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Serialize for TransactionReport
impl Serialize for TransactionReport
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for TransactionReport
impl RefUnwindSafe for TransactionReport
impl Send for TransactionReport
impl Sync for TransactionReport
impl Unpin for TransactionReport
impl UnsafeUnpin for TransactionReport
impl UnwindSafe for TransactionReport
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
U: Sized,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
U: Sized,
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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,
§impl<T> Conv for T
impl<T> Conv for T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].impl<T> MaybeSend for Twhere
T: Send,
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.