blob: a546e7a205b8a9d2d8f57e15b84ea2a461bfbd32 [file] [log] [blame] [view]
<link rel="stylesheet" href="../style.css" />
[TOC]
# fuchsia.mem
<div class="fidl-version-div"><span class="fidl-attribute fidl-version">Added: 7</span></div>
## **STRUCTS**
### Buffer [resource](/fuchsia-src/reference/fidl/language/language.md#value-vs-resource){:.fidl-attribute} {#Buffer data-text="Buffer"}
*Defined in [fuchsia.mem/buffer.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.mem/buffer.fidl;l=17)*
<p>A buffer for data whose size is not necessarily a multiple of the page
size.</p>
<p>DEPRECATED: This type is superfluous and deprecated. Instead of using this type,
use a zx.handle:VMO object and store the size of the contents in the ZX_PROP_VMO_CONTENT_SIZE
property.</p>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="Buffer.vmo">
<td><code>vmo</code></td>
<td>
<code>handle&lt;vmo&gt;</code>
</td>
<td><p>The vmo that contains the buffer.</p>
</td>
<td>No default</td>
</tr>
<tr id="Buffer.size">
<td><code>size</code></td>
<td>
<code>uint64</code>
</td>
<td><p>The number of bytes in the buffer.</p>
<p>The content of the buffer begin at the start of the VMO and continue
for <code>size</code> bytes. To specify a range of bytes that do not start at
the beginning of the VMO, use <code>Range</code> rather than buffer.</p>
<p>This size must not be greater than the physical size of the VMO.</p>
</td>
<td>No default</td>
</tr>
</table>
### Range [resource](/fuchsia-src/reference/fidl/language/language.md#value-vs-resource){:.fidl-attribute} {#Range data-text="Range"}
*Defined in [fuchsia.mem/range.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.mem/range.fidl;l=9)*
<p>A range of bytes within a VMO.</p>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="Range.vmo">
<td><code>vmo</code></td>
<td>
<code>handle&lt;vmo&gt;</code>
</td>
<td><p>The vmo that contains the bytes.</p>
</td>
<td>No default</td>
</tr>
<tr id="Range.offset">
<td><code>offset</code></td>
<td>
<code>uint64</code>
</td>
<td><p>The offset of the first byte within the range relative to the start of
the VMO.</p>
<p>For example, if <code>offset</code> is zero, then the first byte in the range is
the first byte in the VMO.</p>
</td>
<td>No default</td>
</tr>
<tr id="Range.size">
<td><code>size</code></td>
<td>
<code>uint64</code>
</td>
<td><p>The number of bytes in the range.</p>
<p>For example, if the offset is 3 and the size is 2, and the VMO starts
with &quot;abcdefg...&quot;, then the range contains &quot;de&quot;.</p>
<p>The sum of the offset and the size must not be greater than the
physical size of the VMO.</p>
</td>
<td>No default</td>
</tr>
</table>
## **UNIONS**
### Data [flexible](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} [resource](/fuchsia-src/reference/fidl/language/language.md#value-vs-resource){:.fidl-attribute} {#Data data-text="Data"}
*Defined in [fuchsia.mem/buffer.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.mem/buffer.fidl;l=37)*
<p>Binary data that might be stored inline or in a VMO.</p>
<p>Useful for performance-sensitive protocols that sometimes receive small
amounts of binary data (i.e., which is more efficient to provide using
<code>bytes</code>) but also need to support arbitrary amounts of data (i.e., which
need to be provided out-of-line in a <code>Buffer</code>).</p>
<table>
<tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr>
<tr id="Data.bytes">
<td><h3 id="Data.bytes" class="add-link hide-from-toc">1</h3></td>
<td><code>bytes</code></td>
<td>
<code>vector&lt;uint8&gt;</code>
</td>
<td><p>The binary data provided inline in the message.</p>
</td>
</tr>
<tr id="Data.buffer">
<td><h3 id="Data.buffer" class="add-link hide-from-toc">2</h3></td>
<td><code>buffer</code></td>
<td>
<code><a class='link' href='#Buffer'>Buffer</a></code>
</td>
<td><p>The binary data provided out-of-line in a <code>Buffer</code>.</p>
</td>
</tr>
</table>