#[repr(C)]pub enum Issue {
XRP(XrpIssue),
IOU(IouIssue),
MPT(MptIssue),
}Expand description
Represents an issue without a value, such as reading Asset1 and Asset2 in AMM ledger
objects.
§Derived Traits
PartialEq, Eq: Enable comparisons and use in collectionsDebug, Clone: Standard traits for development and consistency
Note: Copy is intentionally not derived because the IOU variant is 40 bytes.
Variants§
Implementations§
Source§impl Issue
impl Issue
pub fn as_bytes(&self) -> &[u8] ⓘ
Sourcepub fn from_buffer(buffer: [u8; 40], len: usize) -> Result<Self>
pub fn from_buffer(buffer: [u8; 40], len: usize) -> Result<Self>
Creates an Issue from a buffer and length, detecting the type based on the byte count.
§Arguments
buffer- A 40-byte buffer containing the issue datalen- The actual number of bytes written to the buffer
§Returns
Returns Result<Issue> where:
Ok(Issue::XRP(...))- If len is 20 (XRP issue)Ok(Issue::MPT(...))- If len is 24 (MPT issue)Ok(Issue::IOU(...))- If len is 40 (IOU issue)Err(Error)- If len is not one of the expected values
Trait Implementations§
impl Eq for Issue
Source§impl FieldDecoder for Issue
FieldDecoder for XRPL issues. The host writes a variable number of bytes into the fixed
40-byte buffer — 20 for XRP, 24 for MPT, 40 for IOU — and the variant is detected from
bytes_written (see Issue::from_buffer); a count that matches none of those is a decode
error.
impl FieldDecoder for Issue
FieldDecoder for XRPL issues. The host writes a variable number of bytes into the fixed
40-byte buffer — 20 for XRP, 24 for MPT, 40 for IOU — and the variant is detected from
bytes_written (see Issue::from_buffer); a count that matches none of those is a decode
error.
impl FromLedger for Issue
impl StructuralPartialEq for Issue
Auto Trait Implementations§
impl Freeze for Issue
impl RefUnwindSafe for Issue
impl Send for Issue
impl Sync for Issue
impl Unpin for Issue
impl UnsafeUnpin for Issue
impl UnwindSafe for Issue
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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