Skip to main content

generate_services

Function generate_services 

Source
pub fn generate_services(
    proto_file: &[FileDescriptorProto],
    file_to_generate: &[String],
    options: &Options,
) -> Result<Vec<GeneratedFile>>
Expand description

Generate only ConnectRPC service bindings from proto descriptors.

Returns one GeneratedFile per proto file in file_to_generate that declares at least one service. No message types, no mod.rs.

This is the split path: service stubs reference message types via absolute Rust paths derived from Options::extern_paths. Callers must set at least a . catch-all entry (e.g. (".", "crate::proto")) so every type resolves; the auto-injected WKT mapping still takes priority via longest-prefix-match. The generated code compiles standalone as long as the extern paths point at a buffa-generated module tree.

ยงErrors

Errors if any method input/output type is not covered by an extern_path mapping, or is absent from proto_file (missing import).