pub trait ImportAdapter: Send + Sync {
// Required methods
fn metadata(&self) -> &AdapterMetadata;
fn configure(&mut self, config: AdapterConfig) -> Result<()>;
fn import_instruction(&self, data: &[u8]) -> Result<GaiaInstruction>;
fn import_program(&self, data: &[u8]) -> Result<GaiaProgram>;
fn validate_format(&self, data: &[u8]) -> bool;
fn supported_extensions(&self) -> Vec<&str>;
// Provided method
fn cleanup(&mut self) -> Result<()> { ... }
}Expand description
统一的导入适配器接口
定义了从特定平台格式导入到Gaia指令和程序的标准接口
Required Methods§
Sourcefn metadata(&self) -> &AdapterMetadata
fn metadata(&self) -> &AdapterMetadata
获取适配器元数据