pub trait ProtoProcessor: Send + Sync {
// Required methods
fn discover_proto_files<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<Vec<ProtoFile>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn parse_proto_services<'life0, 'life1, 'async_trait>(
&'life0 self,
files: &'life1 [ProtoFile],
) -> Pin<Box<dyn Future<Output = Result<Vec<ServiceDefinition>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn generate_code<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
input: &'life1 Path,
output: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<GenerationResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn validate_proto_syntax<'life0, 'life1, 'async_trait>(
&'life0 self,
files: &'life1 [ProtoFile],
) -> Pin<Box<dyn Future<Output = Result<ValidationReport>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Protocol Buffers 文件处理
Required Methods§
Sourcefn discover_proto_files<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<Vec<ProtoFile>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn discover_proto_files<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<Vec<ProtoFile>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
发现Proto文件
Sourcefn parse_proto_services<'life0, 'life1, 'async_trait>(
&'life0 self,
files: &'life1 [ProtoFile],
) -> Pin<Box<dyn Future<Output = Result<Vec<ServiceDefinition>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn parse_proto_services<'life0, 'life1, 'async_trait>(
&'life0 self,
files: &'life1 [ProtoFile],
) -> Pin<Box<dyn Future<Output = Result<Vec<ServiceDefinition>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
解析Proto服务
Sourcefn generate_code<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
input: &'life1 Path,
output: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<GenerationResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn generate_code<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
input: &'life1 Path,
output: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<GenerationResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
生成代码
Sourcefn validate_proto_syntax<'life0, 'life1, 'async_trait>(
&'life0 self,
files: &'life1 [ProtoFile],
) -> Pin<Box<dyn Future<Output = Result<ValidationReport>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn validate_proto_syntax<'life0, 'life1, 'async_trait>(
&'life0 self,
files: &'life1 [ProtoFile],
) -> Pin<Box<dyn Future<Output = Result<ValidationReport>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
验证Proto语法