pub trait PythonWriter {
Show 26 methods
// Required methods
fn config(&self) -> &Config;
fn inventory(&self) -> &Inventory;
fn converter(&self) -> &Converter;
// Provided methods
fn write_imports(&self, w: &mut IndentWriter<'_>) -> Result<(), Error> { ... }
fn write_api_load_fuction(
&self,
w: &mut IndentWriter<'_>,
) -> Result<(), Error> { ... }
fn write_constants(&self, w: &mut IndentWriter<'_>) -> Result<(), Error> { ... }
fn write_types(&self, w: &mut IndentWriter<'_>) -> Result<(), Error> { ... }
fn write_struct(
&self,
w: &mut IndentWriter<'_>,
c: &CompositeType,
write_for: WriteFor,
) -> Result<(), Error> { ... }
fn write_enum(
&self,
w: &mut IndentWriter<'_>,
e: &EnumType,
write_for: WriteFor,
) -> Result<(), Error> { ... }
fn write_callback_helpers(
&self,
w: &mut IndentWriter<'_>,
) -> Result<(), Error> { ... }
fn write_function_proxies(
&self,
w: &mut IndentWriter<'_>,
) -> Result<(), Error> { ... }
fn write_function(
&self,
w: &mut IndentWriter<'_>,
function: &Function,
write_for: WriteFor,
) -> Result<(), Error> { ... }
fn write_param_helpers(
&self,
w: &mut IndentWriter<'_>,
function: &Function,
) -> Result<(), Error> { ... }
fn write_slice(
&self,
w: &mut IndentWriter<'_>,
c: &CompositeType,
mutable: bool,
) -> Result<(), Error> { ... }
fn write_option(
&self,
w: &mut IndentWriter<'_>,
c: &CompositeType,
) -> Result<(), Error> { ... }
fn write_patterns(&self, w: &mut IndentWriter<'_>) -> Result<(), Error> { ... }
fn write_pattern_class(
&self,
w: &mut IndentWriter<'_>,
class: &Service,
) -> Result<(), Error> { ... }
fn write_pattern_class_ctor(
&self,
w: &mut IndentWriter<'_>,
class: &Service,
ctor: &Function,
write_for: WriteFor,
) -> Result<(), Error> { ... }
fn write_pattern_class_method(
&self,
w: &mut IndentWriter<'_>,
class: &Service,
function: &Function,
write_for: WriteFor,
) -> Result<(), Error> { ... }
fn write_library_call(
&self,
w: &mut IndentWriter<'_>,
function: &Function,
class_str: Option<&str>,
) -> Result<(), Error> { ... }
fn function_args_to_string(
&self,
function: &Function,
type_hints: bool,
skip_first: bool,
) -> String { ... }
fn write_success_enum_aware_rval(
&self,
w: &mut IndentWriter<'_>,
function: &Function,
args: &str,
ret: bool,
) -> Result<(), Error> { ... }
fn get_method_args(&self, function: &Function, ctx: &str) -> String { ... }
fn write_utils(&self, w: &mut IndentWriter<'_>) -> Result<(), Error> { ... }
fn write_utils_primitive(
&self,
_: &mut IndentWriter<'_>,
_: PrimitiveType,
) -> Result<(), Error> { ... }
fn write_all(&self, w: &mut IndentWriter<'_>) -> Result<(), Error> { ... }
}Expand description
Writes the Python file format, impl this trait to customize output.