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 of std::io::Write that the operation will be emitted to.

  • operation: The operation to be emitted.

  • map_namespace: An instance of the MapNamespace trait 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:

  1. The name of the optional parameters type associated with the operation, if any.
  2. The name of the response type associated with the operation, if any.