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
CPIM
subtype.Declaration
Swift
case CPIM(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
delivery-status
subtype.Declaration
Swift
case deliveryStatus(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
disposition-notification
subtype.Declaration
Swift
case dispositionNotification(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
example
subtype.Declaration
Swift
case example(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
external-body
subtype.Declaration
Swift
case externalBody(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
feedback-report
subtype.Declaration
Swift
case feedbackReport(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
global
subtype.Declaration
Swift
case global(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
global-delivery-status
subtype.Declaration
Swift
case globalDeliveryStatus(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
global-disposition-notification
subtype.Declaration
Swift
case globalDispositionNotification(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
global-headers
subtype.Declaration
Swift
case globalHeaders(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
http
subtype.Declaration
Swift
case http(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
imdn
subtype.Declaration
Swift
case imdn(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
news
subtype.Declaration
Swift
case news(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
partial
subtype.Declaration
Swift
case partial(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
rfc822
subtype.Declaration
Swift
case rfc822(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
s-http
subtype.Declaration
Swift
case sHttp(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
sip
subtype.Declaration
Swift
case sip(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
sipfrag
subtype.Declaration
Swift
case sipfrag(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
tracking-status
subtype.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
Suffix
andParameters
.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)