Enumerationswift 6.0.3Dispatch
Deallocator
enum Deallocator
enum Deallocator
import Dispatch
struct DispatchData
case custom(DispatchQueue?, () -> Void)
A custom deallocator
case free
Use free
case unmap
Use munmap
init(bytes buffer: UnsafeRawBufferPointer)
Initialize a Data
with copied memory content.
init(bytesNoCopy bytes: UnsafeRawBufferPointer, deallocator: DispatchData.Deallocator = .free)
Initialize a Data
without copying the bytes.
static let empty: DispatchData
var count: Int { get }
var endIndex: DispatchData.Index { get }
var startIndex: DispatchData.Index { get }
subscript(bounds: Range<Int>) -> Slice<DispatchData> { get }
subscript(index: DispatchData.Index) -> UInt8 { get }
Sets or returns the byte at the specified index.
mutating func append(_ other: DispatchData)
Append data to the data.
mutating func append<SourceType>(_ buffer: UnsafeBufferPointer<SourceType>)
Append a buffer of bytes to the data.
mutating func append(_ bytes: UnsafeRawBufferPointer)
Append bytes to the data.
func copyBytes(to pointer: UnsafeMutableRawBufferPointer, count: Int)
Copy the contents of the data to a pointer.
func copyBytes<DestinationType>(to buffer: UnsafeMutableBufferPointer<DestinationType>, from range: Range<DispatchData.Index>? = nil) -> Int
Copy the contents of the data into a buffer.
func copyBytes(to pointer: UnsafeMutableRawBufferPointer, from range: Range<DispatchData.Index>)
Copy a subset of the contents of the data to a pointer.
func enumerateBytes(_ block: (UnsafeBufferPointer<UInt8>, Int, inout Bool) -> Void)
func index(after i: DispatchData.Index) -> DispatchData.Index
func index(before i: DispatchData.Index) -> DispatchData.Index
func makeIterator() -> DispatchData.Iterator
An iterator over the contents of the data.
func region(location: Int) -> (data: DispatchData, offset: Int)
func subdata(in range: Range<DispatchData.Index>) -> DispatchData
Return a new copy of the data in a specified range.
func withUnsafeBytes<Result, ContentType>(body: (UnsafePointer<ContentType>) throws -> Result) rethrows -> Result
typealias Index = Int
typealias Indices = DefaultIndices<DispatchData>
typealias Iterator = DispatchDataIterator
init(bytes buffer: UnsafeBufferPointer<UInt8>)
Initialize a Data
with copied memory content.
init(bytesNoCopy bytes: UnsafeBufferPointer<UInt8>, deallocator: DispatchData.Deallocator = .free)
Initialize a Data
without copying the bytes.
mutating func append(_ bytes: UnsafePointer<UInt8>, count: Int)
Append bytes to the data.
func copyBytes(to pointer: UnsafeMutablePointer<UInt8>, count: Int)
Copy the contents of the data to a pointer.
func copyBytes(to pointer: UnsafeMutablePointer<UInt8>, from range: Range<DispatchData.Index>)
Copy a subset of the contents of the data to a pointer.
func enumerateBytes(block: (UnsafeBufferPointer<UInt8>, Int, inout Bool) -> Void)