229 lines
No EOL
33 KiB
HTML
229 lines
No EOL
33 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<meta name="generator" content="rustdoc">
|
||
<meta name="description" content="API documentation for the Rust `WriteBytesExt` trait in crate `byteorder`.">
|
||
<meta name="keywords" content="rust, rustlang, rust-lang, WriteBytesExt">
|
||
|
||
<title>byteorder::WriteBytesExt - Rust</title>
|
||
|
||
<link rel="stylesheet" type="text/css" href="../normalize.css">
|
||
<link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle">
|
||
|
||
<link rel="stylesheet" type="text/css" href="../dark.css">
|
||
<link rel="stylesheet" type="text/css" href="../main.css" id="themeStyle">
|
||
<script src="../storage.js"></script>
|
||
|
||
|
||
|
||
|
||
</head>
|
||
<body class="rustdoc trait">
|
||
<!--[if lte IE 8]>
|
||
<div class="warning">
|
||
This old browser is unsupported and will most likely display funky
|
||
things.
|
||
</div>
|
||
<![endif]-->
|
||
|
||
|
||
|
||
<nav class="sidebar">
|
||
<div class="sidebar-menu">☰</div>
|
||
|
||
<p class='location'>Trait WriteBytesExt</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.write_u8">write_u8</a><a href="#method.write_i8">write_i8</a><a href="#method.write_u16">write_u16</a><a href="#method.write_i16">write_i16</a><a href="#method.write_u24">write_u24</a><a href="#method.write_i24">write_i24</a><a href="#method.write_u32">write_u32</a><a href="#method.write_i32">write_i32</a><a href="#method.write_u48">write_u48</a><a href="#method.write_i48">write_i48</a><a href="#method.write_u64">write_u64</a><a href="#method.write_i64">write_i64</a><a href="#method.write_uint">write_uint</a><a href="#method.write_int">write_int</a><a href="#method.write_f32">write_f32</a><a href="#method.write_f64">write_f64</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>byteorder</a></p><script>window.sidebarCurrent = {name: 'WriteBytesExt', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div>
|
||
</nav>
|
||
|
||
<div class="theme-picker">
|
||
<button id="theme-picker" aria-label="Pick another theme!">
|
||
<img src="../brush.svg" width="18" alt="Pick another theme!">
|
||
</button>
|
||
<div id="theme-choices"></div>
|
||
</div>
|
||
<script src="../theme.js"></script>
|
||
<nav class="sub">
|
||
<form class="search-form js-only">
|
||
<div class="search-container">
|
||
<input class="search-input" name="search"
|
||
autocomplete="off"
|
||
placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
|
||
type="search">
|
||
</div>
|
||
</form>
|
||
</nav>
|
||
|
||
<section id='main' class="content">
|
||
<h1 class='fqn'><span class='in-band'>Trait <a href='index.html'>byteorder</a>::<wbr><a class="trait" href=''>WriteBytesExt</a></span><span class='out-of-band'><span id='render-detail'>
|
||
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
|
||
[<span class='inner'>−</span>]
|
||
</a>
|
||
</span><a class='srclink' href='../src/byteorder/io.rs.html#1048-1338' title='goto source code'>[src]</a></span></h1>
|
||
<pre class='rust trait'>pub trait WriteBytesExt: <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html" title="trait std::io::Write">Write</a> {
|
||
fn <a href='#method.write_u8' class='fnname'>write_u8</a>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>> { ... }
|
||
<div class='item-spacer'></div> fn <a href='#method.write_i8' class='fnname'>write_i8</a>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i8.html">i8</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>> { ... }
|
||
<div class='item-spacer'></div> fn <a href='#method.write_u16' class='fnname'>write_u16</a><T: <a class="trait" href="../byteorder/trait.ByteOrder.html" title="trait byteorder::ByteOrder">ByteOrder</a>>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u16.html">u16</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>> { ... }
|
||
<div class='item-spacer'></div> fn <a href='#method.write_i16' class='fnname'>write_i16</a><T: <a class="trait" href="../byteorder/trait.ByteOrder.html" title="trait byteorder::ByteOrder">ByteOrder</a>>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i16.html">i16</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>> { ... }
|
||
<div class='item-spacer'></div> fn <a href='#method.write_u24' class='fnname'>write_u24</a><T: <a class="trait" href="../byteorder/trait.ByteOrder.html" title="trait byteorder::ByteOrder">ByteOrder</a>>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>> { ... }
|
||
<div class='item-spacer'></div> fn <a href='#method.write_i24' class='fnname'>write_i24</a><T: <a class="trait" href="../byteorder/trait.ByteOrder.html" title="trait byteorder::ByteOrder">ByteOrder</a>>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>> { ... }
|
||
<div class='item-spacer'></div> fn <a href='#method.write_u32' class='fnname'>write_u32</a><T: <a class="trait" href="../byteorder/trait.ByteOrder.html" title="trait byteorder::ByteOrder">ByteOrder</a>>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>> { ... }
|
||
<div class='item-spacer'></div> fn <a href='#method.write_i32' class='fnname'>write_i32</a><T: <a class="trait" href="../byteorder/trait.ByteOrder.html" title="trait byteorder::ByteOrder">ByteOrder</a>>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>> { ... }
|
||
<div class='item-spacer'></div> fn <a href='#method.write_u48' class='fnname'>write_u48</a><T: <a class="trait" href="../byteorder/trait.ByteOrder.html" title="trait byteorder::ByteOrder">ByteOrder</a>>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>> { ... }
|
||
<div class='item-spacer'></div> fn <a href='#method.write_i48' class='fnname'>write_i48</a><T: <a class="trait" href="../byteorder/trait.ByteOrder.html" title="trait byteorder::ByteOrder">ByteOrder</a>>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>> { ... }
|
||
<div class='item-spacer'></div> fn <a href='#method.write_u64' class='fnname'>write_u64</a><T: <a class="trait" href="../byteorder/trait.ByteOrder.html" title="trait byteorder::ByteOrder">ByteOrder</a>>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>> { ... }
|
||
<div class='item-spacer'></div> fn <a href='#method.write_i64' class='fnname'>write_i64</a><T: <a class="trait" href="../byteorder/trait.ByteOrder.html" title="trait byteorder::ByteOrder">ByteOrder</a>>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>> { ... }
|
||
<div class='item-spacer'></div> fn <a href='#method.write_uint' class='fnname'>write_uint</a><T: <a class="trait" href="../byteorder/trait.ByteOrder.html" title="trait byteorder::ByteOrder">ByteOrder</a>>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>, nbytes: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>> { ... }
|
||
<div class='item-spacer'></div> fn <a href='#method.write_int' class='fnname'>write_int</a><T: <a class="trait" href="../byteorder/trait.ByteOrder.html" title="trait byteorder::ByteOrder">ByteOrder</a>>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>, nbytes: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>> { ... }
|
||
<div class='item-spacer'></div> fn <a href='#method.write_f32' class='fnname'>write_f32</a><T: <a class="trait" href="../byteorder/trait.ByteOrder.html" title="trait byteorder::ByteOrder">ByteOrder</a>>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>> { ... }
|
||
<div class='item-spacer'></div> fn <a href='#method.write_f64' class='fnname'>write_f64</a><T: <a class="trait" href="../byteorder/trait.ByteOrder.html" title="trait byteorder::ByteOrder">ByteOrder</a>>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>> { ... }
|
||
}</pre><div class='docblock'><p>Extends <a href="https://doc.rust-lang.org/std/io/trait.Write.html"><code>Write</code></a> with methods for writing numbers. (For <code>std::io</code>.)</p>
|
||
<p>Most of the methods defined here have an unconstrained type parameter that
|
||
must be explicitly instantiated. Typically, it is instantiated with either
|
||
the <a href="enum.BigEndian.html"><code>BigEndian</code></a> or <a href="enum.LittleEndian.html"><code>LittleEndian</code></a> types defined in this crate.</p>
|
||
<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
|
||
<p>Write unsigned 16 bit big-endian integers to a <a href="https://doc.rust-lang.org/std/io/trait.Write.html"><code>Write</code></a>:</p>
|
||
|
||
<pre class="rust rust-example-rendered">
|
||
<span class="kw">use</span> <span class="ident">byteorder</span>::{<span class="ident">BigEndian</span>, <span class="ident">WriteBytesExt</span>};
|
||
|
||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">wtr</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[];
|
||
<span class="ident">wtr</span>.<span class="ident">write_u16</span>::<span class="op"><</span><span class="ident">BigEndian</span><span class="op">></span>(<span class="number">517</span>).<span class="ident">unwrap</span>();
|
||
<span class="ident">wtr</span>.<span class="ident">write_u16</span>::<span class="op"><</span><span class="ident">BigEndian</span><span class="op">></span>(<span class="number">768</span>).<span class="ident">unwrap</span>();
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">wtr</span>, <span class="macro">vec</span><span class="macro">!</span>[<span class="number">2</span>, <span class="number">5</span>, <span class="number">3</span>, <span class="number">0</span>]);</pre>
|
||
</div>
|
||
<h2 id='provided-methods' class='small-section-header'>
|
||
Provided Methods<a href='#provided-methods' class='anchor'></a>
|
||
</h2>
|
||
<div class='methods'>
|
||
<h3 id='method.write_u8' class='method'><span id='write_u8.v' class='invisible'><code>fn <a href='#method.write_u8' class='fnname'>write_u8</a>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code></span></h3><div class='docblock'><p>Writes an unsigned 8 bit integer to the underlying writer.</p>
|
||
<p>Note that since this writes a single byte, no byte order conversions
|
||
are used. It is included for completeness.</p>
|
||
<h1 id="errors" class="section-header"><a href="#errors">Errors</a></h1>
|
||
<p>This method returns the same errors as <a href="https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all"><code>Write::write_all</code></a>.</p>
|
||
</div><h3 id='method.write_i8' class='method'><span id='write_i8.v' class='invisible'><code>fn <a href='#method.write_i8' class='fnname'>write_i8</a>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i8.html">i8</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code></span></h3><div class='docblock'><p>Writes a signed 8 bit integer to the underlying writer.</p>
|
||
<p>Note that since this writes a single byte, no byte order conversions
|
||
are used. It is included for completeness.</p>
|
||
<h1 id="errors-1" class="section-header"><a href="#errors-1">Errors</a></h1>
|
||
<p>This method returns the same errors as <a href="https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all"><code>Write::write_all</code></a>.</p>
|
||
</div><h3 id='method.write_u16' class='method'><span id='write_u16.v' class='invisible'><code>fn <a href='#method.write_u16' class='fnname'>write_u16</a><T: <a class="trait" href="../byteorder/trait.ByteOrder.html" title="trait byteorder::ByteOrder">ByteOrder</a>>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u16.html">u16</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code></span></h3><div class='docblock'><p>Writes an unsigned 16 bit integer to the underlying writer.</p>
|
||
<h1 id="errors-2" class="section-header"><a href="#errors-2">Errors</a></h1>
|
||
<p>This method returns the same errors as <a href="https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all"><code>Write::write_all</code></a>.</p>
|
||
</div><h3 id='method.write_i16' class='method'><span id='write_i16.v' class='invisible'><code>fn <a href='#method.write_i16' class='fnname'>write_i16</a><T: <a class="trait" href="../byteorder/trait.ByteOrder.html" title="trait byteorder::ByteOrder">ByteOrder</a>>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i16.html">i16</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code></span></h3><div class='docblock'><p>Writes a signed 16 bit integer to the underlying writer.</p>
|
||
<h1 id="errors-3" class="section-header"><a href="#errors-3">Errors</a></h1>
|
||
<p>This method returns the same errors as <a href="https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all"><code>Write::write_all</code></a>.</p>
|
||
</div><h3 id='method.write_u24' class='method'><span id='write_u24.v' class='invisible'><code>fn <a href='#method.write_u24' class='fnname'>write_u24</a><T: <a class="trait" href="../byteorder/trait.ByteOrder.html" title="trait byteorder::ByteOrder">ByteOrder</a>>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code></span></h3><div class='docblock'><p>Writes an unsigned 24 bit integer to the underlying writer.</p>
|
||
<h1 id="errors-4" class="section-header"><a href="#errors-4">Errors</a></h1>
|
||
<p>This method returns the same errors as <a href="https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all"><code>Write::write_all</code></a>.</p>
|
||
</div><h3 id='method.write_i24' class='method'><span id='write_i24.v' class='invisible'><code>fn <a href='#method.write_i24' class='fnname'>write_i24</a><T: <a class="trait" href="../byteorder/trait.ByteOrder.html" title="trait byteorder::ByteOrder">ByteOrder</a>>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code></span></h3><div class='docblock'><p>Writes a signed 24 bit integer to the underlying writer.</p>
|
||
<h1 id="errors-5" class="section-header"><a href="#errors-5">Errors</a></h1>
|
||
<p>This method returns the same errors as <a href="https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all"><code>Write::write_all</code></a>.</p>
|
||
</div><h3 id='method.write_u32' class='method'><span id='write_u32.v' class='invisible'><code>fn <a href='#method.write_u32' class='fnname'>write_u32</a><T: <a class="trait" href="../byteorder/trait.ByteOrder.html" title="trait byteorder::ByteOrder">ByteOrder</a>>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code></span></h3><div class='docblock'><p>Writes an unsigned 32 bit integer to the underlying writer.</p>
|
||
<h1 id="errors-6" class="section-header"><a href="#errors-6">Errors</a></h1>
|
||
<p>This method returns the same errors as <a href="https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all"><code>Write::write_all</code></a>.</p>
|
||
</div><h3 id='method.write_i32' class='method'><span id='write_i32.v' class='invisible'><code>fn <a href='#method.write_i32' class='fnname'>write_i32</a><T: <a class="trait" href="../byteorder/trait.ByteOrder.html" title="trait byteorder::ByteOrder">ByteOrder</a>>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code></span></h3><div class='docblock'><p>Writes a signed 32 bit integer to the underlying writer.</p>
|
||
<h1 id="errors-7" class="section-header"><a href="#errors-7">Errors</a></h1>
|
||
<p>This method returns the same errors as <a href="https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all"><code>Write::write_all</code></a>.</p>
|
||
</div><h3 id='method.write_u48' class='method'><span id='write_u48.v' class='invisible'><code>fn <a href='#method.write_u48' class='fnname'>write_u48</a><T: <a class="trait" href="../byteorder/trait.ByteOrder.html" title="trait byteorder::ByteOrder">ByteOrder</a>>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code></span></h3><div class='docblock'><p>Writes an unsigned 48 bit integer to the underlying writer.</p>
|
||
<h1 id="errors-8" class="section-header"><a href="#errors-8">Errors</a></h1>
|
||
<p>This method returns the same errors as <a href="https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all"><code>Write::write_all</code></a>.</p>
|
||
</div><h3 id='method.write_i48' class='method'><span id='write_i48.v' class='invisible'><code>fn <a href='#method.write_i48' class='fnname'>write_i48</a><T: <a class="trait" href="../byteorder/trait.ByteOrder.html" title="trait byteorder::ByteOrder">ByteOrder</a>>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code></span></h3><div class='docblock'><p>Writes a signed 48 bit integer to the underlying writer.</p>
|
||
<h1 id="errors-9" class="section-header"><a href="#errors-9">Errors</a></h1>
|
||
<p>This method returns the same errors as <a href="https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all"><code>Write::write_all</code></a>.</p>
|
||
</div><h3 id='method.write_u64' class='method'><span id='write_u64.v' class='invisible'><code>fn <a href='#method.write_u64' class='fnname'>write_u64</a><T: <a class="trait" href="../byteorder/trait.ByteOrder.html" title="trait byteorder::ByteOrder">ByteOrder</a>>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code></span></h3><div class='docblock'><p>Writes an unsigned 64 bit integer to the underlying writer.</p>
|
||
<h1 id="errors-10" class="section-header"><a href="#errors-10">Errors</a></h1>
|
||
<p>This method returns the same errors as <a href="https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all"><code>Write::write_all</code></a>.</p>
|
||
</div><h3 id='method.write_i64' class='method'><span id='write_i64.v' class='invisible'><code>fn <a href='#method.write_i64' class='fnname'>write_i64</a><T: <a class="trait" href="../byteorder/trait.ByteOrder.html" title="trait byteorder::ByteOrder">ByteOrder</a>>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code></span></h3><div class='docblock'><p>Writes a signed 64 bit integer to the underlying writer.</p>
|
||
<h1 id="errors-11" class="section-header"><a href="#errors-11">Errors</a></h1>
|
||
<p>This method returns the same errors as <a href="https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all"><code>Write::write_all</code></a>.</p>
|
||
</div><h3 id='method.write_uint' class='method'><span id='write_uint.v' class='invisible'><code>fn <a href='#method.write_uint' class='fnname'>write_uint</a><T: <a class="trait" href="../byteorder/trait.ByteOrder.html" title="trait byteorder::ByteOrder">ByteOrder</a>>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>, nbytes: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code></span></h3><div class='docblock'><p>Writes an unsigned n-bytes integer to the underlying writer.</p>
|
||
<h1 id="errors-12" class="section-header"><a href="#errors-12">Errors</a></h1>
|
||
<p>This method returns the same errors as <a href="https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all"><code>Write::write_all</code></a>.</p>
|
||
<h1 id="panics" class="section-header"><a href="#panics">Panics</a></h1>
|
||
<p>If the given integer is not representable in the given number of bytes,
|
||
this method panics. If <code>nbytes > 8</code>, this method panics.</p>
|
||
</div><h3 id='method.write_int' class='method'><span id='write_int.v' class='invisible'><code>fn <a href='#method.write_int' class='fnname'>write_int</a><T: <a class="trait" href="../byteorder/trait.ByteOrder.html" title="trait byteorder::ByteOrder">ByteOrder</a>>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>, nbytes: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code></span></h3><div class='docblock'><p>Writes a signed n-bytes integer to the underlying writer.</p>
|
||
<h1 id="errors-13" class="section-header"><a href="#errors-13">Errors</a></h1>
|
||
<p>This method returns the same errors as <a href="https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all"><code>Write::write_all</code></a>.</p>
|
||
<h1 id="panics-1" class="section-header"><a href="#panics-1">Panics</a></h1>
|
||
<p>If the given integer is not representable in the given number of bytes,
|
||
this method panics. If <code>nbytes > 8</code>, this method panics.</p>
|
||
</div><h3 id='method.write_f32' class='method'><span id='write_f32.v' class='invisible'><code>fn <a href='#method.write_f32' class='fnname'>write_f32</a><T: <a class="trait" href="../byteorder/trait.ByteOrder.html" title="trait byteorder::ByteOrder">ByteOrder</a>>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code></span></h3><div class='docblock'><p>Writes a IEEE754 single-precision (4 bytes) floating point number to
|
||
the underlying writer.</p>
|
||
<h1 id="errors-14" class="section-header"><a href="#errors-14">Errors</a></h1>
|
||
<p>This method returns the same errors as <a href="https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all"><code>Write::write_all</code></a>.</p>
|
||
</div><h3 id='method.write_f64' class='method'><span id='write_f64.v' class='invisible'><code>fn <a href='#method.write_f64' class='fnname'>write_f64</a><T: <a class="trait" href="../byteorder/trait.ByteOrder.html" title="trait byteorder::ByteOrder">ByteOrder</a>>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code></span></h3><div class='docblock'><p>Writes a IEEE754 double-precision (8 bytes) floating point number to
|
||
the underlying writer.</p>
|
||
</div></div>
|
||
<h2 id='implementors' class='small-section-header'>
|
||
Implementors<a href='#implementors' class='anchor'></a>
|
||
</h2>
|
||
<ul class='item-list' id='implementors-list'>
|
||
<li><div class='out-of-band'><a class='srclink' href='../src/byteorder/io.rs.html#1342' title='goto source code'>[src]</a></div><code>impl<W: <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html" title="trait std::io::Write">Write</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> WriteBytesExt for W</code></li>
|
||
</ul><script type="text/javascript" async
|
||
src="../implementors/byteorder/trait.WriteBytesExt.js">
|
||
</script></section>
|
||
<section id='search' class="content hidden"></section>
|
||
|
||
<section class="footer"></section>
|
||
|
||
<aside id="help" class="hidden">
|
||
<div>
|
||
<h1 class="hidden">Help</h1>
|
||
|
||
<div class="shortcuts">
|
||
<h2>Keyboard Shortcuts</h2>
|
||
|
||
<dl>
|
||
<dt><kbd>?</kbd></dt>
|
||
<dd>Show this help dialog</dd>
|
||
<dt><kbd>S</kbd></dt>
|
||
<dd>Focus the search field</dd>
|
||
<dt><kbd>↑</kbd></dt>
|
||
<dd>Move up in search results</dd>
|
||
<dt><kbd>↓</kbd></dt>
|
||
<dd>Move down in search results</dd>
|
||
<dt><kbd>↹</kbd></dt>
|
||
<dd>Switch tab</dd>
|
||
<dt><kbd>⏎</kbd></dt>
|
||
<dd>Go to active search result</dd>
|
||
<dt><kbd>+</kbd></dt>
|
||
<dd>Expand all sections</dd>
|
||
<dt><kbd>-</kbd></dt>
|
||
<dd>Collapse all sections</dd>
|
||
</dl>
|
||
</div>
|
||
|
||
<div class="infos">
|
||
<h2>Search Tricks</h2>
|
||
|
||
<p>
|
||
Prefix searches with a type followed by a colon (e.g.
|
||
<code>fn:</code>) to restrict the search to a given type.
|
||
</p>
|
||
|
||
<p>
|
||
Accepted types are: <code>fn</code>, <code>mod</code>,
|
||
<code>struct</code>, <code>enum</code>,
|
||
<code>trait</code>, <code>type</code>, <code>macro</code>,
|
||
and <code>const</code>.
|
||
</p>
|
||
|
||
<p>
|
||
Search functions by type signature (e.g.
|
||
<code>vec -> usize</code> or <code>* -> vec</code>)
|
||
</p>
|
||
</div>
|
||
</div>
|
||
</aside>
|
||
|
||
|
||
|
||
<script>
|
||
window.rootPath = "../";
|
||
window.currentCrate = "byteorder";
|
||
</script>
|
||
<script src="../main.js"></script>
|
||
<script defer src="../search-index.js"></script>
|
||
</body>
|
||
</html> |