pub enum ParamType {
Bytes,
Integer,
Boolean,
UtxoRef,
Address,
List(Box<ParamType>),
Custom(Schema),
}Expand description
Type of a transaction parameter.
This enum represents the various types that transaction parameters can have, including primitives, complex types, and references to TX3 core types.
Variants§
Bytes
Byte array type (hex-encoded).
Integer
Integer type (signed or unsigned).
Boolean
Boolean type.
UtxoRef
UTXO reference in format 0x[64hex]#[index].
Address
Bech32-encoded blockchain address.
List(Box<ParamType>)
List of another parameter type.
Custom(Schema)
Custom JSON schema type.
Implementations§
Source§impl ParamType
impl ParamType
Sourcepub fn from_json_schema(schema: Schema) -> Result<ParamType, Error>
pub fn from_json_schema(schema: Schema) -> Result<ParamType, Error>
Creates a parameter type from a JSON schema.
This method interprets a JSON schema and converts it to the appropriate
ParamType. It handles TX3 core type references (Bytes, Address, UtxoRef)
as well as primitive types.
§Arguments
schema- The JSON schema to convert
§Returns
Returns the corresponding ParamType on success.
§Errors
Returns an error if the schema cannot be mapped to a known parameter type.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ParamType
impl RefUnwindSafe for ParamType
impl Send for ParamType
impl Sync for ParamType
impl Unpin for ParamType
impl UnsafeUnpin for ParamType
impl UnwindSafe for ParamType
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