xrpl_hooks/api/
trace.rs

1use super::*;
2
3/// Write the contents of a buffer to the XRPLD trace log
4#[inline(always)]
5pub fn trace(msg: &[u8], data: &[u8], data_repr: DataRepr) -> Result<u64> {
6    let res = unsafe {
7        _c::trace(
8            msg.as_ptr() as u32,
9            msg.len() as u32,
10            data.as_ptr() as u32,
11            data.len() as u32,
12            data_repr as _,
13        )
14    };
15
16    result_u64(res)
17}
18
19/// Write the contents of a slot to the XRPLD trace log
20#[inline(always)]
21pub fn trace_slot(msg: &[u8], slot: u32) -> Result<u64> {
22    let res = unsafe { _c::trace_slot(msg.as_ptr() as u32, msg.len() as u32, slot) };
23
24    result_u64(res)
25}
26
27/// Write an integer to the XRPLD trace log
28#[inline(always)]
29pub fn trace_num(msg: &[u8], number: i64) -> Result<u64> {
30    let res = unsafe { _c::trace_num(msg.as_ptr() as u32, msg.len() as u32, number) };
31
32    result_u64(res)
33}
34
35/// Write a XFL float to the XRPLD trace log
36#[inline(always)]
37pub fn trace_float(msg: &[u8], float: XFL) -> Result<u64> {
38    let res = unsafe { _c::trace_float(msg.as_ptr() as u32, msg.len() as u32, float.0) };
39
40    result_u64(res)
41}