pub struct Schema {
pub name: String,
pub version: u32,
pub chains: Vec<String>,
pub address: Option<Vec<String>>,
pub event: String,
pub fingerprint: EventFingerprint,
pub supersedes: Option<String>,
pub superseded_by: Option<String>,
pub deprecated: bool,
pub fields: Vec<(String, FieldDef)>,
pub meta: SchemaMeta,
}Expand description
A parsed, validated schema definition. This is the in-memory representation of a CSDL file.
Fields§
§name: StringPascalCase schema name, e.g. “UniswapV3Swap”
version: u32Schema version (increments on breaking changes)
chains: Vec<String>Chains this schema applies to (by slug)
address: Option<Vec<String>>Contract address(es) — None means “any address”
event: StringThe blockchain event name, e.g. “Swap”
fingerprint: EventFingerprintFingerprint: keccak256 of the event signature (EVM) or SHA-256 (non-EVM)
supersedes: Option<String>Optional: the schema this one supersedes
superseded_by: Option<String>Optional: forward pointer to a successor schema
deprecated: boolWhether this schema is deprecated
fields: Vec<(String, FieldDef)>Ordered field definitions (order matters for ABI decode)
meta: SchemaMetaMetadata
Implementations§
Source§impl Schema
impl Schema
Sourcepub fn fields_map(&self) -> HashMap<&str, &FieldDef>
pub fn fields_map(&self) -> HashMap<&str, &FieldDef>
Returns field definitions as a lookup map (name → def).
Sourcepub fn indexed_fields(&self) -> Vec<(&str, &FieldDef)>
pub fn indexed_fields(&self) -> Vec<(&str, &FieldDef)>
Returns only the indexed fields (EVM topics[1..]).
Sourcepub fn data_fields(&self) -> Vec<(&str, &FieldDef)>
pub fn data_fields(&self) -> Vec<(&str, &FieldDef)>
Returns only the non-indexed fields (EVM data payload).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Schema
impl<'de> Deserialize<'de> for Schema
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Schema
impl RefUnwindSafe for Schema
impl Send for Schema
impl Sync for Schema
impl Unpin for Schema
impl UnsafeUnpin for Schema
impl UnwindSafe for Schema
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