pub struct PythonBackend;Expand description
Python code generation backend (skeleton).
Trait Implementations§
Source§impl CodegenBackend for PythonBackend
impl CodegenBackend for PythonBackend
Source§fn map_type(&self, capnp_type: &str) -> String
fn map_type(&self, capnp_type: &str) -> String
Map a Cap’n Proto type name to the target language’s type. Read more
Source§fn setter_method(&self, _type_name: &str) -> Option<String>
fn setter_method(&self, _type_name: &str) -> Option<String>
Return the setter method name on a builder for this type, if the runtime
supports a direct method call. Returns
None for types handled specially
(struct pointers, enum ordinals, etc.).Source§fn getter_expr(&self, reader_var: &str, field: &FieldDef) -> String
fn getter_expr(&self, reader_var: &str, field: &FieldDef) -> String
Return an expression that reads a field’s value from a reader variable.
Source§fn default_value(&self, capnp_type: &str) -> String
fn default_value(&self, capnp_type: &str) -> String
Return the default value expression for a type (used for optional field coalescing).
Source§fn generate_service_file(
&self,
service_name: &str,
_schema: &ParsedSchema,
) -> String
fn generate_service_file( &self, service_name: &str, _schema: &ParsedSchema, ) -> String
Generate the complete source file content for a service schema.
Source§fn runtime_file(&self) -> (String, String)
fn runtime_file(&self) -> (String, String)
Return
(filename, content) for the shared runtime file included in all output. Read moreSource§fn file_extension(&self) -> &str
fn file_extension(&self) -> &str
Return the file extension for generated service files (e.g.,
"ts", "py").Auto Trait Implementations§
impl Freeze for PythonBackend
impl RefUnwindSafe for PythonBackend
impl Send for PythonBackend
impl Sync for PythonBackend
impl Unpin for PythonBackend
impl UnsafeUnpin for PythonBackend
impl UnwindSafe for PythonBackend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more