- asDataOf
auto asDataOf()
Soft (memory-safe) cast:
Cast contents to another type, and returns an instance with that contents.
Constness is preserved. No copying is done.
- castTo
TData!U castTo()
Hard (normally memory-unsafe) cast:
Cast contents to another type, and returns an instance with that contents.
The current instance is cleared. U may have an incompatible constness.
To enforce memory safety, the current instance must be the only one
holding a reference to the data (call ensureUnique first).
No copying is done.
- clear
void clear()
Unreference contents, freeing it if this was the last reference.
- deleteContents
deprecated void deleteContents()
Undocumented in source.
- ensureUnique
TData ensureUnique()
Returns an instance with the same data as the current instance, and a reference count of 1.
The current instance is cleared.
If the current instance already has a reference count of 1, no copying is done.
- enter
void enter(void delegate(scope T[]) fn)
Get temporary access to the data referenced by this Data instance.
- enter
void enter(void delegate(scope T[]) @(safe) fn)
Undocumented in source. Be warned that the author may not have intended to support it.
- enter
void enter(void delegate(scope T[]) nothrow fn)
Undocumented in source. Be warned that the author may not have intended to support it.
- enter
void enter(void delegate(scope T[]) @(safe) nothrow fn)
Undocumented in source. Be warned that the author may not have intended to support it.
- enter
void enter(void delegate(scope T[]) @(nogc) fn)
Undocumented in source. Be warned that the author may not have intended to support it.
- enter
void enter(void delegate(scope T[]) @(safe) @(nogc) fn)
Undocumented in source. Be warned that the author may not have intended to support it.
- enter
void enter(void delegate(scope T[]) nothrow @(nogc) fn)
Undocumented in source. Be warned that the author may not have intended to support it.
- enter
void enter(void delegate(scope T[]) @(safe) nothrow @(nogc) fn)
Undocumented in source. Be warned that the author may not have intended to support it.
- enter
auto enter(Dg fn)
Undocumented in source. Be warned that the author may not have intended to support it.
- front
T front()
Undocumented in source. Be warned that the author may not have intended to support it.
- indexOf
sizediff_t indexOf(const(T)[] needle)
Undocumented in source. Be warned that the author may not have intended to support it.
- indexOf
deprecated sizediff_t indexOf(const(void)[] needle)
Undocumented in source. Be warned that the author may not have intended to support it.
- opAssign
void opAssign(typeof(null) )
Allow assigning null to clear.
- opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
- opIndex
T opIndex(size_t index)
Access an individual item.
- opIndexAssign
T opIndexAssign(T value, size_t index)
Write an individual item.
- opSlice
TData opSlice()
TData opSlice(size_t x, size_t y)
Returns a Data pointing at a slice of this Data's contents.
- popFront
void popFront()
Undocumented in source. Be warned that the author may not have intended to support it.
- toGC
T[] toGC()
Put a copy of the data on D's managed heap, and return it.
- toHeap
deprecated T[] toHeap()
Undocumented in source. Be warned that the author may not have intended to support it.
- capacity
size_t capacity [@property getter]
Return the maximum value that can be set to length without causing a reallocation
- contents
deprecated inout(T)[] contents [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
- dup
This dup [@property getter]
Create a copy of the data
- empty
bool empty [@property getter]
- length
size_t length [@property getter]
- length
size_t length [@property setter]
- mcontents
deprecated Unqual!T[] mcontents [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
- mptr
deprecated Unqual!T* mptr [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
- ptr
deprecated inout(T)* ptr [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
- unsafeContents
inout(T)[] unsafeContents [@property getter]
Get the referenced data. Unsafe!
A reference to a reference-counted block of memory. Represents a slice of data, which may be backed by managed memory, unmanaged memory, memory-mapped files, etc.