pub trait ProtobufGenerator {
// Required methods
fn generate_messages(&self, schema: &ProtobufSchema) -> Result<String>;
fn generate_services(&self, schema: &ProtobufSchema) -> Result<String>;
// Provided method
fn generate_complete(&self, schema: &ProtobufSchema) -> Result<String> { ... }
}Expand description
Language-agnostic Protobuf code generator trait
Implementations provide language-specific code generation for:
- Message type definitions and serialization
- Service client and server implementations
- RPC method stubs and handlers
Required Methods§
Sourcefn generate_messages(&self, schema: &ProtobufSchema) -> Result<String>
fn generate_messages(&self, schema: &ProtobufSchema) -> Result<String>
Generate message definitions and serialization code
Sourcefn generate_services(&self, schema: &ProtobufSchema) -> Result<String>
fn generate_services(&self, schema: &ProtobufSchema) -> Result<String>
Generate service definitions and RPC implementations
Provided Methods§
Sourcefn generate_complete(&self, schema: &ProtobufSchema) -> Result<String>
fn generate_complete(&self, schema: &ProtobufSchema) -> Result<String>
Generate complete code (messages, services, and utilities)