oaspec/util/content_type

Types

Supported content types for code generation.

pub type ContentType {
  ApplicationJson
  TextPlain
  MultipartFormData
  FormUrlEncoded
  ApplicationOctetStream
  ApplicationXml
  TextXml
  UnsupportedContentType(String)
}

Constructors

  • ApplicationJson
  • TextPlain
  • MultipartFormData
  • FormUrlEncoded
  • ApplicationOctetStream
  • ApplicationXml
  • TextXml
  • UnsupportedContentType(String)

Values

pub fn from_string(content_type: String) -> ContentType

Parse a content type string into a ContentType.

pub fn is_supported(content_type: ContentType) -> Bool

Check if a content type is supported anywhere in code generation.

pub fn is_supported_request(content_type: ContentType) -> Bool

Check if a content type is supported for request bodies.

pub fn is_supported_response(content_type: ContentType) -> Bool

Check if a content type is supported for responses.

pub fn to_string(content_type: ContentType) -> String

Convert a ContentType back to its string representation.

Search Document