blob: fb23977644a662bf16f3f377a58cd1783ff59253 [file] [log] [blame]
<!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="The enum `Either` with variants `Left` and `Right` is a general purpose sum type with two cases."><meta name="keywords" content="rust, rustlang, rust-lang, either"><title>either - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../normalize.css"><link rel="stylesheet" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../ayu.css" disabled><link rel="stylesheet" href="../dark.css" disabled><link rel="stylesheet" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="../crates.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../either/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../either/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">Crate either</a></h2><div class="sidebar-elems"><ul class="block"><li class="version">Version 1.8.1</li><li><a id="all-types" href="all.html">All Items</a></li></ul><section><ul class="block"><li><a href="#reexports">Re-exports</a></li><li><a href="#macros">Macros</a></li><li><a href="#enums">Enums</a></li></ul></section></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn">Crate <a class="mod" href="#">either</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="srclink" href="../src/either/lib.rs.html#1-1471">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The enum <a href="enum.Either.html"><code>Either</code></a> with variants <code>Left</code> and <code>Right</code> is a general purpose
sum type with two cases.</p>
<p><strong>Crate features:</strong></p>
<ul>
<li>
<p><code>&quot;use_std&quot;</code>
Enabled by default. Disable to make the library <code>#![no_std]</code>.</p>
</li>
<li>
<p><code>&quot;serde&quot;</code>
Disabled by default. Enable to <code>#[derive(Serialize, Deserialize)]</code> for <code>Either</code></p>
</li>
</ul>
</div></details><h2 id="reexports" class="small-section-header"><a href="#reexports">Re-exports</a></h2><div class="item-table"><div class="item-row"><div class="item-left import-item" id="reexport.Left"><code>pub use crate::Either::<a class="enum" href="enum.Either.html" title="enum either::Either">Left</a>;</code></div></div><div class="item-row"><div class="item-left import-item" id="reexport.Right"><code>pub use crate::Either::<a class="enum" href="enum.Either.html" title="enum either::Either">Right</a>;</code></div></div></div><h2 id="macros" class="small-section-header"><a href="#macros">Macros</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="macro" href="macro.for_both.html" title="either::for_both macro">for_both</a></div><div class="item-right docblock-short">Evaluate the provided expression for both <a href="enum.Either.html#variant.Left" title="Either::Left"><code>Either::Left</code></a> and <a href="enum.Either.html#variant.Right" title="Either::Right"><code>Either::Right</code></a>.</div></div><div class="item-row"><div class="item-left module-item"><a class="macro" href="macro.try_left.html" title="either::try_left macro">try_left</a></div><div class="item-right docblock-short">Macro for unwrapping the left side of an <code>Either</code>, which fails early
with the opposite side. Can only be used in functions that return
<code>Either</code> because of the early return of <code>Right</code> that it provides.</div></div><div class="item-row"><div class="item-left module-item"><a class="macro" href="macro.try_right.html" title="either::try_right macro">try_right</a></div><div class="item-right docblock-short">Dual to <code>try_left!</code>, see its documentation for more information.</div></div></div><h2 id="enums" class="small-section-header"><a href="#enums">Enums</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.Either.html" title="either::Either enum">Either</a></div><div class="item-right docblock-short">The enum <code>Either</code> with variants <code>Left</code> and <code>Right</code> is a general purpose
sum type with two cases.</div></div></div></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="either" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.66.0-nightly (5c8bff74b 2022-10-21)" ></div></body></html>