var baseAddress: UnsafeMutablePointer<Element>?
A pointer to the first element of the buffer.
let count: Int
The number of elements in the buffer.
var debugDescription: String
A textual representation of the buffer, suitable for debugging.
var endIndex: Int
The “past the end” position—that is, the position one greater than the last valid subscript argument.
var indices: UnsafeMutableBufferPointer<Element>.Indices
var isEmpty: Bool
A Boolean value indicating whether the buffer is empty.
var startIndex: Int
The index of the first element in a nonempty buffer.
subscript(Int) -> Element
Accesses the element at the specified position.
subscript(Range<Int>) -> Slice<UnsafeMutableBufferPointer<Element>>
Accesses a contiguous subrange of the buffer’s elements.
subscript(Int) -> Element
Accesses the element at the specified position.
func deallocate()
Deallocates the memory block previously allocated at this buffer pointer’s base address.
func deinitialize() -> UnsafeMutableRawBufferPointer
Deinitializes every instance in this buffer.
func deinitializeElement(at: UnsafeMutableBufferPointer<Element>.Index)
Deinitializes the memory underlying the element at index
.
func distance(from: Int, to: Int) -> Int
func formIndex(after: inout Int)
func formIndex(before: inout Int)
func index(Int, offsetBy: Int) -> Int
func index(Int, offsetBy: Int, limitedBy: Int) -> Int?
func index(after: Int) -> Int
func index(before: Int) -> Int
func initialize<S>(from: S) -> (unwritten: S.Iterator, index: UnsafeMutableBufferPointer<Element>.Index)
Initializes the buffer’s memory with the given elements.
func initialize(fromContentsOf: some Collection<Element>) -> UnsafeMutableBufferPointer<Element>.Index
Initializes the buffer’s memory with every element of the source.
func initialize(repeating: Element)
Initializes every element in this buffer’s memory to a copy of the given value.
func initializeElement(at: UnsafeMutableBufferPointer<Element>.Index, to: consuming Element)
Initializes the element at index
to the given value.
func makeIterator() -> UnsafeMutableBufferPointer<Element>.Iterator
Returns an iterator over the elements of this buffer.
func moveElement(from: UnsafeMutableBufferPointer<Element>.Index) -> Element
Retrieves and returns the element at index
, leaving that element’s underlying memory uninitialized.
func moveInitialize(fromContentsOf: Slice<UnsafeMutableBufferPointer<Element>>) -> UnsafeMutableBufferPointer<Element>.Index
Moves every element of an initialized source buffer into the uninitialized memory referenced by this buffer, leaving the source memory uninitialized and this buffer’s memory initialized.
func moveInitialize(fromContentsOf: UnsafeMutableBufferPointer<Element>) -> UnsafeMutableBufferPointer<Element>.Index
Moves every element of an initialized source buffer into the uninitialized memory referenced by this buffer, leaving the source memory uninitialized and this buffer’s memory initialized.
func moveUpdate(fromContentsOf: Slice<UnsafeMutableBufferPointer<Element>>) -> UnsafeMutableBufferPointer<Element>.Index
Updates this buffer’s initialized memory initialized memory by moving every element from the source buffer slice, leaving the source memory uninitialized.
func moveUpdate(fromContentsOf: UnsafeMutableBufferPointer<Element>) -> UnsafeMutableBufferPointer<Element>.Index
Updates this buffer’s initialized memory initialized memory by moving every element from the source buffer, leaving the source memory uninitialized.
func swapAt(Int, Int)
Exchanges the values at the specified indices of the buffer.
func update(fromContentsOf: some Collection<Element>) -> UnsafeMutableBufferPointer<Element>.Index
Updates the buffer’s initialized memory with every element of the source.
func update(repeating: Element)
Updates every element of this buffer’s initialized memory.
func withContiguousMutableStorageIfAvailable<R>((inout UnsafeMutableBufferPointer<Element>) throws -> R) rethrows -> R?
func withContiguousStorageIfAvailable<R>((UnsafeBufferPointer<Element>) throws -> R) rethrows -> R?
func withMemoryRebound<T, E, Result>(to: T.Type, (UnsafeMutableBufferPointer<T>) throws(E) -> Result) throws(E) -> Result
Executes the given closure while temporarily binding the memory referenced by this buffer to the given type.