Int32
A 32-bit signed integer value type.
@frozen struct Int32
A 32-bit signed integer value type.
@frozen struct Int32
import Swift
protocol AdditiveArithmetic : Equatable
A type with values that support addition and subtraction.
protocol BinaryInteger : CustomStringConvertible, Hashable, Numeric, Strideable where Self.Magnitude : BinaryInteger, Self.Magnitude == Self.Magnitude.Magnitude
An integer type with a binary representation.
protocol BitwiseCopyable : ~Escapable
protocol CVarArg
A type whose instances can be encoded, and appropriately passed, as elements of a C va_list
.
protocol Comparable : Equatable
A type that can be compared using the relational operators <
, <=
, >=
, and >
.
protocol Copyable
A type whose values can be implicitly or explicitly copied.
protocol CustomReflectable
A type that explicitly supplies its own mirror.
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Decodable
A type that can decode itself from an external representation.
protocol Encodable
A type that can encode itself to an external representation.
protocol Equatable
A type that can be compared for value equality.
protocol Escapable
protocol ExpressibleByIntegerLiteral
A type that can be initialized with an integer literal.
protocol FixedWidthInteger : BinaryInteger, LosslessStringConvertible where Self.Magnitude : FixedWidthInteger, Self.Magnitude : UnsignedInteger, Self.Stride : FixedWidthInteger, Self.Stride : SignedInteger
An integer type that uses a fixed size for every instance.
protocol Hashable : Equatable
A type that can be hashed into a Hasher
to produce an integer hash value.
protocol LosslessStringConvertible : CustomStringConvertible
A type that can be represented as a string in a lossless, unambiguous way.
protocol Numeric : AdditiveArithmetic, ExpressibleByIntegerLiteral
A type with values that support multiplication.
protocol SIMDScalar : BitwiseCopyable
A type that can be used as an element in a SIMD vector.
protocol Sendable
A thread-safe type whose values can be shared across arbitrary concurrent contexts without introducing a risk of data races. Values of the type may have no shared mutable state, or they may protect that state with a lock or by forcing it to only be accessed from a specific actor.
protocol SignedInteger : BinaryInteger, SignedNumeric
An integer type that can represent both positive and negative values.
protocol SignedNumeric : Numeric
A numeric type with a negation operation.
protocol Strideable<Stride> : Comparable
A type representing continuous, one-dimensional values that can be offset and measured.
init(_ source: Double)
Creates an integer from the given floating-point value, rounding toward zero.
init(_ source: Float)
Creates an integer from the given floating-point value, rounding toward zero.
init(_ source: Float16)
Creates an integer from the given floating-point value, rounding toward zero.
init(bitPattern x: UInt32)
Creates a new instance with the same memory representation as the given value.
init?(exactly source: Double)
Creates an integer from the given floating-point value, if it can be represented exactly.
init?(exactly source: Float)
Creates an integer from the given floating-point value, if it can be represented exactly.
init?(exactly source: Float16)
Creates an integer from the given floating-point value, if it can be represented exactly.
init(from decoder: any Decoder) throws
static var bitWidth: Int { get }
The number of bits used for the underlying binary representation of values of this type.
var byteSwapped: Int32 { get }
var customMirror: Mirror { get }
A mirror that reflects the Int32
instance.
var leadingZeroBitCount: Int { get }
var magnitude: UInt32 { get }
var nonzeroBitCount: Int { get }
var trailingZeroBitCount: Int { get }
var words: Int32.Words { get }
static func != (lhs: Int32, rhs: Int32) -> Bool
static func % (lhs: Int32, rhs: Int32) -> Int32
static func %= (lhs: inout Int32, rhs: Int32)
static func & (lhs: Int32, rhs: Int32) -> Int32
static func &<< (lhs: Int32, rhs: Int32) -> Int32
static func &<<= (lhs: inout Int32, rhs: Int32)
static func &= (lhs: inout Int32, rhs: Int32)
static func &>> (lhs: Int32, rhs: Int32) -> Int32
static func &>>= (lhs: inout Int32, rhs: Int32)
static func * (lhs: Int32, rhs: Int32) -> Int32
static func *= (lhs: inout Int32, rhs: Int32)
static func + (lhs: Int32, rhs: Int32) -> Int32
static func += (lhs: inout Int32, rhs: Int32)
static func - (lhs: Int32, rhs: Int32) -> Int32
static func -= (lhs: inout Int32, rhs: Int32)
static func / (lhs: Int32, rhs: Int32) -> Int32
static func /= (lhs: inout Int32, rhs: Int32)
static func < (lhs: Int32, rhs: Int32) -> Bool
static func <= (lhs: Int32, rhs: Int32) -> Bool
static func == (lhs: Int32, rhs: Int32) -> Bool
static func > (lhs: Int32, rhs: Int32) -> Bool
static func >= (lhs: Int32, rhs: Int32) -> Bool
static func ^ (lhs: Int32, rhs: Int32) -> Int32
static func ^= (lhs: inout Int32, rhs: Int32)
static func | (lhs: Int32, rhs: Int32) -> Int32
static func |= (lhs: inout Int32, rhs: Int32)
func addingReportingOverflow(_ other: Int32) -> (partialValue: Int32, overflow: Bool)
func dividedReportingOverflow(by other: Int32) -> (partialValue: Int32, overflow: Bool)
func dividingFullWidth(_ dividend: (high: Int32, low: Int32.Magnitude)) -> (quotient: Int32, remainder: Int32)
Returns a tuple containing the quotient and remainder of dividing the given value by this value.
func encode(to encoder: any Encoder) throws
Encodes this value into the given encoder.
func hash(into hasher: inout Hasher)
Hashes the essential components of this value by feeding them into the given hasher.
func multipliedFullWidth(by other: Int32) -> (high: Int32, low: Int32.Magnitude)
func multipliedReportingOverflow(by other: Int32) -> (partialValue: Int32, overflow: Bool)
func remainderReportingOverflow(dividingBy other: Int32) -> (partialValue: Int32, overflow: Bool)
func signum() -> Int32
func subtractingReportingOverflow(_ other: Int32) -> (partialValue: Int32, overflow: Bool)
@frozen struct SIMD16Storage
Storage for a vector of 16 integers.
@frozen struct SIMD2Storage
Storage for a vector of two integers.
@frozen struct SIMD32Storage
Storage for a vector of 32 integers.
@frozen struct SIMD4Storage
Storage for a vector of four integers.
@frozen struct SIMD64Storage
Storage for a vector of 64 integers.
@frozen struct SIMD8Storage
Storage for a vector of eight integers.
@frozen struct Words
A type that represents the words of this integer.
typealias IntegerLiteralType = Int32
A type that represents an integer literal.
typealias Magnitude = UInt32
A type that can represent the absolute value of any possible value of this type.
typealias SIMDMaskScalar = Int32
var customPlaygroundQuickLook: _PlaygroundQuickLook { get }
A custom playground Quick Look for the Int32
instance.
init()
Creates a new value equal to zero.
init<T>(_ source: T) where T : BinaryInteger
Creates a new instance from the given integer.
init?(_ description: String)
Creates a new integer value from the given string.
init<T>(_ source: T) where T : BinaryFloatingPoint
init?<S>(_ text: S, radix: Int = 10) where S : StringProtocol
Creates a new integer value from the given string and radix.
init(bigEndian value: Self)
init<Other>(clamping source: Other) where Other : BinaryInteger
init?<T>(exactly source: T) where T : BinaryInteger
init?<T>(exactly source: T) where T : BinaryFloatingPoint
init(integerLiteral value: Self)
init(littleEndian value: Self)
init<T>(truncatingIfNeeded source: T) where T : BinaryInteger
static var isSigned: Bool { get }
A Boolean value indicating whether this type is a signed integer type.
static var max: Self { get }
The maximum representable integer in this type.
static var min: Self { get }
The minimum representable integer in this type.
static var zero: Self { get }
static func random(in range: ClosedRange<Self>) -> Self
Returns a random value within the specified range.
static func random(in range: Range<Self>) -> Self
Returns a random value within the specified range.
static func random<T>(in range: ClosedRange<Self>, using generator: inout T) -> Self where T : RandomNumberGenerator
Returns a random value within the specified range, using the given generator as a source for randomness.
static func random<T>(in range: Range<Self>, using generator: inout T) -> Self where T : RandomNumberGenerator
Returns a random value within the specified range, using the given generator as a source for randomness.
var bigEndian: Self { get }
var bitWidth: Int { get }
var description: String { get }
A textual representation of this value.
var littleEndian: Self { get }
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.
static func != <Other>(lhs: Self, rhs: Other) -> Bool where Other : BinaryInteger
Returns a Boolean value indicating whether the two given values are not equal.
static func != (lhs: Self, rhs: Self) -> Bool
static func & (lhs: Self, rhs: Self) -> Self
static func &* (lhs: Self, rhs: Self) -> Self
static func &*= (lhs: inout Self, rhs: Self)
Multiplies two values and stores the result in the left-hand-side variable, wrapping any overflow.
static func &+ (lhs: Self, rhs: Self) -> Self
Returns the sum of the two given values, wrapping the result in case of any overflow.
static func &+= (lhs: inout Self, rhs: Self)
Adds two values and stores the result in the left-hand-side variable, wrapping any overflow.
static func &- (lhs: Self, rhs: Self) -> Self
Returns the difference of the two given values, wrapping the result in case of any overflow.
static func &-= (lhs: inout Self, rhs: Self)
Subtracts the second value from the first and stores the difference in the left-hand-side variable, wrapping any overflow.
static func &<< <Other>(lhs: Self, rhs: Other) -> Self where Other : BinaryInteger
Returns the result of shifting a value’s binary representation the specified number of digits to the left, masking the shift amount to the type’s bit width.
static func &<< (lhs: Self, rhs: Self) -> Self
static func &<<= <Other>(lhs: inout Self, rhs: Other) where Other : BinaryInteger
Returns the result of shifting a value’s binary representation the specified number of digits to the left, masking the shift amount to the type’s bit width, and stores the result in the left-hand-side variable.
static func &>> <Other>(lhs: Self, rhs: Other) -> Self where Other : BinaryInteger
Returns the result of shifting a value’s binary representation the specified number of digits to the right, masking the shift amount to the type’s bit width.
static func &>> (lhs: Self, rhs: Self) -> Self
static func &>>= <Other>(lhs: inout Self, rhs: Other) where Other : BinaryInteger
Calculates the result of shifting a value’s binary representation the specified number of digits to the right, masking the shift amount to the type’s bit width, and stores the result in the left-hand-side variable.
static func + (x: Self) -> Self
Returns the given number unchanged.
static func += (lhs: inout Self, rhs: Self)
static func - (operand: Self) -> Self
static func -= (lhs: inout Self, rhs: Self)
static func ... (minimum: Self) -> PartialRangeFrom<Self>
Returns a partial range extending upward from a lower bound.
static func ... (maximum: Self) -> PartialRangeThrough<Self>
Returns a partial range up to, and including, its upper bound.
static func ... (minimum: Self, maximum: Self) -> ClosedRange<Self>
Returns a closed range that contains both of its bounds.
static func ..< (maximum: Self) -> PartialRangeUpTo<Self>
Returns a partial range up to, but not including, its upper bound.
static func ..< (minimum: Self, maximum: Self) -> Range<Self>
Returns a half-open range that contains its lower bound but not its upper bound.
static func < (x: Self, y: Self) -> Bool
static func < <Other>(lhs: Self, rhs: Other) -> Bool where Other : BinaryInteger
Returns a Boolean value indicating whether the value of the first argument is less than that of the second argument.
static func << <RHS>(lhs: Self, rhs: RHS) -> Self where RHS : BinaryInteger
static func << <Other>(lhs: Self, rhs: Other) -> Self where Other : BinaryInteger
static func <<= <Other>(lhs: inout Self, rhs: Other) where Other : BinaryInteger
static func <= (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether the value of the first argument is less than or equal to that of the second argument.
static func <= <Other>(lhs: Self, rhs: Other) -> Bool where Other : BinaryInteger
Returns a Boolean value indicating whether the value of the first argument is less than or equal to that of the second argument.
static func <= (lhs: Self, rhs: Self) -> Bool
static func == (x: Self, y: Self) -> Bool
static func == <Other>(lhs: Self, rhs: Other) -> Bool where Other : BinaryInteger
Returns a Boolean value indicating whether the two given values are equal.
static func > (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether the value of the first argument is greater than that of the second argument.
static func > <Other>(lhs: Self, rhs: Other) -> Bool where Other : BinaryInteger
Returns a Boolean value indicating whether the value of the first argument is greater than that of the second argument.
static func > (lhs: Self, rhs: Self) -> Bool
static func >= (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether the value of the first argument is greater than or equal to that of the second argument.
static func >= <Other>(lhs: Self, rhs: Other) -> Bool where Other : BinaryInteger
Returns a Boolean value indicating whether the value of the first argument is greater than or equal to that of the second argument.
static func >= (lhs: Self, rhs: Self) -> Bool
static func >> <RHS>(lhs: Self, rhs: RHS) -> Self where RHS : BinaryInteger
static func >> <Other>(lhs: Self, rhs: Other) -> Self where Other : BinaryInteger
static func >>= <Other>(lhs: inout Self, rhs: Other) where Other : BinaryInteger
static func ^ (lhs: Self, rhs: Self) -> Self
static func | (lhs: Self, rhs: Self) -> Self
static func ~ (x: Self) -> Self
func advanced(by n: Int) -> Self
Returns a value that is offset the specified distance from this value.
func distance(to other: Self) -> Int
Returns the distance from this value to the given value, expressed as a stride.
func isMultiple(of other: Self) -> Bool
mutating func negate()
func quotientAndRemainder(dividingBy rhs: Self) -> (quotient: Self, remainder: Self)
import Foundation
init(_ value: CGFloat)
init?(exactly number: NSNumber)
init(truncating number: NSNumber)
init(_ number: NSNumber)
import ArgumentParser
Straightforward, type-safe argument parsing for Swift.
protocol ExpressibleByArgument : _SendableMetatype
A type that can be expressed as a command-line argument.
protocol _SendableMetatype
static var allValueDescriptions: [String : String] { get }
static var allValueStrings: [String] { get }
static var defaultCompletionKind: CompletionKind { get }
var defaultValueDescription: String { get }
import SwiftASN1
An implementation of ASN.1 types and DER serialization.
protocol ASN1IntegerRepresentable : BERImplicitlyTaggable
A protocol that represents any internal object that can present itself as an INTEGER, or be parsed from an INTEGER.
protocol BERImplicitlyTaggable : BERParseable, BERSerializable, DERImplicitlyTaggable
protocol BERParseable : DERParseable
Defines a type that can be parsed from a BER-encoded form, which is a superset of DER.
protocol BERSerializable : DERSerializable
Defines a type that can be serialized in BER-encoded form.
protocol DERImplicitlyTaggable : DERParseable, DERSerializable
An ASN.1 node that can tolerate having an implicit tag.
protocol DERParseable
Defines a type that can be parsed from a DER-encoded form.
protocol DERSerializable
Defines a type that can be serialized in DER-encoded form.
init(asn1Any: ASN1Any) throws
Construct this node from an ASN.1 ANY object.
init(asn1Any: ASN1Any, withIdentifier identifier: ASN1Identifier) throws
Construct this node from an ASN.1 ANY object.
init(berASN1Any: ASN1Any) throws
Construct this node from an ASN.1 ANY object.
init(berASN1Any: ASN1Any, withIdentifier identifier: ASN1Identifier) throws
Construct this node from an ASN.1 ANY object.
init(berEncoded sequenceNodeIterator: inout ASN1NodeCollection.Iterator) throws
init(berEncoded node: ASN1Node) throws
By default, uses the underlying DERParseable initializer.
init(berEncoded: [UInt8]) throws
Initialize this object from a serialized BER representation.
init(berEncoded: ArraySlice<UInt8>) throws
Initialize this object from a serialized BER representation.
init(berEncoded: ASN1Node) throws
Initialize this object from a serialized BER representation.
init(berEncoded node: ASN1Node, withIdentifier identifier: ASN1Identifier) throws
init(berEncoded sequenceNodeIterator: inout ASN1NodeCollection.Iterator, withIdentifier identifier: ASN1Identifier = Self.defaultIdentifier) throws
Initialize this object as one element of a constructed ASN.1 object.
init(berEncoded: [UInt8], withIdentifier identifier: ASN1Identifier = Self.defaultIdentifier) throws
Initialize this object from a serialized BER representation.
init(berEncoded: ArraySlice<UInt8>, withIdentifier identifier: ASN1Identifier = Self.defaultIdentifier) throws
Initialize this object from a serialized BER representation.
init(berIntegerBytes bytes: ArraySlice<UInt8>) throws
init(derEncoded sequenceNodeIterator: inout ASN1NodeCollection.Iterator) throws
Initialize this object as one element of a constructed ASN.1 object.
init(derEncoded: [UInt8]) throws
Initialize this object from a serialized DER representation.
init(derEncoded: ArraySlice<UInt8>) throws
Initialize this object from a serialized DER representation.
init(derEncoded: ASN1Node) throws
init(derEncoded node: ASN1Node, withIdentifier identifier: ASN1Identifier) throws
init(derEncoded sequenceNodeIterator: inout ASN1NodeCollection.Iterator, withIdentifier identifier: ASN1Identifier = Self.defaultIdentifier) throws
Initialize this object as one element of a constructed ASN.1 object.
init(derEncoded: [UInt8], withIdentifier identifier: ASN1Identifier = Self.defaultIdentifier) throws
Initialize this object from a serialized DER representation.
init(derEncoded: ArraySlice<UInt8>, withIdentifier identifier: ASN1Identifier = Self.defaultIdentifier) throws
Initialize this object from a serialized DER representation.
init(derIntegerBytes bytes: ArraySlice<UInt8>) throws
static var defaultIdentifier: ASN1Identifier { get }
func serialize(into coder: inout DER.Serializer) throws
func serialize(into coder: inout DER.Serializer, withIdentifier identifier: ASN1Identifier) throws
func withBigEndianIntegerBytes<ReturnType>(_ body: (IntegerBytesCollection<Self>) throws -> ReturnType) rethrows -> ReturnType
import Atomics
An atomics library for Swift.
protocol AtomicInteger : AtomicValue, FixedWidthInteger where Self == Self.AtomicRepresentation.Value, Self.AtomicRepresentation : AtomicIntegerStorage
A type that supports atomic integer operations through a separate atomic storage representation.
protocol AtomicValue
A type that supports atomic operations through a separate atomic storage representation.
@frozen struct AtomicRepresentation
import NIOConcurrencyHelpers
@preconcurrency protocol AtomicPrimitive
@preconcurrency protocol NIOAtomicPrimitive
static let atomic_add: (OpaquePointer, int_least32_t) -> int_least32_t
static let atomic_compare_and_exchange: (OpaquePointer, int_least32_t, int_least32_t) -> Bool
static let atomic_create: (int_least32_t) -> OpaquePointer
static let atomic_destroy: (OpaquePointer) -> Void
static let atomic_exchange: (OpaquePointer, int_least32_t) -> int_least32_t
static let atomic_load: (OpaquePointer) -> int_least32_t
static let atomic_store: (OpaquePointer, int_least32_t) -> Void
static let atomic_sub: (OpaquePointer, int_least32_t) -> int_least32_t
static let nio_atomic_add: (UnsafeMutablePointer<catmc_nio_atomic_int_least32_t>, int_least32_t) -> int_least32_t
static let nio_atomic_compare_and_exchange: (UnsafeMutablePointer<catmc_nio_atomic_int_least32_t>, int_least32_t, int_least32_t) -> Bool
static let nio_atomic_create_with_existing_storage: (UnsafeMutablePointer<catmc_nio_atomic_int_least32_t>, int_least32_t) -> Void
static let nio_atomic_exchange: (UnsafeMutablePointer<catmc_nio_atomic_int_least32_t>, int_least32_t) -> int_least32_t
static let nio_atomic_load: (UnsafeMutablePointer<catmc_nio_atomic_int_least32_t>) -> int_least32_t
static let nio_atomic_store: (UnsafeMutablePointer<catmc_nio_atomic_int_least32_t>, int_least32_t) -> Void
static let nio_atomic_sub: (UnsafeMutablePointer<catmc_nio_atomic_int_least32_t>, int_least32_t) -> int_least32_t
typealias AtomicWrapper = catmc_nio_atomic_int_least32_t
import NIOHTTP2
This project contains HTTP/2 support for Swift projects using SwiftNIO.
init(_ http2StreamID: HTTP2StreamID)
Create an Int32 holding the integer value of this streamID.
import SwiftSyntaxBuilder
SwiftSyntaxBuilder is a tool for generating Swift code in a convenient way using result builders.
protocol ExpressibleByLiteralSyntax
A Swift type whose value can be represented directly in source code by a Swift literal.
func makeLiteralSyntax() -> IntegerLiteralExprSyntax