Import std.ffi.buffer
std.ffi.buffer
Buffer<T>: native memory of C's values at an address that doesn't move, which C code reads and
fills through its Pointer and safe code reads and sets with [], each index checked against its
Count, so std.io and C libraries share memory with safe code without copying it.
std/ffi/buffer.fb
Types
Buffer
class
Public Class Buffer<T: CData> Implements Iterable<T>
Count T's of native memory at an address that doesn't move: its own, all 0 at first, given back once nothing has the Buffer; part of another Buffer's, which a view from Slice keeps alive; or memory C owns, which a view from View promises is there while it is.
-
countT's, all 0. Panics whencountis negative, or there isn't that much memory. -
A new Buffer of the
items, in order. Panics when there isn't that much memory. -
@PanicsAtCaller Public Unsafe Static Method View(pointer: Ptr<T>, count: Int64): Buffer<T>static method #A view of
countT's of memory C owns, frompointer, which C keeps there while the view is, since nothing else does, and doesn't give back. Panics whencountis negative, or isn't 0 andpointeris Null, or the T's take more bytes than an Int64 counts, as New does. -
How many T's it has.
-
The T at index, from 0 to Count minus 1.
-
Gives the T at index, from 0 to Count minus 1, a new value, in the memory.
-
Where its T's start, for C code, which can read and write Count of them there while the Buffer, or a view that keeps it alive, is.
-
The T's from
startup tofinish, without the one atfinish, as a view of its memory, which keeps this Buffer alive and sees what changes in it. -
Copies its T's to the start of
destination, which has room for them. The two can share memory, as two views of one Buffer do. -
Its T's, in a new array. Panics when there are more than an array holds.
-
Its T's, in order.
BufferIterator
struct
Public Struct BufferIterator<T: CData> Implements Iterator<T>
The values of a Buffer, in order, which For ... In goes over.
-
The next value, or Null when there are no more.
Doc from
std.core.iterator.Iterator.Next.
Report an issue with this page or with FutureBlitz on GitHub.