pub trait Nl2SqlEngine: Send + Sync {
// Required methods
fn generate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
nl_query: &'life1 str,
schema: &'life2 SchemaContext,
) -> Pin<Box<dyn Future<Output = Result<SqlQuery, Nl2SqlError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn validate<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 SqlQuery,
) -> Pin<Box<dyn Future<Output = Result<bool, Nl2SqlError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
NL→SQL 引擎 trait
所有 NL→SQL 实现必须实现此 trait,以保证一致的接口。
Required Methods§
Sourcefn generate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
nl_query: &'life1 str,
schema: &'life2 SchemaContext,
) -> Pin<Box<dyn Future<Output = Result<SqlQuery, Nl2SqlError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn generate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
nl_query: &'life1 str,
schema: &'life2 SchemaContext,
) -> Pin<Box<dyn Future<Output = Result<SqlQuery, Nl2SqlError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".