public enum Kind {
case method
case header
case body
case heartbeat
public init?(rawValue: UInt8)
{
switch rawValue {
case 1:
self = .method
case 2:
self = .header
case 3:
self = .body
case 8:
self = .heartbeat
default:
return nil
}
}
public var rawValue: UInt8 {
switch self {
case .method:
return 1
case .header:
return 2
case .body:
return 3
case .heartbeat:
return 8
}
}
}
}
To
public enum Kind: UInt8 {
case method = 1
case header = 2
case body = 3
case heartbeat = 8
}
From
To