Function k8s_openapi_codegen_common::write_operation
source · pub fn write_operation(
out: impl Write,
operation: &Operation,
map_namespace: &impl MapNamespace,
vis: &str,
type_name: Option<&str>,
operation_feature: Option<&str>
) -> Result<(Option<String>, Option<String>), Error>Expand description
Each invocation of this function generates a single API operation function specified by the operation parameter.
Parameters
-
out: An impl ofstd::io::Writethat the operation will be emitted to. -
operation: The operation to be emitted. -
map_namespace: An instance of theMapNamespacetrait that controls how OpenAPI namespaces of the definitions are mapped to rust namespaces. -
vis: The visibility modifier that should be emitted on the generated code. -
type_name: The name of the type that this operation is associated with, if any. -
operation_feature: Specifies whether the API function will be emitted with a#[cfg(feature = "<this value>")]attribute or not.
Returns
A tuple of two optional strings:
- The name of the optional parameters type associated with the operation, if any.
- The name of the response type associated with the operation, if any.