Failable
public struct Failable<T, Validations> where Validations: Validation, Validations.Supported == T
A type that can fail when being set because the new value does pass certain validations.
You can create a Failable
instance in 2 ways. The first is to use the Failable
initializer:
try Failable<String, Length1028>("the quick brown fox...")
Or you can call .failable
on any intance of a type conforming to CustomStringConvertible
:
try "the quick brown fox...".failable(Length1028.self)
Mutation
A Failable
type is a struct, so the stored value can only be mutated if the Failable
instance is a variable.
The stored value does not make its setter public, because then you would be able to set the value directly and bypass the validations.
Instead you use the <~
operator to assign a new value:
var story = try "the quick brown fox...".failable(Length1028.self)
try story <~ "Long long ago, on a pencil far far away..."
Use the .value
property to access the actual value:
var story = try "the quick brown fox...".failable(Length1028.self)
print(story.value)
Literal Initialization
Failable
supprts initialization with certain type literals if the value
type T
also supports it.
Initialization is supported for Int
, Float
, Bool
, nil
, and String
types.
let string = Failable<String, EmptyValidationM<String>> = "Hello world"
Warning
Because literal initializers cannot fail, your program will crash if the value passed in does not pass validation.Dictionary
and Array
types are not supported for literal initialization yet because array
splatting for variadic parameters is not supported yet.
-
The underlaying value that has been validated.
Note
The setter for this property is not public.Declaration
Swift
public internal(set) var value: T
-
Creates a new
Failable
instance.Declaration
Swift
public init(_ t: T)throws
Parameters
t
The orginal value for the instance. This value will be validated and the initializer will fail if it doesn’t pass.
-
Declaration
Swift
public typealias RawExponent = T.RawExponent
-
Declaration
Swift
public typealias RawSignificand = T.RawSignificand
-
Declaration
Swift
public init(_ value: Float)throws
-
Declaration
Swift
public init(_ value: Double)throws
-
Declaration
Swift
public init(_ value: Float80)throws
-
Declaration
Swift
public init<Source>(_ value: Source)throws where Source : BinaryFloatingPoint
-
Declaration
Swift
public init?<Source>(exactly value: Source)throws where Source : BinaryFloatingPoint
-
Declaration
Swift
public init(sign: FloatingPointSign, exponentBitPattern: RawExponent, significandBitPattern: RawSignificand)throws
-
See
BinaryFloatingPoint.binade
.Warning
This property has no failing options, so your program will crash if it produces a value that does not pass validation.Declaration
Swift
public var binade: Failable<T, Validations>
-
Declaration
Swift
public var exponentBitPattern: RawExponent
-
Declaration
Swift
public var significandBitPattern: RawSignificand
-
Declaration
Swift
public var significandWidth: Int
-
Declaration
Swift
public static var exponentBitCount: Int
-
Declaration
Swift
public static var significandBitCount: Int
-
See
BinaryInteger.Words
.Declaration
Swift
public typealias Words = T.Words
-
See
BinaryInteger.init()
.Declaration
Swift
public init()throws
-
Declaration
Swift
public init<B>(_ source: B)throws where B : BinaryFloatingPoint
-
Declaration
Swift
public init<B>(_ source: B)throws where B : BinaryInteger
-
Declaration
Swift
public init<B>(clamping source: B)throws where B : BinaryInteger
-
See
BinaryInteger.init(exactly:)
.If an error is thrown by the
Failable
initializer, then this init will returnnil
.Declaration
Swift
public init?<B>(exactly source: B) where B : BinaryFloatingPoint
-
Declaration
Swift
public init<T>(truncatingIfNeeded source: T)throws where T : BinaryInteger
-
Declaration
Swift
public var bidWidth: Int
-
Declaration
Swift
public var trailingZeroBitCount: Int
-
See
BinaryInteger.words
.Declaration
Swift
public var words: Words
-
Declaration
Swift
public static var isSigned: Bool
-
Declaration
Swift
public func quotientAndRemainder(dividingBy rhs: Failable<T, Validations>)throws -> (quotient: Failable<T, Validations>, remainder: Failable<T, Validations>)
-
Declaration
Swift
public func signum()throws -> Failable<T, Validations>
-
Declaration
Swift
public static func != <Other>(lhs: Failable<T, Validations>, rhs: Other) -> Bool where Other : BinaryInteger
-
Declaration
Swift
public static func != (lhs: Failable<T, Validations>, rhs: Failable<T, Validations>) -> Bool
-
Declaration
Swift
public static func % (lhs: Failable<T, Validations>, rhs: Failable<T, Validations>)throws -> Failable<T, Validations>
-
Declaration
Swift
public static func %= (lhs: inout Failable<T, Validations>, rhs: Failable<T, Validations>)throws
-
Declaration
Swift
public static func & (lhs: Failable<T, Validations>, rhs: Failable<T, Validations>)throws -> Failable<T, Validations>
-
Declaration
Swift
public static func &= (lhs: inout Failable<T, Validations>, rhs: Failable<T, Validations>)throws
-
Declaration
Swift
public static func * (lhs: Failable<T, Validations>, rhs: Failable<T, Validations>)throws -> Failable<T, Validations>
-
Declaration
Swift
public static func *= (lhs: inout Failable<T, Validations>, rhs: Failable<T, Validations>)throws
-
Declaration
Swift
public static func + (lhs: Failable<T, Validations>, rhs: Failable<T, Validations>)throws -> Failable<T, Validations>
-
Declaration
Swift
public static func += (lhs: inout Failable<T, Validations> , rhs: Failable<T, Validations> )throws
-
Declaration
Swift
public static func - (lhs: Failable<T, Validations>, rhs: Failable<T, Validations>)throws -> Failable<T, Validations>
-
Declaration
Swift
public static func -= (lhs: inout Failable<T, Validations>, rhs: Failable<T, Validations>)throws
-
Declaration
Swift
public static func / (lhs: Failable<T, Validations>, rhs: Failable<T, Validations>)throws -> Failable<T, Validations>
-
Declaration
Swift
public static func /= (lhs: inout Failable<T, Validations>, rhs: Failable<T, Validations>)throws
-
Declaration
Swift
public static func < <Other>(lhs: Failable<T, Validations>, rhs: Other) -> Bool where Other : BinaryInteger
-
Declaration
Swift
public static func << <RHS>(lhs: Failable<T, Validations>, rhs: RHS)throws -> Failable<T, Validations> where RHS : BinaryInteger
-
Declaration
Swift
public static func <<= <RHS>(lhs: inout Failable<T, Validations>, rhs: RHS)throws where RHS : BinaryInteger
-
Declaration
Swift
public static func <= (lhs: Failable<T, Validations>, rhs: Failable<T, Validations>) -> Bool
-
Declaration
Swift
public static func <= <Other>(lhs: Failable<T, Validations>, rhs: Other) -> Bool where Other : BinaryInteger
-
Declaration
Swift
public static func == <Other>(lhs: Failable<T, Validations>, rhs: Other) -> Bool where Other : BinaryInteger
-
Declaration
Swift
public static func > <Other>(lhs: Failable<T, Validations>, rhs: Other) -> Bool where Other : BinaryInteger
-
Declaration
Swift
public static func > (lhs: Failable<T, Validations>, rhs: Failable<T, Validations>) -> Bool
-
Declaration
Swift
public static func >= (lhs: Failable<T, Validations>, rhs: Failable<T, Validations>) -> Bool
-
Declaration
Swift
public static func >= <Other>(lhs: Failable<T, Validations>, rhs: Other) -> Bool where Other : BinaryInteger
-
Declaration
Swift
public static func >> <RHS>(lhs: Failable<T, Validations>, rhs: RHS)throws -> Failable<T, Validations> where RHS: BinaryInteger
-
Declaration
Swift
public static func >>= <RHS>(lhs: inout Failable<T, Validations>, rhs: RHS)throws where RHS : BinaryInteger
-
Declaration
Swift
public static func ^ (lhs: Failable<T, Validations>, rhs: Failable<T, Validations>)throws -> Failable<T, Validations>
-
Declaration
Swift
public static func ^= (lhs: inout Failable<T, Validations>, rhs: Failable<T, Validations>)throws
-
Declaration
Swift
public static func | (lhs: Failable<T, Validations>, rhs: Failable<T, Validations>)throws -> Failable<T, Validations>
-
Declaration
Swift
public static func |= (lhs: inout Failable<T, Validations>, rhs: Failable<T, Validations>)throws
-
See
BinaryInteger.~(_:)
.Declaration
Swift
public prefix static func ~ (x: Failable<T, Validations>)throws -> Failable<T, Validations>
-
See
Bool.toggle()
.Declaration
Swift
public mutating func toggle()throws
-
Declaration
Swift
public func encode(to encoder: Encoder)throws
-
Declaration
Swift
public init(from decoder: Decoder)throws
-
Declaration
Swift
public typealias SubSequence = T.SubSequence
-
See
Collection.Index
.Declaration
Swift
public typealias Index = T.Index
-
Declaration
Swift
public var startIndex: T.Index
-
See
Collection.endIndex
.Declaration
Swift
public var endIndex: T.Index
-
See
Collection.[]
. -
-
See
MutableCollection.[]
.To validate the new array, the instance is copied and mutated, then the validation is run on the mutated instance. If the validation succeeds, the mutated value is assigned to the current instance. If the validation fails, the set silently fails.
-
See
MutableCollection.[]
.To validate the new array, the instance is copied and mutated, then the validation is run on the mutated instance. If the validation succeeds, the mutated value is assigned to the current instance. If the validation fails, the set silently fails.
Declaration
Swift
public subscript(position: Range<T.Index>) -> T.SubSequence
-
-
-
See
Equatable.==(-:_:)
.Declaration
Swift
public static func == (lhs: Failable<T, Validations>, rhs: Failable<T, Validations>) -> Bool
-
Declaration
Swift
public static func < (lhs: Failable<T, Validations>, rhs: Failable<T, Validations>) -> Bool
-
Declaration
Swift
public typealias IntegerLiteralType = T.IntegerLiteralType
-
Declaration
Swift
public init(integerLiteral value: T.IntegerLiteralType)
-
Declaration
Swift
public typealias FloatLiteralType = T.FloatLiteralType
-
Declaration
Swift
public init(floatLiteral value: T.FloatLiteralType)
-
Declaration
Swift
public typealias BooleanLiteralType = T.BooleanLiteralType
-
Declaration
Swift
public init(booleanLiteral value: T.BooleanLiteralType)
-
Declaration
Swift
public init(nilLiteral: ())
-
Declaration
Swift
public typealias StringLiteralType = T.StringLiteralType
-
Declaration
Swift
public init(stringLiteral value: T.StringLiteralType)
-
Declaration
Swift
public typealias ExtendedGraphemeClusterLiteralType = T.ExtendedGraphemeClusterLiteralType
-
Declaration
Swift
public init(extendedGraphemeClusterLiteral value: T.ExtendedGraphemeClusterLiteralType)
-
Declaration
Swift
public typealias UnicodeScalarLiteralType = T.UnicodeScalarLiteralType
-
Declaration
Swift
public init(unicodeScalarLiteral value: T.UnicodeScalarLiteralType)
-
See
FixedWidthInteger.init(_:radix:)
.If an error is thrown by the
Failable
initializer, this init will returnnil
.Declaration
Swift
public init?<S>(_ text: S, radix: Int = 10) where S : StringProtocol
-
Declaration
Swift
public init(bigEndian value: Failable<T, Validations>)throws
-
Declaration
Swift
public init(littleEndian value: Failable<T, Validations>)throws
-
Declaration
Swift
public init<V>(bigEndian value: Failable<T, V>)throws
-
Declaration
Swift
public init<V>(littleEndian value: Failable<T, V>)throws
-
See
FixedWidthInteger.bigEndian
.Warning
This property has no failing options, so your program will crash if it produces a value that does not pass validation.Declaration
Swift
public var bigEndian: Failable<T, Validations>
-
A representation of this integer with the byte order swapped.
Warning
This property has no failing options, so your program will crash if it produces a value that does not pass validation.Declaration
Swift
public var byteSwapped: Failable<T, Validations>
-
Declaration
Swift
public var leadingZeroBitCount: Int
-
See
FixedWidthInteger.littleEndian
.Warning
This property has no failing options, so your program will crash if it produces a value that does not pass validation.Declaration
Swift
public var littleEndian: Failable<T, Validations>
-
Declaration
Swift
public var nonzeroBitCount: Int
-
Declaration
Swift
public static var bitWidth: Int
-
Warning
This property has no failing options, so your program will crash if it produces a value that does not pass validation.Declaration
Swift
public static var max: Failable<T, Validations>
-
Warning
This property has no failing options, so your program will crash if it produces a value that does not pass validation.Declaration
Swift
public static var min: Failable<T, Validations>
-
Declaration
Swift
public func addingReportingOverflow(_ rhs: Failable<T, Validations>)throws -> (partialValue: Failable<T, Validations>, overflow: Bool)
-
Declaration
Swift
public func dividedReportingOverflow(by rhs: Failable<T, Validations>)throws -> (partialValue: Failable<T, Validations>, overflow: Bool)
-
Declaration
Swift
public func dividingFullWidth(_ dividend: (high: Failable<T, Validations>, low: Failable<T, Validations>.Magnitude))throws -> (quotient: Failable<T, Validations>, remainder: Failable<T, Validations>)
-
Declaration
Swift
public func multipliedFullWidth(by other: Failable<T, Validations>)throws -> (high: Failable<T, Validations>, low: Failable<T, Validations>.Magnitude)
-
Declaration
Swift
public func multipliedReportingOverflow(by rhs: Failable<T, Validations>)throws -> (partialValue: Failable<T, Validations>, overflow: Bool)
-
Declaration
Swift
public func remainderReportingOverflow(dividingBy rhs: Failable<T, Validations>)throws -> (partialValue: Failable<T, Validations>, overflow: Bool)
-
Declaration
Swift
public func subtractingReportingOverflow(_ rhs: Failable<T, Validations>)throws -> (partialValue: Failable<T, Validations>, overflow: Bool)
-
Declaration
Swift
public static func random(in range: ClosedRange<Failable<T, Validations>>)throws -> Failable<T, Validations>
-
Declaration
Swift
public static func random(in range: Range<Failable<T, Validations>>)throws -> Failable<T, Validations>
-
Declaration
Swift
public static func random<G>(in range: ClosedRange<Failable<T, Validations>>, using generator: inout G)throws -> Failable<T, Validations> where G : RandomNumberGenerator
-
Declaration
Swift
public static func random<G>(in range: Range<Failable<T, Validations>>, using generator: inout G)throws -> Failable<T, Validations> where G : RandomNumberGenerator
-
Declaration
Swift
public static func &* (lhs: Failable<T, Validations>, rhs: Failable<T, Validations>)throws -> Failable<T, Validations>
-
Declaration
Swift
public static func &*= (lhs: inout Failable<T, Validations>, rhs: Failable<T, Validations>)throws
-
Declaration
Swift
public static func &+ (lhs: Failable<T, Validations>, rhs: Failable<T, Validations>)throws -> Failable<T, Validations>
-
Declaration
Swift
public static func &+= (lhs: inout Failable<T, Validations>, rhs: Failable<T, Validations>)throws
-
Declaration
Swift
public static func &- (lhs: Failable<T, Validations>, rhs: Failable<T, Validations>)throws -> Failable<T, Validations>
-
Declaration
Swift
public static func &-= (lhs: inout Failable<T, Validations>, rhs: Failable<T, Validations>)throws
-
Declaration
Swift
public static func &<< (lhs: Failable<T, Validations>, rhs: Failable<T, Validations>)throws -> Failable<T, Validations>
-
Declaration
Swift
public static func &<<= (lhs: inout Failable<T, Validations>, rhs: Failable<T, Validations>)throws
-
Declaration
Swift
public static func &>> (lhs: Failable<T, Validations>, rhs: Failable<T, Validations>)throws -> Failable<T, Validations>
-
Declaration
Swift
public static func &>>= (lhs: inout Failable<T, Validations>, rhs: Failable<T, Validations>)throws
-
Declaration
Swift
public typealias Exponent = T.Exponent
-
Declaration
Swift
public init(_ value: Int8)throws
-
Declaration
Swift
public init(_ value: Int16)throws
-
Declaration
Swift
public init(_ value: Int32)throws
-
Declaration
Swift
public init(_ value: Int64)throws
-
Declaration
Swift
public init(_ value: UInt8)throws
-
Declaration
Swift
public init(_ value: UInt16)throws
-
Declaration
Swift
public init(_ value: UInt32)throws
-
Declaration
Swift
public init(_ value: UInt64)throws
-
Declaration
Swift
public init(_ value: UInt)throws
-
Declaration
Swift
public init(_ value: Int)throws
-
Declaration
Swift
public init?<Source>(exactly value: Source) where Source : BinaryInteger
-
Declaration
Swift
public init(sign: FloatingPointSign, exponent: Exponent, significand: Failable<T, Validations>)throws
-
Declaration
Swift
public init(signOf: Failable<T, Validations>, magnitudeOf: Failable<T, Validations>)throws
-
Declaration
Swift
public init<V>(sign: FloatingPointSign, exponent: Exponent, significand: Failable<T, V>)throws
-
Declaration
Swift
public init<V1, V2>(signOf: Failable<T, V1>, magnitudeOf: Failable<T, V2>)throws
-
Declaration
Swift
public var exponent: Exponent
-
Declaration
Swift
public var floatingPointClass: FloatingPointClassification
-
Declaration
Swift
public var isCanonical: Bool
-
Declaration
Swift
public var isFinite: Bool
-
Declaration
Swift
public var isInfinite: Bool
-
See
FloatingPoint.isNaN
.Declaration
Swift
public var isNaN: Bool
-
Declaration
Swift
public var isNormal: Bool
-
Declaration
Swift
public var isSignalingNaN: Bool
-
Declaration
Swift
public var isSubnormal: Bool
-
See
FloatingPoint.isZero
.Declaration
Swift
public var isZero: Bool
-
Declaration
Swift
public var nextDown: Failable<T, Validations>
-
See
FloatingPoint.nextUp
.Declaration
Swift
public var nextUp: Failable<T, Validations>
-
See
FloatingPoint.sign
.Declaration
Swift
public var sign: FloatingPointSign
-
Declaration
Swift
public var significand: Failable<T, Validations>
-
See
FloatingPoint.ulp
.Declaration
Swift
public var ulp: Failable<T, Validations>
-
Declaration
Swift
public static var greatestFiniteMagnitude: Failable<T, Validations>
-
Declaration
Swift
public static var infinity: Failable<T, Validations>
-
Declaration
Swift
public static var leastNonzeroMagnitude: Failable<T, Validations>
-
Declaration
Swift
public static var leastNormalMagnitude: Failable<T, Validations>
-
See
FloatingPoint.nan
.Declaration
Swift
public static var nan: Failable<T, Validations>
-
See
FloatingPoint.pi
.Declaration
Swift
public static var pi: Failable<T, Validations>
-
See
FloatingPoint.radix
.Declaration
Swift
public static var radix: Failable<T, Validations>
-
Declaration
Swift
public static var signalingNaN: Failable<T, Validations>
-
Declaration
Swift
public static var ulpOfOne: Failable<T, Validations>
-
Declaration
Swift
public mutating func addProduct(_ lhs: Failable<T, Validations>, _ rhs: Failable<T, Validations>)
-
Declaration
Swift
public func addingProduct(_ lhs: Failable<T, Validations>, _ rhs: Failable<T, Validations>)throws -> Failable<T, Validations>
-
Declaration
Swift
public mutating func formRemainder(dividingBy other: Failable<T, Validations>)
-
Declaration
Swift
public mutating func formSquareRoot()
-
Declaration
Swift
public mutating func formTruncatingRemainder(dividingBy other: Failable<T, Validations>)
-
Declaration
Swift
public func isEqual(to other: Failable<T, Validations>) -> Bool
-
Declaration
Swift
public func isLess(than other: Failable<T, Validations>) -> Bool
-
Declaration
Swift
public func isLessThanOrEqualTo(_ other: Failable<T, Validations>) -> Bool
-
Declaration
Swift
public func isTotallyOrdered(belowOrEqualTo other: Failable<T, Validations>) -> Bool
-
Declaration
Swift
public mutating func negate()
-
Declaration
Swift
public func remainder(dividingBy other: Failable<T, Validations>)throws -> Failable<T, Validations>
-
Declaration
Swift
public mutating func round()
-
Declaration
Swift
public mutating func round(_ rule: FloatingPointRoundingRule)
-
Declaration
Swift
public func rounded()throws -> Failable<T, Validations>
-
Declaration
Swift
public func rounded(_ rule: FloatingPointRoundingRule)throws -> Failable<T, Validations>
-
Declaration
Swift
public func squareRoot()throws -> Failable<T, Validations>
-
Declaration
Swift
public func truncatingRemainder(dividingBy other: Failable<T, Validations>)throws -> Failable<T, Validations>
-
Declaration
Swift
public mutating func addProduct<V1, V2>(_ lhs: Failable<T, V1>, _ rhs: Failable<T, V2>)
-
Declaration
Swift
public func addingProduct<V1, V2>(_ lhs: Failable<T, V1>, _ rhs: Failable<T, V2>)throws -> Failable<T, AppendedValidations<T, V1, V2>>
-
Declaration
Swift
public mutating func formRemainder<V>(dividingBy other: Failable<T, V>)
-
Declaration
Swift
public mutating func formTruncatingRemainder<V>(dividingBy other: Failable<T, V>)
-
Declaration
Swift
public func isEqual<V>(to other: Failable<T, V>) -> Bool
-
Declaration
Swift
public func isLess<V>(than other: Failable<T, V>) -> Bool
-
Declaration
Swift
public func isLessThanOrEqualTo<V>(_ other: Failable<T, V>) -> Bool
-
Declaration
Swift
public func isTotallyOrdered<V>(belowOrEqualTo other: Failable<T, V>) -> Bool
-
Declaration
Swift
public func remainder<V>(dividingBy other: Failable<T, V>)throws -> Failable<T, AppendedValidations<T, Validations, V>>
-
Undocumented
Declaration
Swift
public func truncatingRemainder<V>(dividingBy other: Failable<T, V>)throws -> Failable<T, AppendedValidations<T, Validations, V>>
-
Declaration
Swift
public static func maximum(_ x: Failable<T, Validations>, _ y: Failable<T, Validations>)throws -> Failable<T, Validations>
-
Declaration
Swift
public static func maximumMagnitude(_ x: Failable<T, Validations>, _ y: Failable<T, Validations>)throws -> Failable<T, Validations>
-
Declaration
Swift
public static func minimum(_ x: Failable<T, Validations>, _ y: Failable<T, Validations>)throws -> Failable<T, Validations>
-
Declaration
Swift
public static func minimumMagnitude(_ x: Failable<T, Validations>, _ y: Failable<T, Validations>)throws -> Failable<T, Validations>
-
Declaration
Swift
public static func maximum<V1, V2>(_ x: Failable<T, V1>, _ y: Failable<T, V2>)throws -> Failable<T, AppendedValidations<T, V1, V2>>
-
Declaration
Swift
public static func maximumMagnitude<V1, V2>(_ x: Failable<T, V1>, _ y: Failable<T, V2>)throws -> Failable<T, AppendedValidations<T, V1, V2>>
-
Declaration
Swift
public static func minimum<V1, V2>(_ x: Failable<T, V1>, _ y: Failable<T, V2>)throws -> Failable<T, AppendedValidations<T, V1, V2>>
-
Declaration
Swift
public static func minimumMagnitude<V1, V2>(_ x: Failable<T, V1>, _ y: Failable<T, V2>)throws -> Failable<T, AppendedValidations<T, V1, V2>>
-
Declaration
Swift
public static func < (lhs: Failable<T, Validations>, rhs: Failable<T, Validations>) -> Bool
-
Declaration
Swift
public static func <= (lhs: Failable<T, Validations>, rhs: Failable<T, Validations>) -> Bool
-
Declaration
Swift
public static func > (lhs: Failable<T, Validations>, rhs: Failable<T, Validations>) -> Bool
-
Declaration
Swift
public static func >= (lhs: Failable<T, Validations>, rhs: Failable<T, Validations>) -> Bool
-
Declaration
Swift
public static func * (_ lhs: Failable<T, Validations>, _ rhs: Failable<T, Validations>)throws -> Failable<T, Validations>
-
Declaration
Swift
public static func *= (_ lhs: inout Failable<T, Validations>, _ rhs: Failable<T, Validations>)throws
-
Declaration
Swift
public static func + (_ lhs: Failable<T, Validations>, _ rhs: Failable<T, Validations>)throws -> Failable<T, Validations>
-
Declaration
Swift
public static func += (_ lhs: inout Failable<T, Validations>, _ rhs: Failable<T, Validations>)throws
-
See
FloatingPoint.-(_:)
.Declaration
Swift
public prefix static func - (_ x: Failable<T, Validations>)throws -> Failable<T, Validations>
-
Declaration
Swift
public static func - (_ lhs: Failable<T, Validations>, _ rhs: Failable<T, Validations>)throws -> Failable<T, Validations>
-
Declaration
Swift
public static func -= (_ lhs: inout Failable<T, Validations>, _ rhs: Failable<T, Validations>)throws
-
Declaration
Swift
public static func / (_ lhs: Failable<T, Validations>, _ rhs: Failable<T, Validations>)throws -> Failable<T, Validations>
-
Declaration
Swift
public static func /= (_ lhs: inout Failable<T, Validations>, _ rhs: Failable<T, Validations>)throws
-
Declaration
Swift
public static func == (_ lhs: Failable<T, Validations>, _ rhs: Failable<T, Validations>) -> Bool
-
See
Hashable.hash(into:)
.Declaration
Swift
public func hash(into hasher: inout Hasher)
-
See
Numeric.Magnitude
.Declaration
Swift
public typealias Magnitude = T.Magnitude
-
Declaration
Swift
public init?<B>(exactly source: B) where B : BinaryInteger
-
See
Numeric.magnitude
.Declaration
Swift
public var magnitude: T.Magnitude
-
See
Numeric.*(_:_:)
.Declaration
Swift
public static func * (lhs: Failable<T, Validations>, rhs: Failable<T, Validations>)throws -> Failable<T, Validations>
-
See
Numeric.*=(_:_:)
.Declaration
Swift
public static func *= (lhs: inout Failable<T, Validations>, rhs: Failable<T, Validations>)throws
-
See [
Numeric.+(_:)
]https://developer.apple.com/documentation/swift/numeric/2886206).Declaration
Swift
public static prefix func + (lhs: Failable<T, Validations>)throws -> Failable<T, Validations>
-
See
Numeric.+(_:_:)
.Declaration
Swift
public static func + (lhs: Failable<T, Validations>, rhs: Failable<T, Validations>)throws -> Failable<T, Validations>
-
See
Numeric.+=(_:_:)
.Declaration
Swift
public static func += (lhs: inout Failable<T, Validations>, rhs: Failable<T, Validations>)throws
-
See
Numeric.-(_:_:)
.Declaration
Swift
public static func - (lhs: Failable<T, Validations>, rhs: Failable<T, Validations>)throws -> Failable<T, Validations>
-
See
Numeric.-=(_:_:)
.Declaration
Swift
public static func -= (lhs: inout Failable<T, Validations>, rhs: Failable<T, Validations>)throws
-
See
Optional.map(_:)
.Declaration
Swift
public func map<U, Wrapped>(_ transform: (Wrapped) throws -> U) rethrows -> U? where T == Optional<Wrapped>
-
See
Optional.flatMap(_:)
.Declaration
Swift
public func flatMap<U, Wrapped>(_ transform: (Wrapped) throws -> U?) rethrows -> U? where T == Optional<Wrapped>
-
See
Optional.==(_:_:)
.Declaration
Swift
public static func == <Wrapped>(lhs: Failable<Wrapped?, Validations>, rhs: Failable<Wrapped?, Validations>) -> Bool where T == Optional<Wrapped>, Wrapped: Equatable
-
See
Optional.!=(_:_:)
.Declaration
Swift
public static func != <Wrapped>(lhs: Failable<Wrapped?, Validations>, rhs: Failable<Wrapped?, Validations>) -> Bool where T == Optional<Wrapped>, Wrapped: Equatable
-
Declaration
Swift
public typealias RawValue = T.RawValue
-
See
RawRepresentable.init(rawValue:)
.If the
Failable
initializer throws an error, this initializer will returnnil
.Declaration
Swift
public init?(rawValue: T.RawValue)
-
Declaration
Swift
public var rawValue: T.RawValue
-
Declaration
Swift
public typealias AllCases = T.AllCases
-
Declaration
Swift
public static var allCases: T.AllCases
-
See
Sequence.Element
.Declaration
Swift
public typealias Element = T.Element
-
Declaration
Swift
public typealias Iterator = T.Iterator
-
Declaration
Swift
public func makeIterator() -> T.Iterator
-
Declaration
Swift
public func split(maxSplits: Int, omittingEmptySubsequences: Bool, whereSeparator isSeparator: (T.Element) throws -> Bool) rethrows -> [T.SubSequence]
-
See
Sequence.suffix(_:)
.Declaration
Swift
public func suffix(_ maxLength: Int) -> T.SubSequence
-
Declaration
Swift
public func prefix(while predicate: (T.Element) throws -> Bool) rethrows -> T.SubSequence
-
See
Sequence.prefix(_:)
.Declaration
Swift
public func prefix(_ maxLength: Int) -> T.SubSequence
-
Declaration
Swift
public func drop(while predicate: (T.Element) throws -> Bool) rethrows -> T.SubSequence
-
See
Sequence.dropLast
.Declaration
Swift
public func dropLast(_ k: Int) -> T.SubSequence
-
Declaration
Swift
public func dropFirst(_ k: Int) -> T.SubSequence
-
Declaration
Swift
public mutating func negate()throws
-
See
SignedNumeric.-(_:)
.Declaration
Swift
public static prefix func - (lhs: Failable<T, Validations>)throws -> Failable<T, Validations>
-
See
Strideable.Stride
.Declaration
Swift
public typealias Stride = T.Stride
-
Declaration
Swift
public func advance(by n: Stride)throws -> Failable<T, Validations>
-
Declaration
Swift
public func distance(to other: Failable<T, Validations>) -> Stride
-
See
Strideable.+(_:_:)
.Declaration
Swift
public static func + (lhs: Failable<T, Validations>, rhs: Stride)throws -> Failable<T, Validations>
-
See
Strideable.+(_:_:)
.Declaration
Swift
public static func + (lhs: Stride, rhs: Failable<T, Validations>)throws -> Failable<T, Validations>
-
See
Strideable.+=(_:_:)
.Declaration
Swift
public static func += (lhs: inout Failable<T, Validations>, rhs: Stride)throws
-
See
Strideable.-(_:_:)
.Declaration
Swift
public static func - (lhs: Failable<T, Validations>, rhs: Stride)throws -> Failable<T, Validations>
-
See
Strideable.-(_:_:)
.Declaration
Swift
public static func - (lhs: Failable<T, Validations>, rhs: Failable<T, Validations>) -> Stride
-
See
Strideable.-=(_:_:)
.Declaration
Swift
public static func -= (lhs: inout Failable<T, Validations>, rhs: Stride)throws
-
Declaration
Swift
public var description: String
-
See
LosslessStringConvertible.init(_:)
.If the value passed into the
Failable
initializer throws an error, the initializer with returnnil
.Declaration
Swift
public init?(_ description: String)
-
Declaration
Swift
public var debugDescription: String
-
Warning
This property has no failing options, so your program will crash if it produces a value that does not pass validation.gDeclaration
Swift
public var magnitude: Failable<T, Validations>