Message
public enum Message
extension Message: CustomStringConvertible
extension Message: RawRepresentable
extension Message: MediaSubtype
extension Message: Hashable
Represents the message media type. See the
official documentation for details.
You typically use Message as a MediaType.
let message = Message.http()
let mediaType = MediaType.message(message) // Creates: message/http
You can use standard switch statement to access message values.
func isSupported(message: Message) -> Bool {
switch message {
case .http, .rfc822: return true
default: return false
}
}
isSupported(audio: .http()) // Returns: true
isSupported(audio: .rfc822()) // Returns: true
isSupported(audio: .sip()) // Returns: false
See also
MediaType
-
Represents the
CPIMsubtype.Declaration
Swift
case CPIM(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
delivery-statussubtype.Declaration
Swift
case deliveryStatus(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
disposition-notificationsubtype.Declaration
Swift
case dispositionNotification(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
examplesubtype.Declaration
Swift
case example(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
external-bodysubtype.Declaration
Swift
case externalBody(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
feedback-reportsubtype.Declaration
Swift
case feedbackReport(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
globalsubtype.Declaration
Swift
case global(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
global-delivery-statussubtype.Declaration
Swift
case globalDeliveryStatus(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
global-disposition-notificationsubtype.Declaration
Swift
case globalDispositionNotification(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
global-headerssubtype.Declaration
Swift
case globalHeaders(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
httpsubtype.Declaration
Swift
case http(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
imdnsubtype.Declaration
Swift
case imdn(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
newssubtype.Declaration
Swift
case news(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
partialsubtype.Declaration
Swift
case partial(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
rfc822subtype.Declaration
Swift
case rfc822(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
s-httpsubtype.Declaration
Swift
case sHttp(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
sipsubtype.Declaration
Swift
case sip(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
sipfragsubtype.Declaration
Swift
case sipfrag(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
tracking-statussubtype.Declaration
Swift
case trackingStatus(_: Suffix? = nil, _: Parameters? = nil) -
Represents a subtype that does not fit in the other cases or is currently not officially defined.
You can use this case to define an arbitrary, unregistered subtype with the given name or to represent a subtype in the non standard tree, e.g. vendor tree or personal tree.
Optionally, you can specify a
SuffixandParameters.Declaration
Swift
case other(String, _: Suffix? = nil, _: Parameters? = nil) -
Declaration
Swift
case anything(_: Suffix? = nil, _: Parameters? = nil) -
Declaration
Swift
public var description: String { get } -
Declaration
Swift
public init(rawValue: String) -
Declaration
Swift
public var rawValue: String { get } -
Declaration
Swift
public var type: MediaType { get } -
Declaration
Swift
public static func == (lhs: `Self`, rhs: `Self`) -> Bool -
Declaration
Swift
public func hash(into hasher: inout Hasher)