37 lines
7.0 KiB
HTML
37 lines
7.0 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<title>Optional (handy_http_primitives.optional.Optional)</title>
|
|
<meta charset="utf-8" />
|
|
<meta content="width=device-width, initial-scale=1" name="viewport" />
|
|
<link href="style.css" rel="stylesheet" />
|
|
<script src="script.js" type="text/javascript"></script>
|
|
|
|
|
|
<link href="search-results.html" rel="prefetch" />
|
|
</head>
|
|
<body>
|
|
<div id="page-header">
|
|
<div id="logotype">
|
|
<span>Documentation</span>
|
|
<nav>
|
|
<a href="http://dlang.org/">Dlang.org</a>
|
|
</nav>
|
|
</div>
|
|
|
|
<form action="search-docs.html" id="search">
|
|
<input name="searchTerm" placeholder="Find a symbol name..." type="search" />
|
|
<input type="submit" value="Go" />
|
|
</form>
|
|
</div>
|
|
<div id="page-body">
|
|
<div id="page-content">
|
|
<h1>Optional</h1><div class="breadcrumbs"><a class="breadcrumb" href="handy_http_primitives.html">handy_http_primitives</a> <a class="breadcrumb" href="handy_http_primitives.optional.html">optional</a> </div><div><div class="documentation-comment synopsis"><div><p>A simple wrapper around a value to make it optionally present.</p></div></div></div><div class="annotated-prototype"><div class="aggregate-prototype"><div class="attributes"></div><span class="builtin-type">struct</span> Optional (<div class="parameters-list toplevel"><div class="template-parameter-item parameter-item"> <span><span class="name" data-ident="T">T</span></span></div></div>) {<div class="aggregate-member"><a href="handy_http_primitives.optional.Optional.value.html"><div class="attributes"></div><tt class="highlighted"><span class="hid">T</span></tt> <span class="name">value</span>;</a></div><div class="aggregate-member"><a href="handy_http_primitives.optional.Optional.isNull.html"><div class="attributes"></div><tt class="highlighted"><span class="type">bool</span></tt> <span class="name">isNull</span>;</a></div><div class="aggregate-member"><a href="handy_http_primitives.optional.Optional.of.html"><span class="storage-class">static</span> <tt class="highlighted"><span class="hid">Optional</span>!<span class="hid">T</span></tt> <span class="name">of</span>(T value);</a></div><div class="aggregate-member"><a href="handy_http_primitives.optional.Optional.empty.html"><span class="storage-class">static</span> <tt class="highlighted"><span class="hid">Optional</span>!<span class="hid">T</span></tt> <span class="name">empty</span>();</a></div><div class="aggregate-member"><a href="handy_http_primitives.optional.Optional.orElse.html"><tt class="highlighted"><span class="hid">T</span></tt> <span class="name">orElse</span>(T defaultValue);</a></div><div class="aggregate-member"><a href="handy_http_primitives.optional.Optional.orElseThrow.1.html"><tt class="highlighted"><span class="hid">T</span></tt> <span class="name">orElseThrow</span>(string msg);</a></div><div class="aggregate-member"><a href="handy_http_primitives.optional.Optional.orElseThrow.2.html"><tt class="highlighted"><span class="hid">T</span></tt> <span class="name">orElseThrow</span>(Exception delegate() exceptionSupplier);</a></div><div class="aggregate-member"><a href="handy_http_primitives.optional.Optional.opCast.html"><tt class="highlighted"><span class="type">bool</span></tt> <span class="name">opCast</span>();</a></div>}</div></div><h2 id="members"><a class="header-anchor" href="#members">Members</a></h2><h3 class="member-list-header hide-from-toc" id="function"><a class="header-anchor" href="#function">Functions</a></h3><dl class="member-list native"><dt><a href="handy_http_primitives.optional.Optional.opCast.html">opCast</a><div class="simplified-prototype" style="max-width: 14ch;"><tt class="highlighted"><span class="type">bool</span></tt> <span class="name">opCast</span>()</div></dt><dd><div><p>Provides a mechanism to allow usage in boolean expressions.</p></div></dd><dt><a href="handy_http_primitives.optional.Optional.orElse.html">orElse</a><div class="simplified-prototype" style="max-width: 26ch;"><tt class="highlighted"><span class="hid">T</span></tt> <span class="name">orElse</span>(T defaultValue)</div></dt><dd><div><p>Gets the value of this optional if it exists, otherwise uses a given
|
|
default value.</p></div></dd><dt><a href="handy_http_primitives.optional.Optional.orElseThrow.1.html">orElseThrow</a><div class="simplified-prototype" style="max-width: 27ch;"><tt class="highlighted"><span class="hid">T</span></tt> <span class="name">orElseThrow</span>(string msg)</div></dt><dd><div><p>Gets the value of this optional if it exists, or throws an exception.</p></div></dd><dt><a href="handy_http_primitives.optional.Optional.orElseThrow.2.html">orElseThrow</a><div class="simplified-prototype" style="max-width: 58ch;"><tt class="highlighted"><span class="hid">T</span></tt> <span class="name">orElseThrow</span>(Exception delegate() exceptionSupplier)</div></dt><dd><div><p>Gets the value of this optional if it exists, or throws an exception as
|
|
produced by the given delegate.</p></div></dd></dl><h3 class="member-list-header hide-from-toc" id="static function"><a class="header-anchor" href="#static function">Static functions</a></h3><dl class="member-list native"><dt><a href="handy_http_primitives.optional.Optional.empty.html">empty</a><div class="simplified-prototype" style="max-width: 19ch;"><tt class="highlighted"><span class="hid">Optional</span>!<span class="hid">T</span></tt> <span class="name">empty</span>()</div></dt><dd><div><p>Constructs an optional that's empty.</p></div></dd><dt><a href="handy_http_primitives.optional.Optional.of.html">of</a><div class="simplified-prototype" style="max-width: 24ch;"><tt class="highlighted"><span class="hid">Optional</span>!<span class="hid">T</span></tt> <span class="name">of</span>(T value)</div></dt><dd><div><p>Constructs an optional value using a given value.</p></div></dd></dl><h3 class="member-list-header hide-from-toc" id="variable"><a class="header-anchor" href="#variable">Variables</a></h3><dl class="member-list native"><dt><a href="handy_http_primitives.optional.Optional.isNull.html">isNull</a><div class="simplified-prototype" style="max-width: 13ch;"><tt class="highlighted"><span class="type">bool</span></tt> <span class="name">isNull</span>;</div></dt><dd><div><p>Whether this optional is empty.</p></div></dd><dt><a href="handy_http_primitives.optional.Optional.value.html">value</a><div class="simplified-prototype" style="max-width: 8ch;"><tt class="highlighted"><span class="hid">T</span></tt> <span class="name">value</span>;</div></dt><dd><div><p>The internal value of this optional.</p></div></dd></dl><div></div></div>
|
|
<div id="page-nav"><a class="parent" href="handy_http_primitives.html">handy_http_primitives</a> <a class="parent" href="handy_http_primitives.optional.html">optional</a>
|
|
<span class="type-separator">functions</span><ul><li><a class="function" href="handy_http_primitives.optional.mapIfPresent.html">mapIfPresent</a></li></ul><span class="type-separator">structs</span><ul><li><a class="struct current" href="handy_http_primitives.optional.Optional.html">Optional</a></li></ul></div>
|
|
</div>
|
|
<div id="page-footer">Page generated by <a href="https://github.com/adamdruppe/adrdox">adrdox</a></div>
|
|
</body>
|
|
</html> |