ProtoProcessor

Trait ProtoProcessor 

Source
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§

Source

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文件

Source

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服务

Source

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,

生成代码

Source

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语法

Implementors§