Slide 147
Slide 147 text
Copyright © 2025 treastrain / Tanaka RyogaɹAll rights reserved. 147
@available(macOS 12.0, iOS 15.0, tvOS 15.0, watchOS 8.0, *)
public protocol ParseableFormatStyle : FormatStyle {
associatedtype Strategy : ParseStrategy where
Self.FormatInput == Self.Strategy.ParseOutput,
Self.FormatOutput == Self.Strategy.ParseInput
var parseStrategy: Self.Strategy { get }
}
@available(macOS 12.0, iOS 15.0, tvOS 15.0, watchOS 8.0, *)
public protocol ParseStrategy : Decodable, Encodable, Hashable {
associatedtype ParseInput
associatedtype ParseOutput
func parse(_ value: Self.ParseInput) throws -> Self.ParseOutput
}