Structures
The following structures are available globally.
-
CompactValidatePublisher
A
See moreCombine
operator that validates upstream output and sends valid non-nil objects downstream.Declaration
Swift
public struct CompactValidatePublisher<Upstream> : Publisher where Upstream : Publisher
-
TryValidationPublisher
A
Combine
operator that validates upstream output and sends valid objects or aBasicValidationError
downstream.See also
Publisher.tryValidate(_:)
Declaration
Swift
public struct TryValidationPublisher<Upstream> : Publisher where Upstream : Publisher, Upstream.Failure == BasicValidationError
-
ValidationPublisher
A
Combine
operator that validates upstream output and sends valid objects ornil
downstream.See also
Publisher.validate(_:)
Usage:
See more_ = Just("foo-bar") .validate { !.empty && .count(3...) } .replaceNil(with: "failed") .sink { print($0) } // "foo-bar" _ = Just("fo") .validate { !.empty && .count(3...) } .replaceNil(with: "failed") .sink { print($0) } // "failed"
Declaration
Swift
public struct ValidationPublisher<Upstream> : Publisher where Upstream : Publisher