Instance Methodswift 6.0.1Swift
withContiguousStorageIfAvailable(_:)
func withContiguousStorageIfAvailable<R>(_ body: (UnsafeBufferPointer<Slice<Base>.Element>) throws -> R) rethrows -> R?
Other members in extension
Typealiases
Instance members
var endIndex: Slice<Base>.Index
var indices: Slice<Base>.Indices
var startIndex: Slice<Base>.Index
subscript(Slice<Base>.Index
) -> Base.Element subscript(Range<Slice<Base>.Index>
) -> Slice<Base> func deinitialize<Element>(
) -> UnsafeMutableRawBufferPointer Deinitializes every instance in this buffer slice.
func deinitializeElement<Element>(at: UnsafeMutableBufferPointer<Element>.Index
) Deinitializes the memory underlying the element at
index
.func distance(from: Slice<Base>.Index, to: Slice<Base>.Index
) -> Int func formIndex(after: inout Slice<Base>.Index
) func index(Slice<Base>.Index, offsetBy: Int
) -> Slice<Base>.Index func index(Slice<Base>.Index, offsetBy: Int, limitedBy: Slice<Base>.Index
) -> Slice<Base>.Index? func index(after: Slice<Base>.Index
) -> Slice<Base>.Index func initialize<S>(from: S
) -> (unwritten: S.Iterator, index: Slice<Base>.Index) Initializes the buffer slice’s memory with the given elements.
func initialize<Element>(fromContentsOf: some Collection
) -> Slice<Base>.Index Initializes the buffer slice’s memory with with every element of the source.
func initialize<Element>(repeating: Element
) Initializes every element in this buffer slice’s memory to a copy of the given value.
func initializeElement<Element>(at: Int, to: Element
) Initializes the element at
index
to the given value.func moveElement<Element>(from: Slice<Base>.Index
) -> Element Retrieves and returns the element at
index
, leaving that element’s underlying memory uninitialized.func moveInitialize<Element>(fromContentsOf: Slice<UnsafeMutableBufferPointer<Element>>
) -> Slice<Base>.Index 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: UnsafeMutableBufferPointer<Element>
) -> Slice<Base>.Index 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: Slice<UnsafeMutableBufferPointer<Element>>
) -> Slice<Base>.Index 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: UnsafeMutableBufferPointer<Element>
) -> Slice<Base>.Index 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: S
) -> (unwritten: S.Iterator, index: Slice<Base>.Index) Updates the buffer slice’s initialized memory with the given elements.
func update<Element>(fromContentsOf: some Collection
) -> Slice<Base>.Index Updates the buffer slice’s initialized memory with every element of the source.
func update<Element>(repeating: Element
) Updates every element of this buffer slice’s initialized memory.
func withContiguousMutableStorageIfAvailable<R, Element>((inout UnsafeMutableBufferPointer<Element>) throws -> R
) rethrows -> R? func withMemoryRebound<T, Result, Element>(to: T.Type, (UnsafeBufferPointer<T>) throws -> Result
) rethrows -> Result Executes the given closure while temporarily binding the memory referenced by this buffer slice to the given type.
func withMemoryRebound<T, Result, Element>(to: T.Type, (UnsafeMutableBufferPointer<T>) throws -> Result
) rethrows -> Result Executes the given closure while temporarily binding the memory referenced by this buffer slice to the given type.