solana_idl_classic/idl_field.rs
1use serde::{Deserialize, Serialize};
2
3use crate::idl_type::IdlType;
4
5/// A field in a struct, enum variant or [IdlInstruction] args.
6#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
7pub struct IdlField {
8 /// Name of the field.
9 pub name: String,
10
11 /// Type of the field.
12 #[serde(rename = "type")]
13 pub ty: IdlType,
14
15 /// Attributes with which field was annotated.
16 #[serde(skip_serializing_if = "Option::is_none")]
17 pub attrs: Option<Vec<String>>,
18}