Skip to content

unwrap(__into_description_)

mattpolzin edited this page Jun 11, 2021 · 1 revision

unwrap(_:into:description:)

Unwrap the value pointed to by the KeyPath. Fail with a ValidationError if the value is nil or pass onto each validation provided otherwise.

public func unwrap<T, U>(
    _ path: KeyPath<ValidationContext<T>, U?>,
    into validations: Validation<U>...,
    description: String? = nil
) -> (ValidationContext<T>) -> [ValidationError] 

See lift<T, U>(_:,into:) for more information on what this function does when the value pointed to is non-nil.

unwrap(_:into:description:)

Unwrap the value pointed to by the KeyPath. Fail with a ValidationError if the value is nil or pass onto each validation provided otherwise.

public func unwrap<T, U>(
    _ path: KeyPath<T, U?>,
    into validations: Validation<U>...,
    description: String? = nil
) -> (ValidationContext<T>) -> [ValidationError] 

See lift<T, U>(_:,into:) for more information on what this function does when the value pointed to is non-nil.

Types
Protocols
Global Functions
Extensions
Clone this wiki locally