Structureswift 6.0.1Swift
Int32
A 32-bit signed integer value type.
@frozen struct Int32
Citizens in Swift
Conformances
protocol AdditiveArithmetic
A type with values that support addition and subtraction.
protocol BinaryInteger
An integer type with a binary representation.
protocol BitwiseCopyable
protocol CVarArg
A type whose instances can be encoded, and appropriately passed, as elements of a C
va_list
.protocol Comparable
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
An integer type that uses a fixed size for every instance.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol LosslessStringConvertible
A type that can be represented as a string in a lossless, unambiguous way.
protocol Numeric
A type with values that support multiplication.
protocol SIMDScalar
A type that can be used as an element in a SIMD vector.
protocol Sendable
protocol SignedInteger
An integer type that can represent both positive and negative values.
protocol SignedNumeric
A numeric type with a negation operation.
protocol Strideable<Stride>
A type representing continuous, one-dimensional values that can be offset and measured.
Types
struct SIMD16Storage
Storage for a vector of 16 integers.
struct SIMD2Storage
Storage for a vector of two integers.
struct SIMD32Storage
Storage for a vector of 32 integers.
struct SIMD4Storage
Storage for a vector of four integers.
struct SIMD64Storage
Storage for a vector of 64 integers.
struct SIMD8Storage
Storage for a vector of eight integers.
struct Words
A type that represents the words of this integer.
Typealiases
typealias IntegerLiteralType
A type that represents an integer literal.
typealias Magnitude
A type that can represent the absolute value of any possible value of this type.
typealias SIMDMaskScalar
Type members
init(Double
) Creates an integer from the given floating-point value, rounding toward zero.
init(Float
) Creates an integer from the given floating-point value, rounding toward zero.
init(Float16
) Creates an integer from the given floating-point value, rounding toward zero.
init(bitPattern: UInt32
) Creates a new instance with the same memory representation as the given value.
init?(exactly: Double
) Creates an integer from the given floating-point value, if it can be represented exactly.
init?(exactly: Float
) Creates an integer from the given floating-point value, if it can be represented exactly.
init?(exactly: Float16
) Creates an integer from the given floating-point value, if it can be represented exactly.
init(from: any Decoder
) throws static var bitWidth: Int
The number of bits used for the underlying binary representation of values of this type.
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 Multiplies two values and produces their product.
static func *= (lhs: inout Int32, rhs: Int32
) Multiplies two values and stores the result in the left-hand-side variable.
static func + (lhs: Int32, rhs: Int32
) -> Int32 Adds two values and produces their sum.
static func += (lhs: inout Int32, rhs: Int32
) Adds two values and stores the result in the left-hand-side variable.
static func - (lhs: Int32, rhs: Int32
) -> Int32 Subtracts one value from another and produces their difference.
static func -= (lhs: inout Int32, rhs: Int32
) Subtracts the second value from the first and stores the difference in the left-hand-side variable.
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
)
Instance members
var byteSwapped: Int32
var customMirror: Mirror
A mirror that reflects the
Int32
instance.var leadingZeroBitCount: Int
The number of leading zeros in this value’s binary representation.
var magnitude: UInt32
var nonzeroBitCount: Int
var trailingZeroBitCount: Int
The number of trailing zeros in this value’s binary representation.
var words: Int32.Words
func addingReportingOverflow(Int32
) -> (partialValue: Int32, overflow: Bool) func dividedReportingOverflow(by: Int32
) -> (partialValue: Int32, overflow: Bool) func dividingFullWidth((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: any Encoder
) throws Encodes this value into the given encoder.
func hash(into: inout Hasher
) Hashes the essential components of this value by feeding them into the given hasher.
func multipliedFullWidth(by: Int32
) -> (high: Int32, low: Int32.Magnitude) Returns a tuple containing the high and low parts of the result of multiplying this value by the given value.
func multipliedReportingOverflow(by: Int32
) -> (partialValue: Int32, overflow: Bool) func remainderReportingOverflow(dividingBy: Int32
) -> (partialValue: Int32, overflow: Bool) func signum(
) -> Int32 func subtractingReportingOverflow(Int32
) -> (partialValue: Int32, overflow: Bool)
Show obsolete interfaces (1)
Hide obsolete interfaces
var customPlaygroundQuickLook: _PlaygroundQuickLook
A custom playground Quick Look for the
Int32
instance.
Type features
init(
) Creates a new value equal to zero.
init<T>(T
) Creates a new instance from the given integer.
init?(String
) Creates a new integer value from the given string.
init<T>(T
) Creates an integer from the given floating-point value, rounding toward zero. Any fractional part of the value passed as
source
is removed.init?<S>(S, radix: Int
) Creates a new integer value from the given string and radix.
init(bigEndian: Self
) Creates an integer from its big-endian representation, changing the byte order if necessary.
init<Other>(clamping: Other
) Creates a new instance with the representable value that’s closest to the given integer.
init?<T>(exactly: T
) Creates a new instance from the given integer, if it can be represented exactly.
init?<T>(exactly: T
) Creates an integer from the given floating-point value, if it can be represented exactly.
init(integerLiteral: Self
) init(littleEndian: Self
) Creates an integer from its little-endian representation, changing the byte order if necessary.
init<T>(truncatingIfNeeded: T
) Creates a new instance from the bit pattern of the given instance by truncating or sign-extending if needed to fit this type.
static var isSigned: Bool
A Boolean value indicating whether this type is a signed integer type.
static var max: Self
The maximum representable integer in this type.
static var min: Self
The minimum representable integer in this type.
static var zero: Self
The zero value.
static func random(in: ClosedRange<Self>
) -> Self Returns a random value within the specified range.
static func random(in: Range<Self>
) -> Self Returns a random value within the specified range.
static func random<T>(in: ClosedRange<Self>, using: inout T
) -> Self Returns a random value within the specified range, using the given generator as a source for randomness.
static func random<T>(in: Range<Self>, using: inout T
) -> Self Returns a random value within the specified range, using the given generator as a source for randomness.
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 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 Returns the result of performing a bitwise AND operation on the two given values.
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 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 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 &<<= <Other>(lhs: inout Self, rhs: Other
) 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 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 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 &>>= <Other>(lhs: inout Self, rhs: Other
) 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 Returns the additive inverse of the specified value.
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 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 Returns the result of shifting a value’s binary representation the specified number of digits to the left.
static func << <Other>(lhs: Self, rhs: Other
) -> Self Returns the result of shifting a value’s binary representation the specified number of digits to the left.
static func <<= <Other>(lhs: inout Self, rhs: Other
) 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 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 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 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 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 Returns the result of shifting a value’s binary representation the specified number of digits to the right.
static func >> <Other>(lhs: Self, rhs: Other
) -> Self Returns the result of shifting a value’s binary representation the specified number of digits to the right.
static func >>= <Other>(lhs: inout Self, rhs: Other
) static func ^ (lhs: Self, rhs: Self
) -> Self Returns the result of performing a bitwise XOR operation on the two given values.
static func | (lhs: Self, rhs: Self
) -> Self Returns the result of performing a bitwise OR operation on the two given values.
static func ~ (x: Self
) -> Self Returns the inverse of the bits set in the argument.
Instance features
var bigEndian: Self
The big-endian representation of this integer.
var bitWidth: Int
The number of bits in the binary representation of this value.
var description: String
A textual representation of this value.
var littleEndian: Self
The little-endian representation of this integer.
func advanced(by: Int
) -> Self Returns a value that is offset the specified distance from this value.
func distance(to: Self
) -> Int Returns the distance from this value to the given value, expressed as a stride.
func isMultiple(of: Self
) -> Bool func negate(
) Replaces this value with its additive inverse.
func quotientAndRemainder(dividingBy: Self
) -> (quotient: Self, remainder: Self) Returns the quotient and remainder of this value divided by the given value.
Available in Synchronization
Conformances
protocol AtomicRepresentable
A type that supports atomic operations through a separate atomic storage representation.
Typealiases
Type members
Available in Foundation
Type members
Show obsolete interfaces (1)
Hide obsolete interfaces
Type features
init(String, format: IntegerFormatStyle<Self>.Percent, lenient: Bool
) throws init(String, format: IntegerFormatStyle<Self>.Currency, lenient: Bool
) throws init(String, format: IntegerFormatStyle<Self>, lenient: Bool
) throws init<S>(S.ParseInput, strategy: S
) throws Initialize an instance by parsing
value
with the givenstrategy
.init<S>(S.ParseInput, strategy: S
) throws
Instance features
func formatted(
) -> String Format
self
usingIntegerFormatStyle()
func formatted<S>(S
) -> S.FormatOutput Format
self
with the given format.self
is first converted toS.FormatInput
type, then format with the given format.func formatted<S>(S
) -> S.FormatOutput Format
self
with the given format.
Extension in NIOConcurrencyHelpers
Conformances
Typealiases
Type members
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
Extension in Vapor
Conformances
protocol AsyncRequestDecodable
Can convert
Request
to aSelf
.protocol AsyncResponseEncodable
Can convert
self
to aResponse
.protocol Content
Convertible to / from content in an HTTP message.
protocol RequestDecodable
Can convert
Request
to aSelf
.protocol ResponseEncodable
Can convert
self
to aResponse
.
Type features
static var defaultContentType: HTTPMediaType
static func decodeRequest(Request
) -> EventLoopFuture<Self> static func decodeRequest(Request
) async throws -> Self
Instance features
func afterDecode(
) throws func beforeEncode(
) throws func encodeResponse(for: Request
) -> EventLoopFuture<Response> func encodeResponse(status: HTTPStatus, headers: HTTPHeaders, for: Request
) -> EventLoopFuture<Response> Asynchronously encodes
Self
into aResponse
, setting the supplied status and headers.