pub trait ExportAdapter: Send + Sync {
// Required methods
fn metadata(&self) -> &AdapterMetadata;
fn configure(&mut self, config: AdapterConfig) -> Result<()>;
fn export_instruction(
&self,
instruction: &GaiaInstruction,
) -> Result<Vec<u8>>;
fn export_program(&self, program: &GaiaProgram) -> Result<Vec<u8>>;
fn supports_instruction(&self, instruction: &GaiaInstruction) -> bool;
fn file_extension(&self) -> &str;
// Provided method
fn cleanup(&mut self) -> Result<()> { ... }
}Expand description
统一的导出适配器接口
定义了将Gaia指令和程序导出到特定平台格式的标准接口
Required Methods§
Sourcefn metadata(&self) -> &AdapterMetadata
fn metadata(&self) -> &AdapterMetadata
获取适配器元数据