Span
Span<Element> represents a contiguous region of memory which contains initialized instances of Element.
Declaration
@frozen struct Span<Element> where Element : ~CopyableOverview
A Span instance is a non-owning, non-escaping view into memory. When a Span is created, it inherits the lifetime of the container owning the contiguous memory, ensuring temporal safety and avoiding use-after-free errors. Operations on Span are bounds-checked, ensuring spatial safety and avoiding buffer overflow errors.
Topics
Initializers
Instance Properties
Instance Methods
extracting(_:)extracting(_:)extracting(_:)extracting(droppingFirst:)extracting(droppingLast:)extracting(first:)extracting(last:)extracting(unchecked:)extracting(unchecked:)indices(of:)isIdentical(to:)withUnsafeBufferPointer(_:)withUnsafeBytes(_:)