index(_:offsetBy:limitedBy:)
func index(_ i: Slice<Base>.Index, offsetBy n: Int, limitedBy limit: Slice<Base>.Index) -> Slice<Base>.Index?
func index(_ i: Slice<Base>.Index, offsetBy n: Int, limitedBy limit: Slice<Base>.Index) -> Slice<Base>.Index?
ss5SliceV5index_8offsetBy07limitedD05IndexQzSgAG_SiAGtF
What are these?9Q74Z
where Base:Collection
import Swift
@frozen struct Slice<Base> where Base : Collection
A view into a subsequence of elements of another collection.
@frozen struct Int
A signed integer value type.
protocol Collection<Element> : Sequence
A sequence whose elements can be traversed multiple times, nondestructively, and accessed by an indexed subscript.
var endIndex: Slice<Base>.Index { get }
var indices: Slice<Base>.Indices { get }
var startIndex: Slice<Base>.Index { get }
subscript(index: Slice<Base>.Index) -> Base.Element { get }
subscript(bounds: Range<Slice<Base>.Index>) -> Slice<Base> { get }
@discardableResult func deinitialize<Element>() -> UnsafeMutableRawBufferPointer where Base == UnsafeMutableBufferPointer<Element>
Deinitializes every instance in this buffer slice.
func deinitializeElement<Element>(at index: UnsafeMutableBufferPointer<Element>.Index) where Base == UnsafeMutableBufferPointer<Element>
Deinitializes the memory underlying the element at index
.
func distance(from start: Slice<Base>.Index, to end: Slice<Base>.Index) -> Int
func formIndex(after i: inout Slice<Base>.Index)
func index(_ i: Slice<Base>.Index, offsetBy n: Int) -> Slice<Base>.Index
func index(after i: Slice<Base>.Index) -> Slice<Base>.Index
func initialize<S>(from source: S) -> (unwritten: S.Iterator, index: Slice<Base>.Index) where Base == UnsafeMutableBufferPointer<S.Element>, S : Sequence
Initializes the buffer slice’s memory with the given elements.
func initialize<Element>(fromContentsOf source: some Collection) -> Slice<Base>.Index where Base == UnsafeMutableBufferPointer<Element>
Initializes the buffer slice’s memory with with every element of the source.
func initialize<Element>(repeating repeatedValue: Element) where Base == UnsafeMutableBufferPointer<Element>
Initializes every element in this buffer slice’s memory to a copy of the given value.
func initializeElement<Element>(at index: Int, to value: Element) where Base == UnsafeMutableBufferPointer<Element>
Initializes the element at index
to the given value.
func moveElement<Element>(from index: Slice<Base>.Index) -> Element where Base == UnsafeMutableBufferPointer<Element>
Retrieves and returns the element at index
, leaving that element’s underlying memory uninitialized.
func moveInitialize<Element>(fromContentsOf source: Slice<UnsafeMutableBufferPointer<Element>>) -> Slice<Base>.Index where Base == UnsafeMutableBufferPointer<Element>
Moves every element of an initialized source buffer slice into the uninitialized memory referenced by this buffer slice, leaving the source memory uninitialized and this buffer slice’s memory initialized.
func moveInitialize<Element>(fromContentsOf source: UnsafeMutableBufferPointer<Element>) -> Slice<Base>.Index where Base == UnsafeMutableBufferPointer<Element>
Moves every element of an initialized source buffer into the uninitialized memory referenced by this buffer slice, leaving the source memory uninitialized and this buffer slice’s memory initialized.
func moveUpdate<Element>(fromContentsOf source: Slice<UnsafeMutableBufferPointer<Element>>) -> Slice<Base>.Index where Base == UnsafeMutableBufferPointer<Element>
Updates this buffer slice’s initialized memory initialized memory by moving every element from the source buffer slice, leaving the source memory uninitialized.
func moveUpdate<Element>(fromContentsOf source: UnsafeMutableBufferPointer<Element>) -> Slice<Base>.Index where Base == UnsafeMutableBufferPointer<Element>
Updates this buffer slice’s initialized memory initialized memory by moving every element from the source buffer, leaving the source memory uninitialized.
func update<S>(from source: S) -> (unwritten: S.Iterator, index: Slice<Base>.Index) where Base == UnsafeMutableBufferPointer<S.Element>, S : Sequence
Updates the buffer slice’s initialized memory with the given elements.
func update<Element>(fromContentsOf source: some Collection) -> Slice<Base>.Index where Base == UnsafeMutableBufferPointer<Element>
Updates the buffer slice’s initialized memory with every element of the source.
func update<Element>(repeating repeatedValue: Element) where Base == UnsafeMutableBufferPointer<Element>
Updates every element of this buffer slice’s initialized memory.
func withContiguousMutableStorageIfAvailable<R, Element>(_ body: (inout UnsafeMutableBufferPointer<Element>) throws -> R) rethrows -> R? where Base == UnsafeMutableBufferPointer<Element>
func withContiguousStorageIfAvailable<R>(_ body: (UnsafeBufferPointer<Slice<Base>.Element>) throws -> R) rethrows -> R?
func withMemoryRebound<T, Result, Element>(to type: T.Type, _ body: (UnsafeBufferPointer<T>) throws -> Result) rethrows -> Result where Base == UnsafeBufferPointer<Element>
Executes the given closure while temporarily binding the memory referenced by this buffer slice to the given type.
func withMemoryRebound<T, Result, Element>(to type: T.Type, _ body: (UnsafeMutableBufferPointer<T>) throws -> Result) rethrows -> Result where Base == UnsafeMutableBufferPointer<Element>
Executes the given closure while temporarily binding the memory referenced by this buffer slice to the given type.
typealias Element = Base.Element
typealias Index = Base.Index
typealias Indices = Base.Indices
typealias Iterator = IndexingIterator<Slice<Base>>
typealias SubSequence = Slice<Base>