StorageCrypto Documentation

Structure Response

public struct Response<Input, Output>  

A struct defining the response transformation.

Initializers

init(_:​)

public init(_ content: @escaping (Input) throws -> Output)  

Init.

Parameters

content @escaping (Input) throws -> Output

A valid content factory.

init(_:​)

public init(_ content: @escaping (Data) throws -> Output) where Input == DefaultResponse  

Init.

Parameters

content @escaping (Data) throws -> Output

A simplified content factory, only accounting for the actual output.

init(_:​decoder:​)

public init(
        _ output: Output.Type,
        decoder: JSONDecoder = .init()
    ) where Input == DefaultResponse, Output: Decodable  

Init.

Parameters

output Output.​Type

The Output type.

decoder JSONDecoder

A valid JSONDecoder. Defaults to .init.

init(_:​decoder:​)

public init<D: TopLevelDecoder>(
        _ output: Output.Type,
        decoder: D
    ) where Input == DefaultResponse, Output: Decodable, D.Input == Data  

Init.

Parameters

output Output.​Type

The Output type.

decoder D

Some TopLevelDecoder.