pub trait IdlBuild {
// Provided methods
fn __anchor_private_full_path() -> String { ... }
fn __anchor_private_gen_idl_type() -> Option<IdlTypeDefinition> { ... }
fn __anchor_private_insert_idl_defined(
_defined_types: &mut HashMap<String, IdlTypeDefinition>,
) { ... }
}
Expand description
A trait that types must implement in order to generate the IDL via compilation.
This trait is automatically implemented for Anchor all types that use the AnchorSerialize
proc macro. Note that manually implementing the AnchorSerialize
trait will NOT have the
same effect.
Types that don’t implement this trait will cause a compile error during the IDL generation.
The methods have default implementation that allows the program to compile but the type will NOT be included in the IDL.
Provided Methods§
Sourcefn __anchor_private_full_path() -> String
fn __anchor_private_full_path() -> String
Returns the full module path of the type.
Sourcefn __anchor_private_gen_idl_type() -> Option<IdlTypeDefinition>
fn __anchor_private_gen_idl_type() -> Option<IdlTypeDefinition>
Returns the IDL type definition of the type or None
if it doesn’t exist.
Sourcefn __anchor_private_insert_idl_defined(
_defined_types: &mut HashMap<String, IdlTypeDefinition>,
)
fn __anchor_private_insert_idl_defined( _defined_types: &mut HashMap<String, IdlTypeDefinition>, )
Insert the type definition to the defined types hashmap.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.