Protocolswift 6.0.1FoundationEssentials
DataProtocol
- iOS
- 8.0+
- macOS
- 10.10+
- tvOS
- 9.0+
- watchOS
- 2.0+
protocol DataProtocol : RandomAccessCollection where Self.Element == UInt8, Self.SubSequence : DataProtocol
Supertypes
protocol BidirectionalCollection<Element>
A collection that supports backward as well as forward traversal.
protocol Collection<Element>
A sequence whose elements can be traversed multiple times, nondestructively, and accessed by an indexed subscript.
protocol RandomAccessCollection<Element>
A collection that supports efficient random-access index traversal.
protocol Sequence<Element>
A type that provides sequential, iterated access to its elements.
Requirements
Type members
Instance members
var regions: Self.Regions
A
BidirectionalCollection
ofDataProtocol
elements which compose a discontiguous buffer of memory. Each region is a contiguous buffer of bytes.func copyBytes<DestinationType>(to: UnsafeMutableBufferPointer<DestinationType>, count: Int
) -> Int Copies
count
bytes from the start of the buffer to the destination buffer.func copyBytes(to: UnsafeMutableRawBufferPointer, count: Int
) -> Int Copies
count
bytes from the start of the buffer to the destination buffer.func copyBytes<DestinationType, R>(to: UnsafeMutableBufferPointer<DestinationType>, from: R
) -> Int Copies the bytes from the given range to the destination buffer.
func copyBytes<R>(to: UnsafeMutableRawBufferPointer, from: R
) -> Int Copies the bytes from the given range to the destination buffer.
func firstRange<D, R>(of: D, in: R
) -> Range<Self.Index>? Returns the first found range of the given data buffer.
func lastRange<D, R>(of: D, in: R
) -> Range<Self.Index>? Returns the last found range of the given data buffer.
Citizens in FoundationEssentials
Instance members
func copyBytes<DestinationType>(to: UnsafeMutableBufferPointer<DestinationType>
) -> Int func copyBytes(to: UnsafeMutableRawBufferPointer
) -> Int func copyBytes<DestinationType>(to: UnsafeMutableBufferPointer<DestinationType>, count: Int
) -> Int func copyBytes(to: UnsafeMutableRawBufferPointer, count: Int
) -> Int func copyBytes<DestinationType, R>(to: UnsafeMutableBufferPointer<DestinationType>, from: R
) -> Int func copyBytes<R>(to: UnsafeMutableRawBufferPointer, from: R
) -> Int func firstRange<D>(of: D
) -> Range<Self.Index>? func firstRange<D, R>(of: D, in: R
) -> Range<Self.Index>? func lastRange<D>(of: D
) -> Range<Self.Index>? func lastRange<D, R>(of: D, in: R
) -> Range<Self.Index>?
Subtypes
Citizens in FoundationEssentials
where Self:ContiguousBytes