Auto Generated Documentation

This commit is contained in:
github-actions[bot]
2021-03-22 03:10:14 +00:00
parent 7334bd1757
commit 8193a198a1
741 changed files with 3292 additions and 70875 deletions
-6
View File
@@ -1,6 +0,0 @@
<!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="List of all items in this crate"><meta name="keywords" content="rust, rustlang, rust-lang"><title>List of all items in this crate</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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[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">&#9776;</div><a href='../chrono/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Crate chrono</p><div class="block version"><p>Version 0.4.19</p></div><a id="all-types" href="index.html"><p>Back to index</p></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span>
</span>
<span class="in-band">List of all items</span></h1><h3 id="Structs">Structs</h3><ul class="structs docblock"><li><a href="struct.Date.html">Date</a></li><li><a href="struct.DateTime.html">DateTime</a></li><li><a href="struct.Duration.html">Duration</a></li><li><a href="struct.ParseMonthError.html">ParseMonthError</a></li><li><a href="struct.ParseWeekdayError.html">ParseWeekdayError</a></li><li><a href="format/struct.DelayedFormat.html">format::DelayedFormat</a></li><li><a href="format/struct.InternalFixed.html">format::InternalFixed</a></li><li><a href="format/struct.InternalNumeric.html">format::InternalNumeric</a></li><li><a href="format/struct.ParseError.html">format::ParseError</a></li><li><a href="format/struct.Parsed.html">format::Parsed</a></li><li><a href="format/strftime/struct.StrftimeItems.html">format::strftime::StrftimeItems</a></li><li><a href="naive/struct.IsoWeek.html">naive::IsoWeek</a></li><li><a href="naive/struct.NaiveDate.html">naive::NaiveDate</a></li><li><a href="naive/struct.NaiveDateTime.html">naive::NaiveDateTime</a></li><li><a href="naive/struct.NaiveTime.html">naive::NaiveTime</a></li><li><a href="offset/struct.FixedOffset.html">offset::FixedOffset</a></li><li><a href="offset/struct.Local.html">offset::Local</a></li><li><a href="offset/struct.Utc.html">offset::Utc</a></li></ul><h3 id="Enums">Enums</h3><ul class="enums docblock"><li><a href="enum.Month.html">Month</a></li><li><a href="enum.RoundingError.html">RoundingError</a></li><li><a href="enum.SecondsFormat.html">SecondsFormat</a></li><li><a href="enum.Weekday.html">Weekday</a></li><li><a href="format/enum.Fixed.html">format::Fixed</a></li><li><a href="format/enum.Item.html">format::Item</a></li><li><a href="format/enum.Numeric.html">format::Numeric</a></li><li><a href="format/enum.Pad.html">format::Pad</a></li><li><a href="offset/enum.LocalResult.html">offset::LocalResult</a></li></ul><h3 id="Traits">Traits</h3><ul class="traits docblock"><li><a href="trait.Datelike.html">Datelike</a></li><li><a href="trait.DurationRound.html">DurationRound</a></li><li><a href="trait.SubsecRound.html">SubsecRound</a></li><li><a href="trait.Timelike.html">Timelike</a></li><li><a href="offset/trait.Offset.html">offset::Offset</a></li><li><a href="offset/trait.TimeZone.html">offset::TimeZone</a></li></ul><h3 id="Functions">Functions</h3><ul class="functions docblock"><li><a href="format/fn.format.html">format::format</a></li><li><a href="format/fn.format_item.html">format::format_item</a></li><li><a href="format/fn.parse.html">format::parse</a></li></ul><h3 id="Typedefs">Typedefs</h3><ul class="typedefs docblock"><li><a href="format/type.ParseResult.html">format::ParseResult</a></li></ul><h3 id="Constants">Constants</h3><ul class="constants docblock"><li><a href="constant.MAX_DATE.html">MAX_DATE</a></li><li><a href="constant.MAX_DATETIME.html">MAX_DATETIME</a></li><li><a href="constant.MIN_DATE.html">MIN_DATE</a></li><li><a href="constant.MIN_DATETIME.html">MIN_DATETIME</a></li><li><a href="naive/constant.MAX_DATE.html">naive::MAX_DATE</a></li><li><a href="naive/constant.MAX_DATETIME.html">naive::MAX_DATETIME</a></li><li><a href="naive/constant.MIN_DATE.html">naive::MIN_DATE</a></li><li><a href="naive/constant.MIN_DATETIME.html">naive::MIN_DATETIME</a></li></ul></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "chrono";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
-5
View File
@@ -1,5 +0,0 @@
<!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 `MAX_DATE` constant in crate `chrono`."><meta name="keywords" content="rust, rustlang, rust-lang, MAX_DATE"><title>chrono::MAX_DATE - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[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">&#9776;</div><a href='../chrono/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="index.html">chrono</a></p><script>window.sidebarCurrent = {name: "MAX_DATE", ty: "constant", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../src/chrono/date.rs.html#55" title="goto source code">[src]</a></span><span class="in-band">Constant <a href="index.html">chrono</a>::<wbr><a class="constant" href="">MAX_DATE</a></span></h1><pre class="rust const">pub const MAX_DATE: <a class="struct" href="../chrono/struct.Date.html" title="struct chrono::Date">Date</a>&lt;<a class="struct" href="../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a>&gt;;</pre><div class="docblock"><p>The maximum possible <code>Date</code>.</p>
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "chrono";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
-5
View File
@@ -1,5 +0,0 @@
<!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 `MAX_DATETIME` constant in crate `chrono`."><meta name="keywords" content="rust, rustlang, rust-lang, MAX_DATETIME"><title>chrono::MAX_DATETIME - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[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">&#9776;</div><a href='../chrono/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="index.html">chrono</a></p><script>window.sidebarCurrent = {name: "MAX_DATETIME", ty: "constant", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../src/chrono/datetime.rs.html#78" title="goto source code">[src]</a></span><span class="in-band">Constant <a href="index.html">chrono</a>::<wbr><a class="constant" href="">MAX_DATETIME</a></span></h1><pre class="rust const">pub const MAX_DATETIME: <a class="struct" href="../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;<a class="struct" href="../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a>&gt;;</pre><div class="docblock"><p>The maximum possible <code>DateTime&lt;Utc&gt;</code>.</p>
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "chrono";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
-5
View File
@@ -1,5 +0,0 @@
<!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 `MIN_DATE` constant in crate `chrono`."><meta name="keywords" content="rust, rustlang, rust-lang, MIN_DATE"><title>chrono::MIN_DATE - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[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">&#9776;</div><a href='../chrono/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="index.html">chrono</a></p><script>window.sidebarCurrent = {name: "MIN_DATE", ty: "constant", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../src/chrono/date.rs.html#53" title="goto source code">[src]</a></span><span class="in-band">Constant <a href="index.html">chrono</a>::<wbr><a class="constant" href="">MIN_DATE</a></span></h1><pre class="rust const">pub const MIN_DATE: <a class="struct" href="../chrono/struct.Date.html" title="struct chrono::Date">Date</a>&lt;<a class="struct" href="../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a>&gt;;</pre><div class="docblock"><p>The minimum possible <code>Date</code>.</p>
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "chrono";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
-5
View File
@@ -1,5 +0,0 @@
<!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 `MIN_DATETIME` constant in crate `chrono`."><meta name="keywords" content="rust, rustlang, rust-lang, MIN_DATETIME"><title>chrono::MIN_DATETIME - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[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">&#9776;</div><a href='../chrono/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="index.html">chrono</a></p><script>window.sidebarCurrent = {name: "MIN_DATETIME", ty: "constant", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../src/chrono/datetime.rs.html#76" title="goto source code">[src]</a></span><span class="in-band">Constant <a href="index.html">chrono</a>::<wbr><a class="constant" href="">MIN_DATETIME</a></span></h1><pre class="rust const">pub const MIN_DATETIME: <a class="struct" href="../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;<a class="struct" href="../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a>&gt;;</pre><div class="docblock"><p>The minimum possible <code>DateTime&lt;Utc&gt;</code>.</p>
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "chrono";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
-10
View File
@@ -1,10 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../chrono/constant.MAX_DATE.html">
</head>
<body>
<p>Redirecting to <a href="../../chrono/constant.MAX_DATE.html">../../chrono/constant.MAX_DATE.html</a>...</p>
<script>location.replace("../../chrono/constant.MAX_DATE.html" + location.search + location.hash);</script>
</body>
</html>
-10
View File
@@ -1,10 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../chrono/constant.MIN_DATE.html">
</head>
<body>
<p>Redirecting to <a href="../../chrono/constant.MIN_DATE.html">../../chrono/constant.MIN_DATE.html</a>...</p>
<script>location.replace("../../chrono/constant.MIN_DATE.html" + location.search + location.hash);</script>
</body>
</html>
-10
View File
@@ -1,10 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../chrono/struct.Date.html">
</head>
<body>
<p>Redirecting to <a href="../../chrono/struct.Date.html">../../chrono/struct.Date.html</a>...</p>
<script>location.replace("../../chrono/struct.Date.html" + location.search + location.hash);</script>
</body>
</html>
@@ -1,10 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../chrono/constant.MAX_DATETIME.html">
</head>
<body>
<p>Redirecting to <a href="../../chrono/constant.MAX_DATETIME.html">../../chrono/constant.MAX_DATETIME.html</a>...</p>
<script>location.replace("../../chrono/constant.MAX_DATETIME.html" + location.search + location.hash);</script>
</body>
</html>
@@ -1,10 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../chrono/constant.MIN_DATETIME.html">
</head>
<body>
<p>Redirecting to <a href="../../chrono/constant.MIN_DATETIME.html">../../chrono/constant.MIN_DATETIME.html</a>...</p>
<script>location.replace("../../chrono/constant.MIN_DATETIME.html" + location.search + location.hash);</script>
</body>
</html>
@@ -1,10 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../chrono/enum.SecondsFormat.html">
</head>
<body>
<p>Redirecting to <a href="../../chrono/enum.SecondsFormat.html">../../chrono/enum.SecondsFormat.html</a>...</p>
<script>location.replace("../../chrono/enum.SecondsFormat.html" + location.search + location.hash);</script>
</body>
</html>
-10
View File
@@ -1,10 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../chrono/struct.DateTime.html">
</head>
<body>
<p>Redirecting to <a href="../../chrono/struct.DateTime.html">../../chrono/struct.DateTime.html</a>...</p>
<script>location.replace("../../chrono/struct.DateTime.html" + location.search + location.hash);</script>
</body>
</html>
-138
View File
@@ -1,138 +0,0 @@
<!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 `Month` enum in crate `chrono`."><meta name="keywords" content="rust, rustlang, rust-lang, Month"><title>chrono::Month - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[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">&#9776;</div><a href='../chrono/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Enum Month</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.April">April</a><a href="#variant.August">August</a><a href="#variant.December">December</a><a href="#variant.February">February</a><a href="#variant.January">January</a><a href="#variant.July">July</a><a href="#variant.June">June</a><a href="#variant.March">March</a><a href="#variant.May">May</a><a href="#variant.November">November</a><a href="#variant.October">October</a><a href="#variant.September">September</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.name">name</a><a href="#method.number_from_month">number_from_month</a><a href="#method.pred">pred</a><a href="#method.succ">succ</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Debug">Debug</a><a href="#impl-Eq">Eq</a><a href="#impl-FromPrimitive">FromPrimitive</a><a href="#impl-FromStr">FromStr</a><a href="#impl-Hash">Hash</a><a href="#impl-PartialEq%3CMonth%3E">PartialEq&lt;Month&gt;</a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><p class="location"><a href="index.html">chrono</a></p><script>window.sidebarCurrent = {name: "Month", ty: "enum", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../src/chrono/lib.rs.html#966-991" title="goto source code">[src]</a></span><span class="in-band">Enum <a href="index.html">chrono</a>::<wbr><a class="enum" href="">Month</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust enum">pub enum Month {
January,
February,
March,
April,
May,
June,
July,
August,
September,
October,
November,
December,
}</pre></div><div class="docblock"><p>The month of the year.</p>
<p>This enum is just a convenience implementation.
The month in dates created by DateLike objects does not return this enum.</p>
<p>It is possible to convert from a date to a month independently</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">num_traits</span>::<span class="ident">FromPrimitive</span>;
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>;
<span class="kw">let</span> <span class="ident">date</span> <span class="op">=</span> <span class="ident">Utc</span>.<span class="ident">ymd</span>(<span class="number">2019</span>, <span class="number">10</span>, <span class="number">28</span>).<span class="ident">and_hms</span>(<span class="number">9</span>, <span class="number">10</span>, <span class="number">11</span>);
<span class="comment">// `2019-10-28T09:10:11Z`</span>
<span class="kw">let</span> <span class="ident">month</span> <span class="op">=</span> <span class="ident">Month</span>::<span class="ident">from_u32</span>(<span class="ident">date</span>.<span class="ident">month</span>());
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">month</span>, <span class="prelude-val">Some</span>(<span class="ident">Month</span>::<span class="ident">October</span>))</pre></div>
<p>Or from a Month to an integer usable by dates</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">month</span> <span class="op">=</span> <span class="ident">Month</span>::<span class="ident">January</span>;
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">Utc</span>.<span class="ident">ymd</span>(<span class="number">2019</span>, <span class="ident">month</span>.<span class="ident">number_from_month</span>(), <span class="number">28</span>).<span class="ident">and_hms</span>(<span class="number">9</span>, <span class="number">10</span>, <span class="number">11</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>((<span class="ident">dt</span>.<span class="ident">year</span>(), <span class="ident">dt</span>.<span class="ident">month</span>(), <span class="ident">dt</span>.<span class="ident">day</span>()), (<span class="number">2019</span>, <span class="number">1</span>, <span class="number">28</span>));</pre></div>
<p>Allows mapping from and to month, from 1-January to 12-December.
Can be Serialized/Deserialized with serde</p>
</div><h2 id="variants" class="variants small-section-header">
Variants<a href="#variants" class="anchor"></a></h2>
<div id="variant.January" class="variant small-section-header"><a href="#variant.January" class="anchor field"></a><code>January</code></div><div class="docblock"><p>January</p>
</div><div id="variant.February" class="variant small-section-header"><a href="#variant.February" class="anchor field"></a><code>February</code></div><div class="docblock"><p>February</p>
</div><div id="variant.March" class="variant small-section-header"><a href="#variant.March" class="anchor field"></a><code>March</code></div><div class="docblock"><p>March</p>
</div><div id="variant.April" class="variant small-section-header"><a href="#variant.April" class="anchor field"></a><code>April</code></div><div class="docblock"><p>April</p>
</div><div id="variant.May" class="variant small-section-header"><a href="#variant.May" class="anchor field"></a><code>May</code></div><div class="docblock"><p>May</p>
</div><div id="variant.June" class="variant small-section-header"><a href="#variant.June" class="anchor field"></a><code>June</code></div><div class="docblock"><p>June</p>
</div><div id="variant.July" class="variant small-section-header"><a href="#variant.July" class="anchor field"></a><code>July</code></div><div class="docblock"><p>July</p>
</div><div id="variant.August" class="variant small-section-header"><a href="#variant.August" class="anchor field"></a><code>August</code></div><div class="docblock"><p>August</p>
</div><div id="variant.September" class="variant small-section-header"><a href="#variant.September" class="anchor field"></a><code>September</code></div><div class="docblock"><p>September</p>
</div><div id="variant.October" class="variant small-section-header"><a href="#variant.October" class="anchor field"></a><code>October</code></div><div class="docblock"><p>October</p>
</div><div id="variant.November" class="variant small-section-header"><a href="#variant.November" class="anchor field"></a><code>November</code></div><div class="docblock"><p>November</p>
</div><div id="variant.December" class="variant small-section-header"><a href="#variant.December" class="anchor field"></a><code>December</code></div><div class="docblock"><p>December</p>
</div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl <a class="enum" href="../chrono/enum.Month.html" title="enum chrono::Month">Month</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#993-1086" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.succ" class="method"><code>pub fn <a href="#method.succ" class="fnname">succ</a>(&amp;self) -&gt; <a class="enum" href="../chrono/enum.Month.html" title="enum chrono::Month">Month</a></code><a class="srclink" href="../src/chrono/lib.rs.html#1000-1015" title="goto source code">[src]</a></h4><div class="docblock"><p>The next month.</p>
<table><thead><tr><th><code>m</code>:</th><th><code>January</code></th><th><code>February</code></th><th><code>...</code></th><th><code>December</code></th></tr></thead><tbody>
<tr><td><code>m.succ()</code>:</td><td><code>February</code></td><td><code>March</code></td><td><code>...</code></td><td><code>January</code></td></tr>
</tbody></table>
</div><h4 id="method.pred" class="method"><code>pub fn <a href="#method.pred" class="fnname">pred</a>(&amp;self) -&gt; <a class="enum" href="../chrono/enum.Month.html" title="enum chrono::Month">Month</a></code><a class="srclink" href="../src/chrono/lib.rs.html#1023-1038" title="goto source code">[src]</a></h4><div class="docblock"><p>The previous month.</p>
<table><thead><tr><th><code>m</code>:</th><th><code>January</code></th><th><code>February</code></th><th><code>...</code></th><th><code>December</code></th></tr></thead><tbody>
<tr><td><code>m.succ()</code>:</td><td><code>December</code></td><td><code>January</code></td><td><code>...</code></td><td><code>November</code></td></tr>
</tbody></table>
</div><h4 id="method.number_from_month" class="method"><code>pub fn <a href="#method.number_from_month" class="fnname">number_from_month</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../src/chrono/lib.rs.html#1046-1061" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns a month-of-year number starting from January = 1.</p>
<table><thead><tr><th><code>m</code>:</th><th><code>January</code></th><th><code>February</code></th><th><code>...</code></th><th><code>December</code></th></tr></thead><tbody>
<tr><td><code>m.number_from_month()</code>:</td><td>1</td><td>2</td><td><code>...</code></td><td>12</td></tr>
</tbody></table>
</div><h4 id="method.name" class="method"><code>pub fn <a href="#method.name" class="fnname">name</a>(&amp;self) -&gt; &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code><a class="srclink" href="../src/chrono/lib.rs.html#1070-1085" title="goto source code">[src]</a></h4><div class="docblock"><p>Get the name of the month</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">Month</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Month</span>::<span class="ident">January</span>.<span class="ident">name</span>(), <span class="string">&quot;January&quot;</span>)</pre></div>
</div></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Clone" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../chrono/enum.Month.html" title="enum chrono::Month">Month</a></code><a href="#impl-Clone" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#964" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&amp;self) -&gt; <a class="enum" href="../chrono/enum.Month.html" title="enum chrono::Month">Month</a></code><a class="srclink" href="../src/chrono/lib.rs.html#964" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id="method.clone_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&amp;mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self)</code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#128-130" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3 id="impl-Copy" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="enum" href="../chrono/enum.Month.html" title="enum chrono::Month">Month</a></code><a href="#impl-Copy" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#964" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Debug" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../chrono/enum.Month.html" title="enum chrono::Month">Month</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#964" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class="srclink" href="../src/chrono/lib.rs.html#964" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id="impl-Eq" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="enum" href="../chrono/enum.Month.html" title="enum chrono::Month">Month</a></code><a href="#impl-Eq" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#964" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-FromPrimitive" class="impl"><code class="in-band">impl <a class="trait" href="../num_traits/cast/trait.FromPrimitive.html" title="trait num_traits::cast::FromPrimitive">FromPrimitive</a> for <a class="enum" href="../chrono/enum.Month.html" title="enum chrono::Month">Month</a></code><a href="#impl-FromPrimitive" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#1088-1123" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from_u64" class="method"><code>fn <a href="../num_traits/cast/trait.FromPrimitive.html#tymethod.from_u64" class="fnname">from_u64</a>(n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="../chrono/enum.Month.html" title="enum chrono::Month">Month</a>&gt;</code><a class="srclink" href="../src/chrono/lib.rs.html#1096-1098" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns an Option<Month> from a i64, assuming a 1-index, January = 1.</p>
<p><code>Month::from_i64(n: i64)</code>: | <code>1</code> | <code>2</code> | ... | <code>12</code>
---------------------------| -------------------- | --------------------- | ... | -----
``: | Some(Month::January) | Some(Month::February) | ... | Some(Month::December)</p>
</div><h4 id="method.from_i64" class="method hidden"><code>fn <a href="../num_traits/cast/trait.FromPrimitive.html#tymethod.from_i64" class="fnname">from_i64</a>(n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="../chrono/enum.Month.html" title="enum chrono::Month">Month</a>&gt;</code><a class="srclink" href="../src/chrono/lib.rs.html#1101-1103" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Converts an <code>i64</code> to return an optional value of this type. If the
value cannot be represented by this type, then <code>None</code> is returned. <a href="../num_traits/cast/trait.FromPrimitive.html#tymethod.from_i64">Read more</a></p>
</div><h4 id="method.from_u32" class="method hidden"><code>fn <a href="../num_traits/cast/trait.FromPrimitive.html#method.from_u32" class="fnname">from_u32</a>(n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="../chrono/enum.Month.html" title="enum chrono::Month">Month</a>&gt;</code><a class="srclink" href="../src/chrono/lib.rs.html#1106-1122" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Converts an <code>u32</code> to return an optional value of this type. If the
value cannot be represented by this type, then <code>None</code> is returned. <a href="../num_traits/cast/trait.FromPrimitive.html#method.from_u32">Read more</a></p>
</div><h4 id="method.from_isize" class="method hidden"><code>pub fn <a href="../num_traits/cast/trait.FromPrimitive.html#method.from_isize" class="fnname">from_isize</a>(n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.isize.html">isize</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;</code><a class="srclink" href="../src/num_traits/cast.rs.html#415-417" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Converts an <code>isize</code> to return an optional value of this type. If the
value cannot be represented by this type, then <code>None</code> is returned. <a href="../num_traits/cast/trait.FromPrimitive.html#method.from_isize">Read more</a></p>
</div><h4 id="method.from_i8" class="method hidden"><code>pub fn <a href="../num_traits/cast/trait.FromPrimitive.html#method.from_i8" class="fnname">from_i8</a>(n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i8.html">i8</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;</code><a class="srclink" href="../src/num_traits/cast.rs.html#422-424" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Converts an <code>i8</code> to return an optional value of this type. If the
value cannot be represented by this type, then <code>None</code> is returned. <a href="../num_traits/cast/trait.FromPrimitive.html#method.from_i8">Read more</a></p>
</div><h4 id="method.from_i16" class="method hidden"><code>pub fn <a href="../num_traits/cast/trait.FromPrimitive.html#method.from_i16" class="fnname">from_i16</a>(n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i16.html">i16</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;</code><a class="srclink" href="../src/num_traits/cast.rs.html#429-431" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Converts an <code>i16</code> to return an optional value of this type. If the
value cannot be represented by this type, then <code>None</code> is returned. <a href="../num_traits/cast/trait.FromPrimitive.html#method.from_i16">Read more</a></p>
</div><h4 id="method.from_i32" class="method hidden"><code>pub fn <a href="../num_traits/cast/trait.FromPrimitive.html#method.from_i32" class="fnname">from_i32</a>(n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;</code><a class="srclink" href="../src/num_traits/cast.rs.html#436-438" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Converts an <code>i32</code> to return an optional value of this type. If the
value cannot be represented by this type, then <code>None</code> is returned. <a href="../num_traits/cast/trait.FromPrimitive.html#method.from_i32">Read more</a></p>
</div><h4 id="method.from_i128" class="method hidden"><code>pub fn <a href="../num_traits/cast/trait.FromPrimitive.html#method.from_i128" class="fnname">from_i128</a>(n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i128.html">i128</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;</code><a class="srclink" href="../src/num_traits/cast.rs.html#453-455" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Converts an <code>i128</code> to return an optional value of this type. If the
value cannot be represented by this type, then <code>None</code> is returned. <a href="../num_traits/cast/trait.FromPrimitive.html#method.from_i128">Read more</a></p>
</div><h4 id="method.from_usize" class="method hidden"><code>pub fn <a href="../num_traits/cast/trait.FromPrimitive.html#method.from_usize" class="fnname">from_usize</a>(n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;</code><a class="srclink" href="../src/num_traits/cast.rs.html#460-462" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Converts a <code>usize</code> to return an optional value of this type. If the
value cannot be represented by this type, then <code>None</code> is returned. <a href="../num_traits/cast/trait.FromPrimitive.html#method.from_usize">Read more</a></p>
</div><h4 id="method.from_u8" class="method hidden"><code>pub fn <a href="../num_traits/cast/trait.FromPrimitive.html#method.from_u8" class="fnname">from_u8</a>(n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;</code><a class="srclink" href="../src/num_traits/cast.rs.html#467-469" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Converts an <code>u8</code> to return an optional value of this type. If the
value cannot be represented by this type, then <code>None</code> is returned. <a href="../num_traits/cast/trait.FromPrimitive.html#method.from_u8">Read more</a></p>
</div><h4 id="method.from_u16" class="method hidden"><code>pub fn <a href="../num_traits/cast/trait.FromPrimitive.html#method.from_u16" class="fnname">from_u16</a>(n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u16.html">u16</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;</code><a class="srclink" href="../src/num_traits/cast.rs.html#474-476" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Converts an <code>u16</code> to return an optional value of this type. If the
value cannot be represented by this type, then <code>None</code> is returned. <a href="../num_traits/cast/trait.FromPrimitive.html#method.from_u16">Read more</a></p>
</div><h4 id="method.from_u128" class="method hidden"><code>pub fn <a href="../num_traits/cast/trait.FromPrimitive.html#method.from_u128" class="fnname">from_u128</a>(n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u128.html">u128</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;</code><a class="srclink" href="../src/num_traits/cast.rs.html#498-500" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Converts an <code>u128</code> to return an optional value of this type. If the
value cannot be represented by this type, then <code>None</code> is returned. <a href="../num_traits/cast/trait.FromPrimitive.html#method.from_u128">Read more</a></p>
</div><h4 id="method.from_f32" class="method hidden"><code>pub fn <a href="../num_traits/cast/trait.FromPrimitive.html#method.from_f32" class="fnname">from_f32</a>(n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;</code><a class="srclink" href="../src/num_traits/cast.rs.html#505-507" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Converts a <code>f32</code> to return an optional value of this type. If the
value cannot be represented by this type, then <code>None</code> is returned. <a href="../num_traits/cast/trait.FromPrimitive.html#method.from_f32">Read more</a></p>
</div><h4 id="method.from_f64" class="method hidden"><code>pub fn <a href="../num_traits/cast/trait.FromPrimitive.html#method.from_f64" class="fnname">from_f64</a>(n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;</code><a class="srclink" href="../src/num_traits/cast.rs.html#516-521" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Converts a <code>f64</code> to return an optional value of this type. If the
value cannot be represented by this type, then <code>None</code> is returned. <a href="../num_traits/cast/trait.FromPrimitive.html#method.from_f64">Read more</a></p>
</div></div><h3 id="impl-FromStr" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html" title="trait core::str::traits::FromStr">FromStr</a> for <a class="enum" href="../chrono/enum.Month.html" title="enum chrono::Month">Month</a></code><a href="#impl-FromStr" class="anchor"></a><a class="srclink" href="../src/chrono/format/mod.rs.html#914-938" title="goto source code">[src]</a></h3><div class="docblock"><p>Parsing a <code>str</code> into a <code>Month</code> uses the format <a href="./format/strftime/index.html"><code>%W</code></a>.</p>
<h1 id="example" class="section-header"><a href="#example">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">Month</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">&quot;January&quot;</span>.<span class="ident">parse</span>::<span class="op">&lt;</span><span class="ident">Month</span><span class="op">&gt;</span>(), <span class="prelude-val">Ok</span>(<span class="ident">Month</span>::<span class="ident">January</span>));
<span class="macro">assert</span><span class="macro">!</span>(<span class="string">&quot;any day&quot;</span>.<span class="ident">parse</span>::<span class="op">&lt;</span><span class="ident">Month</span><span class="op">&gt;</span>().<span class="ident">is_err</span>());</pre></div>
<p>The parsing is case-insensitive.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">&quot;fEbruARy&quot;</span>.<span class="ident">parse</span>::<span class="op">&lt;</span><span class="ident">Month</span><span class="op">&gt;</span>(), <span class="prelude-val">Ok</span>(<span class="ident">Month</span>::<span class="ident">February</span>));</pre></div>
<p>Only the shortest form (e.g. <code>jan</code>) and the longest form (e.g. <code>january</code>) is accepted.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert</span><span class="macro">!</span>(<span class="string">&quot;septem&quot;</span>.<span class="ident">parse</span>::<span class="op">&lt;</span><span class="ident">Month</span><span class="op">&gt;</span>().<span class="ident">is_err</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="string">&quot;Augustin&quot;</span>.<span class="ident">parse</span>::<span class="op">&lt;</span><span class="ident">Month</span><span class="op">&gt;</span>().<span class="ident">is_err</span>());</pre></div>
</div><div class="impl-items"><h4 id="associatedtype.Err" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#associatedtype.Err" class="type">Err</a> = <a class="struct" href="../chrono/struct.ParseMonthError.html" title="struct chrono::ParseMonthError">ParseMonthError</a></code></h4><div class='docblock'><p>The associated error which can be returned from parsing.</p>
</div><h4 id="method.from_str" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#tymethod.from_str" class="fnname">from_str</a>(s: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self, Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#associatedtype.Err" title="type core::str::traits::FromStr::Err">Err</a>&gt;</code><a class="srclink" href="../src/chrono/format/mod.rs.html#917-937" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Parses a string <code>s</code> to return a value of this type. <a href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#tymethod.from_str">Read more</a></p>
</div></div><h3 id="impl-Hash" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> for <a class="enum" href="../chrono/enum.Month.html" title="enum chrono::Month">Month</a></code><a href="#impl-Hash" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#964" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.hash" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash" class="fnname">hash</a>&lt;__H:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>&gt;(&amp;self, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>__H)</code><a class="srclink" href="../src/chrono/lib.rs.html#964" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Feeds this value into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash">Read more</a></p>
</div><h4 id="method.hash_slice" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice" class="fnname">hash_slice</a>&lt;H&gt;(data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[Self]</a>, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>H) <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.3.0">1.3.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#184-191" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice">Read more</a></p>
</div></div><h3 id="impl-PartialEq%3CMonth%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>&lt;<a class="enum" href="../chrono/enum.Month.html" title="enum chrono::Month">Month</a>&gt; for <a class="enum" href="../chrono/enum.Month.html" title="enum chrono::Month">Month</a></code><a href="#impl-PartialEq%3CMonth%3E" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#964" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.eq" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq" class="fnname">eq</a>(&amp;self, other: &amp;<a class="enum" href="../chrono/enum.Month.html" title="enum chrono::Month">Month</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../src/chrono/lib.rs.html#964" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id="method.ne" class="method hidden"><code><span class="docblock attributes">#[must_use]</span>pub fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne" class="fnname">ne</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#209-211" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 id="impl-StructuralEq" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="enum" href="../chrono/enum.Month.html" title="enum chrono::Month">Month</a></code><a href="#impl-StructuralEq" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#964" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-StructuralPartialEq" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="enum" href="../chrono/enum.Month.html" title="enum chrono::Month">Month</a></code><a href="#impl-StructuralPartialEq" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#964" title="goto source code">[src]</a></h3><div class="impl-items"></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../chrono/enum.Month.html" title="enum chrono::Month">Month</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../chrono/enum.Month.html" title="enum chrono::Month">Month</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../chrono/enum.Month.html" title="enum chrono::Month">Month</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../chrono/enum.Month.html" title="enum chrono::Month">Month</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../chrono/enum.Month.html" title="enum chrono::Month">Month</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></div><h3 id="impl-Borrow%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211-213" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id="impl-BorrowMut%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id="impl-From%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</code><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-Into%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-Into%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -&gt; U</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-ToOwned" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,&nbsp;</span></code><a href="#impl-ToOwned" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Owned" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
</div><h4 id="method.to_owned" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fnname">to_owned</a>(&amp;self) -&gt; T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
</div><h4 id="method.clone_into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fnname">clone_into</a>(&amp;self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T)</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><details><summary><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
</div></div><h3 id="impl-TryFrom%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id="method.try_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-TryInto%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-TryInto%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#575-584" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error-1" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id="method.try_into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#581-583" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "chrono";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-6
View File
@@ -1,6 +0,0 @@
<!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 `format` fn in crate `chrono`."><meta name="keywords" content="rust, rustlang, rust-lang, format"><title>chrono::format::format - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[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">&#9776;</div><a href='../../chrono/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../index.html">chrono</a>::<wbr><a href="index.html">format</a></p><script>window.sidebarCurrent = {name: "format", ty: "fn", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../../src/chrono/format/mod.rs.html#689-705" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../index.html">chrono</a>::<wbr><a href="index.html">format</a>::<wbr><a class="fn" href="">format</a></span></h1><pre class="rust fn">pub fn format&lt;'a, I, B&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;w: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;date: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;time: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;off: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;items: I<br>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a>&lt;Item = B&gt; + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;<a class="enum" href="../../chrono/format/enum.Item.html" title="enum chrono::format::Item">Item</a>&lt;'a&gt;&gt;,&nbsp;</span></pre><div class="docblock"><p>Tries to format given arguments with given formatting items.
Internally used by <code>DelayedFormat</code>.</p>
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "chrono";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
-5
View File
@@ -1,5 +0,0 @@
<!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 `format_item` fn in crate `chrono`."><meta name="keywords" content="rust, rustlang, rust-lang, format_item"><title>chrono::format::format_item - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[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">&#9776;</div><a href='../../chrono/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../index.html">chrono</a>::<wbr><a href="index.html">format</a></p><script>window.sidebarCurrent = {name: "format_item", ty: "fn", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../../src/chrono/format/mod.rs.html#391-401" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../index.html">chrono</a>::<wbr><a href="index.html">format</a>::<wbr><a class="fn" href="">format_item</a></span></h1><pre class="rust fn">pub fn format_item&lt;'a&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;w: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;date: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;time: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;off: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;item: &amp;<a class="enum" href="../../chrono/format/enum.Item.html" title="enum chrono::format::Item">Item</a>&lt;'a&gt;<br>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></pre><div class="docblock"><p>Formats single formatting item</p>
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "chrono";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
-24
View File
@@ -1,24 +0,0 @@
<!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 `parse` fn in crate `chrono`."><meta name="keywords" content="rust, rustlang, rust-lang, parse"><title>chrono::format::parse - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[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">&#9776;</div><a href='../../chrono/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../index.html">chrono</a>::<wbr><a href="index.html">format</a></p><script>window.sidebarCurrent = {name: "parse", ty: "fn", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../../src/chrono/format/parse.rs.html#234-240" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../index.html">chrono</a>::<wbr><a href="index.html">format</a>::<wbr><a class="fn" href="">parse</a></span></h1><pre class="rust fn">pub fn parse&lt;'a, I, B&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;parsed: &amp;mut <a class="struct" href="../../chrono/format/struct.Parsed.html" title="struct chrono::format::Parsed">Parsed</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;s: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;items: I<br>) -&gt; <a class="type" href="../../chrono/format/type.ParseResult.html" title="type chrono::format::ParseResult">ParseResult</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a>&lt;Item = B&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;<a class="enum" href="../../chrono/format/enum.Item.html" title="enum chrono::format::Item">Item</a>&lt;'a&gt;&gt;,&nbsp;</span></pre><div class="docblock"><p>Tries to parse given string into <code>parsed</code> with given formatting items.
Returns <code>Ok</code> when the entire string has been parsed (otherwise <code>parsed</code> should not be used).
There should be no trailing string after parsing;
use a stray <a href="./enum.Item.html#variant.Space"><code>Item::Space</code></a> to trim whitespaces.</p>
<p>This particular date and time parser is:</p>
<ul>
<li>
<p>Greedy. It will consume the longest possible prefix.
For example, <code>April</code> is always consumed entirely when the long month name is requested;
it equally accepts <code>Apr</code>, but prefers the longer prefix in this case.</p>
</li>
<li>
<p>Padding-agnostic (for numeric items).
The <a href="./enum.Pad.html"><code>Pad</code></a> field is completely ignored,
so one can prepend any number of whitespace then any number of zeroes before numbers.</p>
</li>
<li>
<p>(Still) obeying the intrinsic parsing width. This allows, for example, parsing <code>HHMMSS</code>.</p>
</li>
</ul>
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "chrono";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
-41
View File
@@ -1,41 +0,0 @@
<!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 `format` mod in crate `chrono`."><meta name="keywords" content="rust, rustlang, rust-lang, format"><title>chrono::format - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[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">&#9776;</div><a href='../../chrono/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Module format</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#reexports">Re-exports</a></li><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#functions">Functions</a></li><li><a href="#types">Type Definitions</a></li></ul></div><p class="location"><a href="../index.html">chrono</a></p><script>window.sidebarCurrent = {name: "format", ty: "mod", relpath: "../"};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../../src/chrono/format/mod.rs.html#4-938" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../index.html">chrono</a>::<wbr><a class="mod" href="">format</a></span></h1><div class="docblock"><p>Formatting (and parsing) utilities for date and time.</p>
<p>This module provides the common types and routines to implement,
for example, <a href="../struct.DateTime.html#method.format"><code>DateTime::format</code></a> or
<a href="../struct.DateTime.html#method.parse_from_str"><code>DateTime::parse_from_str</code></a> methods.
For most cases you should use these high-level interfaces.</p>
<p>Internally the formatting and parsing shares the same abstract <strong>formatting items</strong>,
which are just an <a href="https://doc.rust-lang.org/std/iter/trait.Iterator.html"><code>Iterator</code></a> of
the <a href="./enum.Item.html"><code>Item</code></a> type.
They are generated from more readable <strong>format strings</strong>;
currently Chrono supports <a href="./strftime/index.html">one built-in syntax closely resembling
C's <code>strftime</code> format</a>.</p>
</div><h2 id="reexports" class="section-header"><a href="#reexports">Re-exports</a></h2>
<table><tr><td><code>pub use self::strftime::<a class="struct" href="../../chrono/format/strftime/struct.StrftimeItems.html" title="struct chrono::format::strftime::StrftimeItems">StrftimeItems</a>;</code></td></tr></table><h2 id="modules" class="section-header"><a href="#modules">Modules</a></h2>
<table><tr class="module-item"><td><a class="mod" href="strftime/index.html" title="chrono::format::strftime mod">strftime</a></td><td class="docblock-short"><p><code>strftime</code>/<code>strptime</code>-inspired date and time formatting syntax.</p>
</td></tr></table><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
<table><tr class="module-item"><td><a class="struct" href="struct.DelayedFormat.html" title="chrono::format::DelayedFormat struct">DelayedFormat</a></td><td class="docblock-short"><p>A <em>temporary</em> object which can be used as an argument to <code>format!</code> or others.
This is normally constructed via <code>format</code> methods of each date and time type.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.InternalFixed.html" title="chrono::format::InternalFixed struct">InternalFixed</a></td><td class="docblock-short"><p>An opaque type representing fixed-format item types for internal uses only.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.InternalNumeric.html" title="chrono::format::InternalNumeric struct">InternalNumeric</a></td><td class="docblock-short"><p>An opaque type representing numeric item types for internal uses only.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.ParseError.html" title="chrono::format::ParseError struct">ParseError</a></td><td class="docblock-short"><p>An error from the <code>parse</code> function.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.Parsed.html" title="chrono::format::Parsed struct">Parsed</a></td><td class="docblock-short"><p>Parsed parts of date and time. There are two classes of methods:</p>
</td></tr></table><h2 id="enums" class="section-header"><a href="#enums">Enums</a></h2>
<table><tr class="module-item"><td><a class="enum" href="enum.Fixed.html" title="chrono::format::Fixed enum">Fixed</a></td><td class="docblock-short"><p>Fixed-format item types.</p>
</td></tr><tr class="module-item"><td><a class="enum" href="enum.Item.html" title="chrono::format::Item enum">Item</a></td><td class="docblock-short"><p>A single formatting item. This is used for both formatting and parsing.</p>
</td></tr><tr class="module-item"><td><a class="enum" href="enum.Numeric.html" title="chrono::format::Numeric enum">Numeric</a></td><td class="docblock-short"><p>Numeric item types.
They have associated formatting width (FW) and parsing width (PW).</p>
</td></tr><tr class="module-item"><td><a class="enum" href="enum.Pad.html" title="chrono::format::Pad enum">Pad</a></td><td class="docblock-short"><p>Padding characters for numeric items.</p>
</td></tr></table><h2 id="functions" class="section-header"><a href="#functions">Functions</a></h2>
<table><tr class="module-item"><td><a class="fn" href="fn.format.html" title="chrono::format::format fn">format</a></td><td class="docblock-short"><p>Tries to format given arguments with given formatting items.
Internally used by <code>DelayedFormat</code>.</p>
</td></tr><tr class="module-item"><td><a class="fn" href="fn.format_item.html" title="chrono::format::format_item fn">format_item</a></td><td class="docblock-short"><p>Formats single formatting item</p>
</td></tr><tr class="module-item"><td><a class="fn" href="fn.parse.html" title="chrono::format::parse fn">parse</a></td><td class="docblock-short"><p>Tries to parse given string into <code>parsed</code> with given formatting items.
Returns <code>Ok</code> when the entire string has been parsed (otherwise <code>parsed</code> should not be used).
There should be no trailing string after parsing;
use a stray <a href="./enum.Item.html#variant.Space"><code>Item::Space</code></a> to trim whitespaces.</p>
</td></tr></table><h2 id="types" class="section-header"><a href="#types">Type Definitions</a></h2>
<table><tr class="module-item"><td><a class="type" href="type.ParseResult.html" title="chrono::format::ParseResult type">ParseResult</a></td><td class="docblock-short"><p>Same as <code>Result&lt;T, ParseError&gt;</code>.</p>
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "chrono";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
-10
View File
@@ -1,10 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../chrono/format/fn.parse.html">
</head>
<body>
<p>Redirecting to <a href="../../../chrono/format/fn.parse.html">../../../chrono/format/fn.parse.html</a>...</p>
<script>location.replace("../../../chrono/format/fn.parse.html" + location.search + location.hash);</script>
</body>
</html>
@@ -1,10 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../chrono/format/struct.Parsed.html">
</head>
<body>
<p>Redirecting to <a href="../../../chrono/format/struct.Parsed.html">../../../chrono/format/struct.Parsed.html</a>...</p>
<script>location.replace("../../../chrono/format/struct.Parsed.html" + location.search + location.hash);</script>
</body>
</html>
-1
View File
@@ -1 +0,0 @@
initSidebarItems({"enum":[["Fixed","Fixed-format item types."],["Item","A single formatting item. This is used for both formatting and parsing."],["Numeric","Numeric item types. They have associated formatting width (FW) and parsing width (PW)."],["Pad","Padding characters for numeric items."]],"fn":[["format","Tries to format given arguments with given formatting items. Internally used by `DelayedFormat`."],["format_item","Formats single formatting item"],["parse","Tries to parse given string into `parsed` with given formatting items. Returns `Ok` when the entire string has been parsed (otherwise `parsed` should not be used). There should be no trailing string after parsing; use a stray `Item::Space` to trim whitespaces."]],"mod":[["strftime","`strftime`/`strptime`-inspired date and time formatting syntax."]],"struct":[["DelayedFormat","A temporary object which can be used as an argument to `format!` or others. This is normally constructed via `format` methods of each date and time type."],["InternalFixed","An opaque type representing fixed-format item types for internal uses only."],["InternalNumeric","An opaque type representing numeric item types for internal uses only."],["ParseError","An error from the `parse` function."],["Parsed","Parsed parts of date and time. There are two classes of methods:"]],"type":[["ParseResult","Same as `Result<T, ParseError>`."]]});
-146
View File
@@ -1,146 +0,0 @@
<!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 `strftime` mod in crate `chrono`."><meta name="keywords" content="rust, rustlang, rust-lang, strftime"><title>chrono::format::strftime - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[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">&#9776;</div><a href='../../../chrono/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Module strftime</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><p class="location"><a href="../../index.html">chrono</a>::<wbr><a href="../index.html">format</a></p><script>window.sidebarCurrent = {name: "strftime", ty: "mod", relpath: "../"};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../../../src/chrono/format/strftime.rs.html#4-649" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../../index.html">chrono</a>::<wbr><a href="../index.html">format</a>::<wbr><a class="mod" href="">strftime</a></span></h1><div class="docblock"><p><code>strftime</code>/<code>strptime</code>-inspired date and time formatting syntax.</p>
<h2 id="specifiers" class="section-header"><a href="#specifiers">Specifiers</a></h2>
<p>The following specifiers are available both to formatting and parsing.</p>
<table><thead><tr><th>Spec.</th><th>Example</th><th>Description</th></tr></thead><tbody>
<tr><td></td><td></td><td><strong>DATE SPECIFIERS:</strong></td></tr>
<tr><td><code>%Y</code></td><td><code>2001</code></td><td>The full proleptic Gregorian year, zero-padded to 4 digits. <sup id="fnref1"><a href="#fn1">1</a></sup></td></tr>
<tr><td><code>%C</code></td><td><code>20</code></td><td>The proleptic Gregorian year divided by 100, zero-padded to 2 digits. <sup id="fnref2"><a href="#fn2">2</a></sup></td></tr>
<tr><td><code>%y</code></td><td><code>01</code></td><td>The proleptic Gregorian year modulo 100, zero-padded to 2 digits. <sup id="fnref2"><a href="#fn2">2</a></sup></td></tr>
<tr><td></td><td></td><td></td></tr>
<tr><td><code>%m</code></td><td><code>07</code></td><td>Month number (01--12), zero-padded to 2 digits.</td></tr>
<tr><td><code>%b</code></td><td><code>Jul</code></td><td>Abbreviated month name. Always 3 letters.</td></tr>
<tr><td><code>%B</code></td><td><code>July</code></td><td>Full month name. Also accepts corresponding abbreviation in parsing.</td></tr>
<tr><td><code>%h</code></td><td><code>Jul</code></td><td>Same as <code>%b</code>.</td></tr>
<tr><td></td><td></td><td></td></tr>
<tr><td><code>%d</code></td><td><code>08</code></td><td>Day number (01--31), zero-padded to 2 digits.</td></tr>
<tr><td><code>%e</code></td><td><code> 8</code></td><td>Same as <code>%d</code> but space-padded. Same as <code>%_d</code>.</td></tr>
<tr><td></td><td></td><td></td></tr>
<tr><td><code>%a</code></td><td><code>Sun</code></td><td>Abbreviated weekday name. Always 3 letters.</td></tr>
<tr><td><code>%A</code></td><td><code>Sunday</code></td><td>Full weekday name. Also accepts corresponding abbreviation in parsing.</td></tr>
<tr><td><code>%w</code></td><td><code>0</code></td><td>Sunday = 0, Monday = 1, ..., Saturday = 6.</td></tr>
<tr><td><code>%u</code></td><td><code>7</code></td><td>Monday = 1, Tuesday = 2, ..., Sunday = 7. (ISO 8601)</td></tr>
<tr><td></td><td></td><td></td></tr>
<tr><td><code>%U</code></td><td><code>28</code></td><td>Week number starting with Sunday (00--53), zero-padded to 2 digits. <sup id="fnref3"><a href="#fn3">3</a></sup></td></tr>
<tr><td><code>%W</code></td><td><code>27</code></td><td>Same as <code>%U</code>, but week 1 starts with the first Monday in that year instead.</td></tr>
<tr><td></td><td></td><td></td></tr>
<tr><td><code>%G</code></td><td><code>2001</code></td><td>Same as <code>%Y</code> but uses the year number in ISO 8601 week date. <sup id="fnref4"><a href="#fn4">4</a></sup></td></tr>
<tr><td><code>%g</code></td><td><code>01</code></td><td>Same as <code>%y</code> but uses the year number in ISO 8601 week date. <sup id="fnref4"><a href="#fn4">4</a></sup></td></tr>
<tr><td><code>%V</code></td><td><code>27</code></td><td>Same as <code>%U</code> but uses the week number in ISO 8601 week date (01--53). <sup id="fnref4"><a href="#fn4">4</a></sup></td></tr>
<tr><td></td><td></td><td></td></tr>
<tr><td><code>%j</code></td><td><code>189</code></td><td>Day of the year (001--366), zero-padded to 3 digits.</td></tr>
<tr><td></td><td></td><td></td></tr>
<tr><td><code>%D</code></td><td><code>07/08/01</code></td><td>Month-day-year format. Same as <code>%m/%d/%y</code>.</td></tr>
<tr><td><code>%x</code></td><td><code>07/08/01</code></td><td>Locale's date representation (e.g., 12/31/99).</td></tr>
<tr><td><code>%F</code></td><td><code>2001-07-08</code></td><td>Year-month-day format (ISO 8601). Same as <code>%Y-%m-%d</code>.</td></tr>
<tr><td><code>%v</code></td><td><code> 8-Jul-2001</code></td><td>Day-month-year format. Same as <code>%e-%b-%Y</code>.</td></tr>
<tr><td></td><td></td><td></td></tr>
<tr><td></td><td></td><td><strong>TIME SPECIFIERS:</strong></td></tr>
<tr><td><code>%H</code></td><td><code>00</code></td><td>Hour number (00--23), zero-padded to 2 digits.</td></tr>
<tr><td><code>%k</code></td><td><code> 0</code></td><td>Same as <code>%H</code> but space-padded. Same as <code>%_H</code>.</td></tr>
<tr><td><code>%I</code></td><td><code>12</code></td><td>Hour number in 12-hour clocks (01--12), zero-padded to 2 digits.</td></tr>
<tr><td><code>%l</code></td><td><code>12</code></td><td>Same as <code>%I</code> but space-padded. Same as <code>%_I</code>.</td></tr>
<tr><td></td><td></td><td></td></tr>
<tr><td><code>%P</code></td><td><code>am</code></td><td><code>am</code> or <code>pm</code> in 12-hour clocks.</td></tr>
<tr><td><code>%p</code></td><td><code>AM</code></td><td><code>AM</code> or <code>PM</code> in 12-hour clocks.</td></tr>
<tr><td></td><td></td><td></td></tr>
<tr><td><code>%M</code></td><td><code>34</code></td><td>Minute number (00--59), zero-padded to 2 digits.</td></tr>
<tr><td><code>%S</code></td><td><code>60</code></td><td>Second number (00--60), zero-padded to 2 digits. <sup id="fnref5"><a href="#fn5">5</a></sup></td></tr>
<tr><td><code>%f</code></td><td><code>026490000</code></td><td>The fractional seconds (in nanoseconds) since last whole second. <sup id="fnref6"><a href="#fn6">6</a></sup></td></tr>
<tr><td><code>%.f</code></td><td><code>.026490</code></td><td>Similar to <code>.%f</code> but left-aligned. These all consume the leading dot. <sup id="fnref6"><a href="#fn6">6</a></sup></td></tr>
<tr><td><code>%.3f</code></td><td><code>.026</code></td><td>Similar to <code>.%f</code> but left-aligned but fixed to a length of 3. <sup id="fnref6"><a href="#fn6">6</a></sup></td></tr>
<tr><td><code>%.6f</code></td><td><code>.026490</code></td><td>Similar to <code>.%f</code> but left-aligned but fixed to a length of 6. <sup id="fnref6"><a href="#fn6">6</a></sup></td></tr>
<tr><td><code>%.9f</code></td><td><code>.026490000</code></td><td>Similar to <code>.%f</code> but left-aligned but fixed to a length of 9. <sup id="fnref6"><a href="#fn6">6</a></sup></td></tr>
<tr><td><code>%3f</code></td><td><code>026</code></td><td>Similar to <code>%.3f</code> but without the leading dot. <sup id="fnref6"><a href="#fn6">6</a></sup></td></tr>
<tr><td><code>%6f</code></td><td><code>026490</code></td><td>Similar to <code>%.6f</code> but without the leading dot. <sup id="fnref6"><a href="#fn6">6</a></sup></td></tr>
<tr><td><code>%9f</code></td><td><code>026490000</code></td><td>Similar to <code>%.9f</code> but without the leading dot. <sup id="fnref6"><a href="#fn6">6</a></sup></td></tr>
<tr><td></td><td></td><td></td></tr>
<tr><td><code>%R</code></td><td><code>00:34</code></td><td>Hour-minute format. Same as <code>%H:%M</code>.</td></tr>
<tr><td><code>%T</code></td><td><code>00:34:60</code></td><td>Hour-minute-second format. Same as <code>%H:%M:%S</code>.</td></tr>
<tr><td><code>%X</code></td><td><code>00:34:60</code></td><td>Locale's time representation (e.g., 23:13:48).</td></tr>
<tr><td><code>%r</code></td><td><code>12:34:60 AM</code></td><td>Hour-minute-second format in 12-hour clocks. Same as <code>%I:%M:%S %p</code>.</td></tr>
<tr><td></td><td></td><td></td></tr>
<tr><td></td><td></td><td><strong>TIME ZONE SPECIFIERS:</strong></td></tr>
<tr><td><code>%Z</code></td><td><code>ACST</code></td><td>Local time zone name. Skips all non-whitespace characters during parsing. <sup id="fnref7"><a href="#fn7">7</a></sup></td></tr>
<tr><td><code>%z</code></td><td><code>+0930</code></td><td>Offset from the local time to UTC (with UTC being <code>+0000</code>).</td></tr>
<tr><td><code>%:z</code></td><td><code>+09:30</code></td><td>Same as <code>%z</code> but with a colon.</td></tr>
<tr><td><code>%#z</code></td><td><code>+09</code></td><td><em>Parsing only:</em> Same as <code>%z</code> but allows minutes to be missing or present.</td></tr>
<tr><td></td><td></td><td></td></tr>
<tr><td></td><td></td><td><strong>DATE &amp; TIME SPECIFIERS:</strong></td></tr>
<tr><td><code>%c</code></td><td><code>Sun Jul 8 00:34:60 2001</code></td><td>Locale's date and time (e.g., Thu Mar 3 23:05:25 2005).</td></tr>
<tr><td><code>%+</code></td><td><code>2001-07-08T00:34:60.026490+09:30</code></td><td>ISO 8601 / RFC 3339 date &amp; time format. <sup id="fnref8"><a href="#fn8">8</a></sup></td></tr>
<tr><td></td><td></td><td></td></tr>
<tr><td><code>%s</code></td><td><code>994518299</code></td><td>UNIX timestamp, the number of seconds since 1970-01-01 00:00 UTC. <sup id="fnref9"><a href="#fn9">9</a></sup></td></tr>
<tr><td></td><td></td><td></td></tr>
<tr><td></td><td></td><td><strong>SPECIAL SPECIFIERS:</strong></td></tr>
<tr><td><code>%t</code></td><td></td><td>Literal tab (<code>\t</code>).</td></tr>
<tr><td><code>%n</code></td><td></td><td>Literal newline (<code>\n</code>).</td></tr>
<tr><td><code>%%</code></td><td></td><td>Literal percent sign.</td></tr>
</tbody></table>
<p>It is possible to override the default padding behavior of numeric specifiers <code>%?</code>.
This is not allowed for other specifiers and will result in the <code>BAD_FORMAT</code> error.</p>
<table><thead><tr><th>Modifier</th><th>Description</th></tr></thead><tbody>
<tr><td><code>%-?</code></td><td>Suppresses any padding including spaces and zeroes. (e.g. <code>%j</code> = <code>012</code>, <code>%-j</code> = <code>12</code>)</td></tr>
<tr><td><code>%_?</code></td><td>Uses spaces as a padding. (e.g. <code>%j</code> = <code>012</code>, <code>%_j</code> = <code> 12</code>)</td></tr>
<tr><td><code>%0?</code></td><td>Uses zeroes as a padding. (e.g. <code>%e</code> = <code> 9</code>, <code>%0e</code> = <code>09</code>)</td></tr>
</tbody></table>
<p>Notes:</p>
<div class="footnotes"><hr><ol><li id="fn1"><p><code>%Y</code>:
Negative years are allowed in formatting but not in parsing.&nbsp;<a href="#fnref1" rev="footnote"></a></p></li><li id="fn2"><p><code>%C</code>, <code>%y</code>:
This is floor division, so 100 BCE (year number -99) will print <code>-1</code> and <code>99</code> respectively.&nbsp;<a href="#fnref2" rev="footnote"></a></p></li><li id="fn3"><p><code>%U</code>:
Week 1 starts with the first Sunday in that year.
It is possible to have week 0 for days before the first Sunday.&nbsp;<a href="#fnref3" rev="footnote"></a></p></li><li id="fn4"><p><code>%G</code>, <code>%g</code>, <code>%V</code>:
Week 1 is the first week with at least 4 days in that year.
Week 0 does not exist, so this should be used with <code>%G</code> or <code>%g</code>.&nbsp;<a href="#fnref4" rev="footnote"></a></p></li><li id="fn5"><p><code>%S</code>:
It accounts for leap seconds, so <code>60</code> is possible.&nbsp;<a href="#fnref5" rev="footnote"></a></p></li><li id="fn6"><p><code>%f</code>, <code>%.f</code>, <code>%.3f</code>, <code>%.6f</code>, <code>%.9f</code>, <code>%3f</code>, <code>%6f</code>, <code>%9f</code>:
<br>
The default <code>%f</code> is right-aligned and always zero-padded to 9 digits
for the compatibility with glibc and others,
so it always counts the number of nanoseconds since the last whole second.
E.g. 7ms after the last second will print <code>007000000</code>,
and parsing <code>7000000</code> will yield the same.
<br>
<br>
The variant <code>%.f</code> is left-aligned and print 0, 3, 6 or 9 fractional digits
according to the precision.
E.g. 70ms after the last second under <code>%.f</code> will print <code>.070</code> (note: not <code>.07</code>),
and parsing <code>.07</code>, <code>.070000</code> etc. will yield the same.
Note that they can print or read nothing if the fractional part is zero or
the next character is not <code>.</code>.
<br>
<br>
The variant <code>%.3f</code>, <code>%.6f</code> and <code>%.9f</code> are left-aligned and print 3, 6 or 9 fractional digits
according to the number preceding <code>f</code>.
E.g. 70ms after the last second under <code>%.3f</code> will print <code>.070</code> (note: not <code>.07</code>),
and parsing <code>.07</code>, <code>.070000</code> etc. will yield the same.
Note that they can read nothing if the fractional part is zero or
the next character is not <code>.</code> however will print with the specified length.
<br>
<br>
The variant <code>%3f</code>, <code>%6f</code> and <code>%9f</code> are left-aligned and print 3, 6 or 9 fractional digits
according to the number preceding <code>f</code>, but without the leading dot.
E.g. 70ms after the last second under <code>%3f</code> will print <code>070</code> (note: not <code>07</code>),
and parsing <code>07</code>, <code>070000</code> etc. will yield the same.
Note that they can read nothing if the fractional part is zero.&nbsp;<a href="#fnref6" rev="footnote"></a></p></li><li id="fn7"><p><code>%Z</code>:
Offset will not be populated from the parsed data, nor will it be validated.
Timezone is completely ignored. Similar to the glibc <code>strptime</code> treatment of
this format code.
<br>
<br>
It is not possible to reliably convert from an abbreviation to an offset,
for example CDT can mean either Central Daylight Time (North America) or
China Daylight Time.&nbsp;<a href="#fnref7" rev="footnote"></a></p></li><li id="fn8"><p><code>%+</code>: Same as <code>%Y-%m-%dT%H:%M:%S%.f%:z</code>, i.e. 0, 3, 6 or 9 fractional
digits for seconds and colons in the time zone offset.
<br>
<br>
The typical <code>strftime</code> implementations have different (and locale-dependent)
formats for this specifier. While Chrono's format for <code>%+</code> is far more
stable, it is best to avoid this specifier if you want to control the exact
output.&nbsp;<a href="#fnref8" rev="footnote"></a></p></li><li id="fn9"><p><code>%s</code>:
This is not padded and can be negative.
For the purpose of Chrono, it only accounts for non-leap seconds
so it slightly differs from ISO C <code>strftime</code> behavior.&nbsp;<a href="#fnref9" rev="footnote"></a></p></li></ol></div></div><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
<table><tr class="module-item"><td><a class="struct" href="struct.StrftimeItems.html" title="chrono::format::strftime::StrftimeItems struct">StrftimeItems</a></td><td class="docblock-short"><p>Parsing iterator for <code>strftime</code>-like format strings.</p>
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "chrono";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
@@ -1 +0,0 @@
initSidebarItems({"struct":[["StrftimeItems","Parsing iterator for `strftime`-like format strings."]]});
@@ -1,136 +0,0 @@
<!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 `StrftimeItems` struct in crate `chrono`."><meta name="keywords" content="rust, rustlang, rust-lang, StrftimeItems"><title>chrono::format::strftime::StrftimeItems - 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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[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">&#9776;</div><a href='../../../chrono/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Struct StrftimeItems</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.new">new</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Iterator">Iterator</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-IntoIterator">IntoIterator</a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><p class="location"><a href="../../index.html">chrono</a>::<wbr><a href="../index.html">format</a>::<wbr><a href="index.html">strftime</a></p><script>window.sidebarCurrent = {name: "StrftimeItems", ty: "struct", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../../../src/chrono/format/strftime.rs.html#202-215" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="../../index.html">chrono</a>::<wbr><a href="../index.html">format</a>::<wbr><a href="index.html">strftime</a>::<wbr><a class="struct" href="">StrftimeItems</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct StrftimeItems&lt;'a&gt; { /* fields omitted */ }</pre></div><div class="docblock"><p>Parsing iterator for <code>strftime</code>-like format strings.</p>
</div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl&lt;'a&gt; <a class="struct" href="../../../chrono/format/strftime/struct.StrftimeItems.html" title="struct chrono::format::strftime::StrftimeItems">StrftimeItems</a>&lt;'a&gt;</code><a href="#impl" class="anchor"></a><a class="srclink" href="../../../src/chrono/format/strftime.rs.html#217-262" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.new" class="method"><code>pub fn <a href="#method.new" class="fnname">new</a>(s: &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="struct" href="../../../chrono/format/strftime/struct.StrftimeItems.html" title="struct chrono::format::strftime::StrftimeItems">StrftimeItems</a>&lt;'a&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../../chrono/format/strftime/struct.StrftimeItems.html" title="struct chrono::format::strftime::StrftimeItems">StrftimeItems</a>&lt;'a&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="../../../chrono/format/strftime/struct.StrftimeItems.html" title="struct chrono::format::strftime::StrftimeItems">StrftimeItems</a>&lt;'a&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="type">Item</a> = <a class="enum" href="../../../chrono/format/enum.Item.html" title="enum chrono::format::Item">Item</a>&lt;'a&gt;;</span></code></span></div></span></span></code><a class="srclink" href="../../../src/chrono/format/strftime.rs.html#219-221" title="goto source code">[src]</a></h4><div class="docblock"><p>Creates a new parsing iterator from the <code>strftime</code>-like format string.</p>
</div></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Clone" class="impl"><code class="in-band">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../../chrono/format/strftime/struct.StrftimeItems.html" title="struct chrono::format::strftime::StrftimeItems">StrftimeItems</a>&lt;'a&gt;</code><a href="#impl-Clone" class="anchor"></a><a class="srclink" href="../../../src/chrono/format/strftime.rs.html#201" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&amp;self) -&gt; <a class="struct" href="../../../chrono/format/strftime/struct.StrftimeItems.html" title="struct chrono::format::strftime::StrftimeItems">StrftimeItems</a>&lt;'a&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../../chrono/format/strftime/struct.StrftimeItems.html" title="struct chrono::format::strftime::StrftimeItems">StrftimeItems</a>&lt;'a&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="../../../chrono/format/strftime/struct.StrftimeItems.html" title="struct chrono::format::strftime::StrftimeItems">StrftimeItems</a>&lt;'a&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="type">Item</a> = <a class="enum" href="../../../chrono/format/enum.Item.html" title="enum chrono::format::Item">Item</a>&lt;'a&gt;;</span></code></span></div></span></span></code><a class="srclink" href="../../../src/chrono/format/strftime.rs.html#201" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id="method.clone_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&amp;mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self)</code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#128-130" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3 id="impl-Debug" class="impl"><code class="in-band">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../../chrono/format/strftime/struct.StrftimeItems.html" title="struct chrono::format::strftime::StrftimeItems">StrftimeItems</a>&lt;'a&gt;</code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../../src/chrono/format/strftime.rs.html#201" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class="srclink" href="../../../src/chrono/format/strftime.rs.html#201" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id="impl-Iterator" class="impl"><code class="in-band">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="../../../chrono/format/strftime/struct.StrftimeItems.html" title="struct chrono::format::strftime::StrftimeItems">StrftimeItems</a>&lt;'a&gt;</code><a href="#impl-Iterator" class="anchor"></a><a class="srclink" href="../../../src/chrono/format/strftime.rs.html#266-485" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Item" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="type">Item</a> = <a class="enum" href="../../../chrono/format/enum.Item.html" title="enum chrono::format::Item">Item</a>&lt;'a&gt;</code></h4><div class='docblock'><p>The type of the elements being iterated over.</p>
</div><h4 id="method.next" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#tymethod.next" class="fnname">next</a>(&amp;mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="../../../chrono/format/enum.Item.html" title="enum chrono::format::Item">Item</a>&lt;'a&gt;&gt;</code><a class="srclink" href="../../../src/chrono/format/strftime.rs.html#269-484" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Advances the iterator and returns the next value. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#tymethod.next">Read more</a></p>
</div><h4 id="method.size_hint" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.size_hint" class="fnname">size_hint</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#204-206" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the bounds on the remaining length of the iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.size_hint">Read more</a></p>
</div><h4 id="method.count" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.count" class="fnname">count</a>(self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#243-254" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Consumes the iterator, counting the number of iterations and returning it. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.count">Read more</a></p>
</div><h4 id="method.last" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.last" class="fnname">last</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>&gt;</code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#275-285" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Consumes the iterator, returning the last element. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.last">Read more</a></p>
</div><h4 id="method.advance_by" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.advance_by" class="fnname">advance_by</a>(&amp;mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt;</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#318-323" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><details><summary><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>iter_advance_by</code>)</summary><p>recently added</p>
</details></div></div><div class='docblock hidden'><p>Advances the iterator by <code>n</code> elements. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.advance_by">Read more</a></p>
</div><h4 id="method.nth" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.nth" class="fnname">nth</a>(&amp;mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>&gt;</code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#366-369" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the <code>n</code>th element of the iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.nth">Read more</a></p>
</div><h4 id="method.step_by" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.step_by" class="fnname">step_by</a>(self, step: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/step_by/struct.StepBy.html" title="struct core::iter::adapters::step_by::StepBy">StepBy</a>&lt;Self&gt;</code><span class="since" title="Stable since Rust version 1.28.0">1.28.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#417-422" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates an iterator starting at the same point, but stepping by
the given amount at each iteration. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.step_by">Read more</a></p>
</div><h4 id="method.chain" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.chain" class="fnname">chain</a>&lt;U&gt;(self, other: U) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/chain/struct.Chain.html" title="struct core::iter::adapters::chain::Chain">Chain</a>&lt;Self, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter" title="type core::iter::traits::collect::IntoIterator::IntoIter">IntoIter</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&lt;Item = Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>&gt;,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#488-494" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Takes two iterators and creates a new iterator over both in sequence. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.chain">Read more</a></p>
</div><h4 id="method.zip" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.zip" class="fnname">zip</a>&lt;U&gt;(self, other: U) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/zip/struct.Zip.html" title="struct core::iter::adapters::zip::Zip">Zip</a>&lt;Self, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter" title="type core::iter::traits::collect::IntoIterator::IntoIter">IntoIter</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#564-570" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>'Zips up' two iterators into a single iterator of pairs. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.zip">Read more</a></p>
</div><h4 id="method.map" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.map" class="fnname">map</a>&lt;B, F&gt;(self, f: F) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/map/struct.Map.html" title="struct core::iter::adapters::map::Map">Map</a>&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -&gt; B,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#623-629" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Takes a closure and creates an iterator which calls that closure on each
element. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.map">Read more</a></p>
</div><h4 id="method.for_each" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.for_each" class="fnname">for_each</a>&lt;F&gt;(self, f: F) <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>),&nbsp;</span></code><span class="since" title="Stable since Rust version 1.21.0">1.21.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#668-679" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Calls a closure on each element of an iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.for_each">Read more</a></p>
</div><h4 id="method.filter" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.filter" class="fnname">filter</a>&lt;P&gt;(self, predicate: P) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/filter/struct.Filter.html" title="struct core::iter::adapters::filter::Filter">Filter</a>&lt;Self, P&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&amp;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#743-749" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates an iterator which uses a closure to determine if an element
should be yielded. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.filter">Read more</a></p>
</div><h4 id="method.filter_map" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.filter_map" class="fnname">filter_map</a>&lt;B, F&gt;(self, f: F) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/filter_map/struct.FilterMap.html" title="struct core::iter::adapters::filter_map::FilterMap">FilterMap</a>&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;B&gt;,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#790-796" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates an iterator that both filters and maps. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.filter_map">Read more</a></p>
</div><h4 id="method.enumerate" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.enumerate" class="fnname">enumerate</a>(self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/enumerate/struct.Enumerate.html" title="struct core::iter::adapters::enumerate::Enumerate">Enumerate</a>&lt;Self&gt;</code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#838-843" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates an iterator which gives the current iteration count as well as
the next value. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.enumerate">Read more</a></p>
</div><h4 id="method.peekable" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.peekable" class="fnname">peekable</a>(self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/peekable/struct.Peekable.html" title="struct core::iter::adapters::peekable::Peekable">Peekable</a>&lt;Self&gt;</code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#887-892" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates an iterator which can use <a href="https://doc.rust-lang.org/nightly/core/iter/adapters/peekable/struct.Peekable.html#method.peek"><code>peek</code></a> to look at the next element of
the iterator without consuming it. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.peekable">Read more</a></p>
</div><h4 id="method.skip_while" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.skip_while" class="fnname">skip_while</a>&lt;P&gt;(self, predicate: P) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/skip_while/struct.SkipWhile.html" title="struct core::iter::adapters::skip_while::SkipWhile">SkipWhile</a>&lt;Self, P&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&amp;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#951-957" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates an iterator that <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.skip"><code>skip</code></a>s elements based on a predicate. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.skip_while">Read more</a></p>
</div><h4 id="method.take_while" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.take_while" class="fnname">take_while</a>&lt;P&gt;(self, predicate: P) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/take_while/struct.TakeWhile.html" title="struct core::iter::adapters::take_while::TakeWhile">TakeWhile</a>&lt;Self, P&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&amp;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1032-1038" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates an iterator that yields elements based on a predicate. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.take_while">Read more</a></p>
</div><h4 id="method.map_while" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.map_while" class="fnname">map_while</a>&lt;B, P&gt;(self, predicate: P) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/map_while/struct.MapWhile.html" title="struct core::iter::adapters::map_while::MapWhile">MapWhile</a>&lt;Self, P&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;B&gt;,&nbsp;</span></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1127-1133" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><details><summary><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>iter_map_while</code>)</summary><p>recently added</p>
</details></div></div><div class='docblock hidden'><p>Creates an iterator that both yields elements based on a predicate and maps. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.map_while">Read more</a></p>
</div><h4 id="method.skip" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.skip" class="fnname">skip</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/skip/struct.Skip.html" title="struct core::iter::adapters::skip::Skip">Skip</a>&lt;Self&gt;</code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1154-1159" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates an iterator that skips the first <code>n</code> elements. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.skip">Read more</a></p>
</div><h4 id="method.take" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.take" class="fnname">take</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/take/struct.Take.html" title="struct core::iter::adapters::take::Take">Take</a>&lt;Self&gt;</code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1200-1205" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates an iterator that yields its first <code>n</code> elements. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.take">Read more</a></p>
</div><h4 id="method.scan" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.scan" class="fnname">scan</a>&lt;St, B, F&gt;(self, initial_state: St, f: F) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/scan/struct.Scan.html" title="struct core::iter::adapters::scan::Scan">Scan</a>&lt;Self, St, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>St, Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;B&gt;,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1244-1250" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>An iterator adaptor similar to <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.fold"><code>fold</code></a> that holds internal state and
produces a new iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.scan">Read more</a></p>
</div><h4 id="method.flat_map" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.flat_map" class="fnname">flat_map</a>&lt;U, F&gt;(self, f: F) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/flatten/struct.FlatMap.html" title="struct core::iter::adapters::flatten::FlatMap">FlatMap</a>&lt;Self, U, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -&gt; U,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1284-1291" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates an iterator that works like map, but flattens nested structure. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.flat_map">Read more</a></p>
</div><h4 id="method.flatten" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.flatten" class="fnname">flatten</a>(self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/flatten/struct.Flatten.html" title="struct core::iter::adapters::flatten::Flatten">Flatten</a>&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.29.0">1.29.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1356-1362" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates an iterator that flattens nested structure. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.flatten">Read more</a></p>
</div><h4 id="method.fuse" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.fuse" class="fnname">fuse</a>(self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/fuse/struct.Fuse.html" title="struct core::iter::adapters::fuse::Fuse">Fuse</a>&lt;Self&gt;</code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1419-1424" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates an iterator which ends after the first <a href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html#variant.None" title="None"><code>None</code></a>. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.fuse">Read more</a></p>
</div><h4 id="method.inspect" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.inspect" class="fnname">inspect</a>&lt;F&gt;(self, f: F) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/inspect/struct.Inspect.html" title="struct core::iter::adapters::inspect::Inspect">Inspect</a>&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&amp;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>),&nbsp;</span></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1503-1509" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Does something with each element of an iterator, passing the value on. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.inspect">Read more</a></p>
</div><h4 id="method.by_ref" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.by_ref" class="fnname">by_ref</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self</code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1548-1553" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Borrows an iterator, rather than consuming it. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.by_ref">Read more</a></p>
</div><h4 id="method.collect" class="method hidden"><code><span class="docblock attributes">#[must_use =
"if you really need to exhaust the iterator, consider `.for_each(drop)` instead"]</span>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.collect" class="fnname">collect</a>&lt;B&gt;(self) -&gt; B <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.FromIterator.html" title="trait core::iter::traits::collect::FromIterator">FromIterator</a>&lt;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>&gt;,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1666-1671" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Transforms an iterator into a collection. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.collect">Read more</a></p>
</div><h4 id="method.partition" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.partition" class="fnname">partition</a>&lt;B, F&gt;(self, f: F) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>B, B<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&amp;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.Extend.html" title="trait core::iter::traits::collect::Extend">Extend</a>&lt;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>&gt;,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1699-1726" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Consumes an iterator, creating two collections from it. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.partition">Read more</a></p>
</div><h4 id="method.partition_in_place" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.partition_in_place" class="fnname">partition_in_place</a>&lt;'a, T, P&gt;(self, predicate: P) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/double_ended/trait.DoubleEndedIterator.html" title="trait core::iter::traits::double_ended::DoubleEndedIterator">DoubleEndedIterator</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;'a mut </a>T&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'a,<br>&nbsp;&nbsp;&nbsp;&nbsp;P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,&nbsp;</span></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1754-1792" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><details><summary><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>iter_partition_in_place</code>)</summary><p>new API</p>
</details></div></div><div class='docblock hidden'><p>Reorders the elements of this iterator <em>in-place</em> according to the given predicate,
such that all those that return <code>true</code> precede all those that return <code>false</code>.
Returns the number of <code>true</code> elements found. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.partition_in_place">Read more</a></p>
</div><h4 id="method.is_partitioned" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.is_partitioned" class="fnname">is_partitioned</a>&lt;P&gt;(self, predicate: P) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,&nbsp;</span></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1811-1819" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><details><summary><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>iter_is_partitioned</code>)</summary><p>new API</p>
</details></div></div><div class='docblock hidden'><p>Checks if the elements of this iterator are partitioned according to the given predicate,
such that all those that return <code>true</code> precede all those that return <code>false</code>. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.is_partitioned">Read more</a></p>
</div><h4 id="method.try_fold" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.try_fold" class="fnname">try_fold</a>&lt;B, F, R&gt;(&amp;mut self, init: B, f: F) -&gt; R <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(B, Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -&gt; R,<br>&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try/trait.Try.html" title="trait core::ops::try::Try">Try</a>&lt;Ok = B&gt;,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.27.0">1.27.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1880-1891" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>An iterator method that applies a function as long as it returns
successfully, producing a single, final value. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.try_fold">Read more</a></p>
</div><h4 id="method.try_for_each" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.try_for_each" class="fnname">try_for_each</a>&lt;F, R&gt;(&amp;mut self, f: F) -&gt; R <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -&gt; R,<br>&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try/trait.Try.html" title="trait core::ops::try::Try">Try</a>&lt;Ok = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>&gt;,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.27.0">1.27.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1922-1934" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>An iterator method that applies a fallible function to each item in the
iterator, stopping at the first error and returning that error. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.try_for_each">Read more</a></p>
</div><h4 id="method.fold" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.fold" class="fnname">fold</a>&lt;B, F&gt;(self, init: B, f: F) -&gt; B <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(B, Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -&gt; B,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2016-2026" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>An iterator method that applies a function, producing a single, final value. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.fold">Read more</a></p>
</div><h4 id="method.fold_first" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.fold_first" class="fnname">fold_first</a>&lt;F&gt;(self, f: F) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>, Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -&gt; Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>,&nbsp;</span></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2058-2065" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>iterator_fold_self</code>)</div></div><div class='docblock hidden'><p>The same as <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.fold"><code>fold()</code></a>, but uses the first element in the
iterator as the initial value, folding every subsequent element into it.
If the iterator is empty, return <a href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html#variant.None" title="None"><code>None</code></a>; otherwise, return the result
of the fold. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.fold_first">Read more</a></p>
</div><h4 id="method.all" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.all" class="fnname">all</a>&lt;F&gt;(&amp;mut self, f: F) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2106-2118" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Tests if every element of the iterator matches a predicate. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.all">Read more</a></p>
</div><h4 id="method.any" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.any" class="fnname">any</a>&lt;F&gt;(&amp;mut self, f: F) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2159-2172" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Tests if any element of the iterator matches a predicate. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.any">Read more</a></p>
</div><h4 id="method.find" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.find" class="fnname">find</a>&lt;P&gt;(&amp;mut self, predicate: P) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&amp;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2219-2232" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Searches for an element of an iterator that satisfies a predicate. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.find">Read more</a></p>
</div><h4 id="method.find_map" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.find_map" class="fnname">find_map</a>&lt;B, F&gt;(&amp;mut self, f: F) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;B&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;B&gt;,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.30.0">1.30.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2250-2264" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Applies function to the elements of iterator and returns
the first non-none result. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.find_map">Read more</a></p>
</div><h4 id="method.try_find" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.try_find" class="fnname">try_find</a>&lt;F, R&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;f: F<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>&gt;, &lt;R as <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try/trait.Try.html" title="trait core::ops::try::Try">Try</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/ops/try/trait.Try.html#associatedtype.Error" title="type core::ops::try::Try::Error">Error</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&amp;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -&gt; R,<br>&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try/trait.Try.html" title="trait core::ops::try::Try">Try</a>&lt;Ok = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>&gt;,&nbsp;</span></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2288-2308" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><details><summary><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>try_find</code>)</summary><p>new API</p>
</details></div></div><div class='docblock hidden'><p>Applies function to the elements of iterator and returns
the first true result or the first error. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.try_find">Read more</a></p>
</div><h4 id="method.position" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.position" class="fnname">position</a>&lt;P&gt;(&amp;mut self, predicate: P) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2365-2385" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Searches for an element in an iterator, returning its index. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.position">Read more</a></p>
</div><h4 id="method.rposition" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.rposition" class="fnname">rposition</a>&lt;P&gt;(&amp;mut self, predicate: P) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/exact_size/trait.ExactSizeIterator.html" title="trait core::iter::traits::exact_size::ExactSizeIterator">ExactSizeIterator</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/double_ended/trait.DoubleEndedIterator.html" title="trait core::iter::traits::double_ended::DoubleEndedIterator">DoubleEndedIterator</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2426-2445" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Searches for an element in an iterator from the right, returning its
index. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.rposition">Read more</a></p>
</div><h4 id="method.max" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.max" class="fnname">max</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2465-2471" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the maximum element of an iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.max">Read more</a></p>
</div><h4 id="method.min" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.min" class="fnname">min</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2491-2497" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the minimum element of an iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.min">Read more</a></p>
</div><h4 id="method.max_by_key" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.max_by_key" class="fnname">max_by_key</a>&lt;B, F&gt;(self, f: F) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&amp;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -&gt; B,<br>&nbsp;&nbsp;&nbsp;&nbsp;B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2513-2530" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the element that gives the maximum value from the
specified function. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.max_by_key">Read more</a></p>
</div><h4 id="method.max_by" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.max_by" class="fnname">max_by</a>&lt;F&gt;(self, compare: F) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&amp;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>, &amp;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.15.0">1.15.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2546-2557" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the element that gives the maximum value with respect to the
specified comparison function. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.max_by">Read more</a></p>
</div><h4 id="method.min_by_key" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.min_by_key" class="fnname">min_by_key</a>&lt;B, F&gt;(self, f: F) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&amp;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -&gt; B,<br>&nbsp;&nbsp;&nbsp;&nbsp;B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2573-2590" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the element that gives the minimum value from the
specified function. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.min_by_key">Read more</a></p>
</div><h4 id="method.min_by" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.min_by" class="fnname">min_by</a>&lt;F&gt;(self, compare: F) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&amp;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>, &amp;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.15.0">1.15.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2606-2617" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the element that gives the minimum value with respect to the
specified comparison function. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.min_by">Read more</a></p>
</div><h4 id="method.rev" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.rev" class="fnname">rev</a>(self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/rev/struct.Rev.html" title="struct core::iter::adapters::rev::Rev">Rev</a>&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/double_ended/trait.DoubleEndedIterator.html" title="trait core::iter::traits::double_ended::DoubleEndedIterator">DoubleEndedIterator</a>,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2642-2647" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Reverses an iterator's direction. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.rev">Read more</a></p>
</div><h4 id="method.unzip" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.unzip" class="fnname">unzip</a>&lt;A, B, FromA, FromB&gt;(self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>FromA, FromB<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>A, B<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;FromA: <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.Extend.html" title="trait core::iter::traits::collect::Extend">Extend</a>&lt;A&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;FromB: <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.Extend.html" title="trait core::iter::traits::collect::Extend">Extend</a>&lt;B&gt;,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2672-2700" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Converts an iterator of pairs into a pair of containers. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.unzip">Read more</a></p>
</div><h4 id="method.copied" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.copied" class="fnname">copied</a>&lt;'a, T&gt;(self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/copied/struct.Copied.html" title="struct core::iter::adapters::copied::Copied">Copied</a>&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;'a </a>T&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'a + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.36.0">1.36.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2723-2729" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates an iterator which copies all of its elements. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.copied">Read more</a></p>
</div><h4 id="method.cloned" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.cloned" class="fnname">cloned</a>&lt;'a, T&gt;(self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/cloned/struct.Cloned.html" title="struct core::iter::adapters::cloned::Cloned">Cloned</a>&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a>&lt;Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;'a </a>T&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'a + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2754-2760" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates an iterator which <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone"><code>clone</code></a>s all of its elements. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.cloned">Read more</a></p>
</div><h4 id="method.cycle" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.cycle" class="fnname">cycle</a>(self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/cycle/struct.Cycle.html" title="struct core::iter::adapters::cycle::Cycle">Cycle</a>&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2787-2792" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Repeats an iterator endlessly. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.cycle">Read more</a></p>
</div><h4 id="method.sum" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.sum" class="fnname">sum</a>&lt;S&gt;(self) -&gt; S <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/accum/trait.Sum.html" title="trait core::iter::traits::accum::Sum">Sum</a>&lt;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>&gt;,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.11.0">1.11.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2817-2823" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Sums the elements of an iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.sum">Read more</a></p>
</div><h4 id="method.product" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.product" class="fnname">product</a>&lt;P&gt;(self) -&gt; P <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/accum/trait.Product.html" title="trait core::iter::traits::accum::Product">Product</a>&lt;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>&gt;,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.11.0">1.11.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2846-2852" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Iterates over the entire iterator, multiplying all the elements <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.product">Read more</a></p>
</div><h4 id="method.cmp" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.cmp" class="fnname">cmp</a>&lt;I&gt;(self, other: I) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&lt;Item = Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.5.0">1.5.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2867-2874" title="goto source code">[src]</a></h4><div class='docblock hidden'><p><a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#lexicographical-comparison">Lexicographically</a> compares the elements of this <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> with those
of another. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.cmp">Read more</a></p>
</div><h4 id="method.cmp_by" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.cmp_by" class="fnname">cmp_by</a>&lt;I, F&gt;(self, other: I, cmp: F) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>, &lt;I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,&nbsp;</span></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2896-2926" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>iter_order_by</code>)</div></div><div class='docblock hidden'><p><a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#lexicographical-comparison">Lexicographically</a> compares the elements of this <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> with those
of another with respect to the specified comparison function. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.cmp_by">Read more</a></p>
</div><h4 id="method.partial_cmp" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.partial_cmp" class="fnname">partial_cmp</a>&lt;I&gt;(self, other: I) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>&lt;&lt;I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>&gt;,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.5.0">1.5.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2943-2950" title="goto source code">[src]</a></h4><div class='docblock hidden'><p><a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#lexicographical-comparison">Lexicographically</a> compares the elements of this <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> with those
of another. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.partial_cmp">Read more</a></p>
</div><h4 id="method.partial_cmp_by" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.partial_cmp_by" class="fnname">partial_cmp_by</a>&lt;I, F&gt;(self, other: I, partial_cmp: F) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>, &lt;I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,&nbsp;</span></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2981-3011" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>iter_order_by</code>)</div></div><div class='docblock hidden'><p><a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#lexicographical-comparison">Lexicographically</a> compares the elements of this <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> with those
of another with respect to the specified comparison function. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.partial_cmp_by">Read more</a></p>
</div><h4 id="method.eq" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.eq" class="fnname">eq</a>&lt;I&gt;(self, other: I) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>&lt;&lt;I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>&gt;,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.5.0">1.5.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3023-3030" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Determines if the elements of this <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> are equal to those of
another. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.eq">Read more</a></p>
</div><h4 id="method.eq_by" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.eq_by" class="fnname">eq_by</a>&lt;I, F&gt;(self, other: I, eq: F) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>, &lt;I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,&nbsp;</span></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3048-3071" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>iter_order_by</code>)</div></div><div class='docblock hidden'><p>Determines if the elements of this <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> are equal to those of
another with respect to the specified equality function. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.eq_by">Read more</a></p>
</div><h4 id="method.ne" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.ne" class="fnname">ne</a>&lt;I&gt;(self, other: I) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>&lt;&lt;I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>&gt;,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.5.0">1.5.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3083-3090" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Determines if the elements of this <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> are unequal to those of
another. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.ne">Read more</a></p>
</div><h4 id="method.lt" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.lt" class="fnname">lt</a>&lt;I&gt;(self, other: I) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>&lt;&lt;I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>&gt;,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.5.0">1.5.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3104-3111" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Determines if the elements of this <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> are <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#lexicographical-comparison">lexicographically</a>
less than those of another. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.lt">Read more</a></p>
</div><h4 id="method.le" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.le" class="fnname">le</a>&lt;I&gt;(self, other: I) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>&lt;&lt;I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>&gt;,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.5.0">1.5.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3125-3132" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Determines if the elements of this <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> are <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#lexicographical-comparison">lexicographically</a>
less or equal to those of another. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.le">Read more</a></p>
</div><h4 id="method.gt" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.gt" class="fnname">gt</a>&lt;I&gt;(self, other: I) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>&lt;&lt;I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>&gt;,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.5.0">1.5.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3146-3153" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Determines if the elements of this <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> are <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#lexicographical-comparison">lexicographically</a>
greater than those of another. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.gt">Read more</a></p>
</div><h4 id="method.ge" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.ge" class="fnname">ge</a>&lt;I&gt;(self, other: I) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>&lt;&lt;I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>&gt;,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.5.0">1.5.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3167-3174" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Determines if the elements of this <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> are <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#lexicographical-comparison">lexicographically</a>
greater than or equal to those of another. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.ge">Read more</a></p>
</div><h4 id="method.is_sorted" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.is_sorted" class="fnname">is_sorted</a>(self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>&lt;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>&gt;,&nbsp;</span></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3198-3204" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><details><summary><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>is_sorted</code>)</summary><p>new API</p>
</details></div></div><div class='docblock hidden'><p>Checks if the elements of this iterator are sorted. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.is_sorted">Read more</a></p>
</div><h4 id="method.is_sorted_by" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.is_sorted_by" class="fnname">is_sorted_by</a>&lt;F&gt;(self, compare: F) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&amp;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>, &amp;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>&gt;,&nbsp;</span></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3226-3244" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><details><summary><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>is_sorted</code>)</summary><p>new API</p>
</details></div></div><div class='docblock hidden'><p>Checks if the elements of this iterator are sorted using the given comparator function. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.is_sorted_by">Read more</a></p>
</div><h4 id="method.is_sorted_by_key" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.is_sorted_by_key" class="fnname">is_sorted_by_key</a>&lt;F, K&gt;(self, f: F) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -&gt; K,<br>&nbsp;&nbsp;&nbsp;&nbsp;K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>&lt;K&gt;,&nbsp;</span></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3265-3272" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><details><summary><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>is_sorted</code>)</summary><p>new API</p>
</details></div></div><div class='docblock hidden'><p>Checks if the elements of this iterator are sorted using the given key extraction
function. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.is_sorted_by_key">Read more</a></p>
</div></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../chrono/format/strftime/struct.StrftimeItems.html" title="struct chrono::format::strftime::StrftimeItems">StrftimeItems</a>&lt;'a&gt;</code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../chrono/format/strftime/struct.StrftimeItems.html" title="struct chrono::format::strftime::StrftimeItems">StrftimeItems</a>&lt;'a&gt;</code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../chrono/format/strftime/struct.StrftimeItems.html" title="struct chrono::format::strftime::StrftimeItems">StrftimeItems</a>&lt;'a&gt;</code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../chrono/format/strftime/struct.StrftimeItems.html" title="struct chrono::format::strftime::StrftimeItems">StrftimeItems</a>&lt;'a&gt;</code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../chrono/format/strftime/struct.StrftimeItems.html" title="struct chrono::format::strftime::StrftimeItems">StrftimeItems</a>&lt;'a&gt;</code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></div><h3 id="impl-Borrow%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211-213" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id="impl-BorrowMut%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id="impl-From%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</code><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-Into%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-Into%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -&gt; U</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-IntoIterator" class="impl"><code class="in-band">impl&lt;I&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a> for I <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a>,&nbsp;</span></code><a href="#impl-IntoIterator" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/collect.rs.html#236-243" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Item-1" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" class="type">Item</a> = &lt;I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a></code></h4><div class='docblock'><p>The type of the elements being iterated over.</p>
</div><h4 id="associatedtype.IntoIter" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter" class="type">IntoIter</a> = I</code></h4><div class='docblock'><p>Which kind of iterator are we turning this into?</p>
</div><h4 id="method.into_iter" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter" class="fnname">into_iter</a>(self) -&gt; I</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/collect.rs.html#240-242" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates an iterator from a value. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter">Read more</a></p>
</div></div><h3 id="impl-ToOwned" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,&nbsp;</span></code><a href="#impl-ToOwned" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Owned" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
</div><h4 id="method.to_owned" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fnname">to_owned</a>(&amp;self) -&gt; T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
</div><h4 id="method.clone_into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fnname">clone_into</a>(&amp;self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T)</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><details><summary><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
</div></div><h3 id="impl-TryFrom%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id="method.try_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-TryInto%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-TryInto%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#575-584" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error-1" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id="method.try_into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#581-583" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "chrono";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,24 +0,0 @@
<!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 `InternalNumeric` struct in crate `chrono`."><meta name="keywords" content="rust, rustlang, rust-lang, InternalNumeric"><title>chrono::format::InternalNumeric - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[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">&#9776;</div><a href='../../chrono/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Struct InternalNumeric</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Eq">Eq</a><a href="#impl-PartialEq%3CInternalNumeric%3E">PartialEq&lt;InternalNumeric&gt;</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><p class="location"><a href="../index.html">chrono</a>::<wbr><a href="index.html">format</a></p><script>window.sidebarCurrent = {name: "InternalNumeric", ty: "struct", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../../src/chrono/format/mod.rs.html#137-139" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="../index.html">chrono</a>::<wbr><a href="index.html">format</a>::<wbr><a class="struct" href="">InternalNumeric</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct InternalNumeric { /* fields omitted */ }</pre></div><div class="docblock"><p>An opaque type representing numeric item types for internal uses only.</p>
</div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Clone" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../chrono/format/struct.InternalNumeric.html" title="struct chrono::format::InternalNumeric">InternalNumeric</a></code><a href="#impl-Clone" class="anchor"></a><a class="srclink" href="../../src/chrono/format/mod.rs.html#141-145" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&amp;self) -&gt; Self</code><a class="srclink" href="../../src/chrono/format/mod.rs.html#142-144" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id="method.clone_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&amp;mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self)</code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#128-130" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3 id="impl-Debug" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../chrono/format/struct.InternalNumeric.html" title="struct chrono::format::InternalNumeric">InternalNumeric</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../src/chrono/format/mod.rs.html#155-159" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class="srclink" href="../../src/chrono/format/mod.rs.html#156-158" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id="impl-Eq" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="../../chrono/format/struct.InternalNumeric.html" title="struct chrono::format::InternalNumeric">InternalNumeric</a></code><a href="#impl-Eq" class="anchor"></a><a class="srclink" href="../../src/chrono/format/mod.rs.html#153" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-PartialEq%3CInternalNumeric%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>&lt;<a class="struct" href="../../chrono/format/struct.InternalNumeric.html" title="struct chrono::format::InternalNumeric">InternalNumeric</a>&gt; for <a class="struct" href="../../chrono/format/struct.InternalNumeric.html" title="struct chrono::format::InternalNumeric">InternalNumeric</a></code><a href="#impl-PartialEq%3CInternalNumeric%3E" class="anchor"></a><a class="srclink" href="../../src/chrono/format/mod.rs.html#147-151" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.eq" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq" class="fnname">eq</a>(&amp;self, _other: &amp;<a class="struct" href="../../chrono/format/struct.InternalNumeric.html" title="struct chrono::format::InternalNumeric">InternalNumeric</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/chrono/format/mod.rs.html#148-150" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id="method.ne" class="method hidden"><code><span class="docblock attributes">#[must_use]</span>pub fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne" class="fnname">ne</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#209-211" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
</div></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../chrono/format/struct.InternalNumeric.html" title="struct chrono::format::InternalNumeric">InternalNumeric</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../chrono/format/struct.InternalNumeric.html" title="struct chrono::format::InternalNumeric">InternalNumeric</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../chrono/format/struct.InternalNumeric.html" title="struct chrono::format::InternalNumeric">InternalNumeric</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../chrono/format/struct.InternalNumeric.html" title="struct chrono::format::InternalNumeric">InternalNumeric</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../chrono/format/struct.InternalNumeric.html" title="struct chrono::format::InternalNumeric">InternalNumeric</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></div><h3 id="impl-Borrow%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211-213" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id="impl-BorrowMut%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id="impl-From%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</code><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-Into%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-Into%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -&gt; U</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-ToOwned" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,&nbsp;</span></code><a href="#impl-ToOwned" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Owned" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
</div><h4 id="method.to_owned" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fnname">to_owned</a>(&amp;self) -&gt; T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
</div><h4 id="method.clone_into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fnname">clone_into</a>(&amp;self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T)</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><details><summary><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
</div></div><h3 id="impl-TryFrom%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id="method.try_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-TryInto%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-TryInto%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#575-584" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error-1" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id="method.try_into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#581-583" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "chrono";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-5
View File
@@ -1,5 +0,0 @@
<!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 `ParseResult` type in crate `chrono`."><meta name="keywords" content="rust, rustlang, rust-lang, ParseResult"><title>chrono::format::ParseResult - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc type"><!--[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">&#9776;</div><a href='../../chrono/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Type Definition ParseResult</p><div class="sidebar-elems"><p class="location"><a href="../index.html">chrono</a>::<wbr><a href="index.html">format</a></p><script>window.sidebarCurrent = {name: "ParseResult", ty: "type", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../../src/chrono/format/mod.rs.html#356" title="goto source code">[src]</a></span><span class="in-band">Type Definition <a href="../index.html">chrono</a>::<wbr><a href="index.html">format</a>::<wbr><a class="type" href="">ParseResult</a></span></h1><pre class="rust typedef">type ParseResult&lt;T&gt; = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, <a class="struct" href="../../chrono/format/struct.ParseError.html" title="struct chrono::format::ParseError">ParseError</a>&gt;;</pre><div class="docblock"><p>Same as <code>Result&lt;T, ParseError&gt;</code>.</p>
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "chrono";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
-386
View File
@@ -1,386 +0,0 @@
<!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 `chrono` crate."><meta name="keywords" content="rust, rustlang, rust-lang, chrono"><title>chrono - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[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">&#9776;</div><a href='../chrono/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Crate chrono</p><div class="block version"><p>Version 0.4.19</p></div><div class="sidebar-elems"><a id="all-types" href="all.html"><p>See all chrono's items</p></a><div class="block items"><ul><li><a href="#reexports">Re-exports</a></li><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#constants">Constants</a></li><li><a href="#traits">Traits</a></li></ul></div><p class="location"></p><script>window.sidebarCurrent = {name: "chrono", ty: "mod", relpath: "../"};</script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../src/chrono/lib.rs.html#4-1535" title="goto source code">[src]</a></span><span class="in-band">Crate <a class="mod" href="">chrono</a></span></h1><div class="docblock"><h1 id="chrono-date-and-time-for-rust" class="section-header"><a href="#chrono-date-and-time-for-rust">Chrono: Date and Time for Rust</a></h1>
<p>It aims to be a feature-complete superset of
the <a href="https://github.com/rust-lang-deprecated/time">time</a> library.
In particular,</p>
<ul>
<li>Chrono strictly adheres to ISO 8601.</li>
<li>Chrono is timezone-aware by default, with separate timezone-naive types.</li>
<li>Chrono is space-optimal and (while not being the primary goal) reasonably efficient.</li>
</ul>
<p>There were several previous attempts to bring a good date and time library to Rust,
which Chrono builds upon and should acknowledge:</p>
<ul>
<li><a href="https://github.com/rust-lang/rust-wiki-backup/blob/master/Lib-datetime.md">Initial research on
the wiki</a></li>
<li>Dietrich Epp's <a href="https://github.com/depp/datetime-rs">datetime-rs</a></li>
<li>Luis de Bethencourt's <a href="https://github.com/luisbg/rust-datetime">rust-datetime</a></li>
</ul>
<p>Any significant changes to Chrono are documented in
the <a href="https://github.com/chronotope/chrono/blob/main/CHANGELOG.md"><code>CHANGELOG.md</code></a> file.</p>
<h2 id="usage" class="section-header"><a href="#usage">Usage</a></h2>
<p>Put this in your <code>Cargo.toml</code>:</p>
<pre><code class="language-toml">[dependencies]
chrono = &quot;0.4&quot;
</code></pre>
<h3 id="features" class="section-header"><a href="#features">Features</a></h3>
<p>Chrono supports various runtime environments and operating systems, and has
several features that may be enabled or disabled.</p>
<p>Default features:</p>
<ul>
<li><code>alloc</code>: Enable features that depend on allocation (primarily string formatting)</li>
<li><code>std</code>: Enables functionality that depends on the standard library. This
is a superset of <code>alloc</code> and adds interoperation with standard library types
and traits.</li>
<li><code>clock</code>: enables reading the system time (<code>now</code>), independent of whether
<code>std::time::SystemTime</code> is present, depends on having a libc.</li>
</ul>
<p>Optional features:</p>
<ul>
<li><code>wasmbind</code>: Enable integration with <a href="https://github.com/rustwasm/wasm-bindgen">wasm-bindgen</a> and its <code>js-sys</code> project</li>
<li><a href="https://github.com/serde-rs/serde"><code>serde</code></a>: Enable serialization/deserialization via serde.</li>
<li><code>unstable-locales</code>: Enable localization. This adds various methods with a
<code>_localized</code> suffix. The implementation and API may change or even be
removed in a patch release. Feedback welcome.</li>
</ul>
<p>See the <a href="https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#choosing-features">cargo docs</a> for examples of specifying features.</p>
<h2 id="overview" class="section-header"><a href="#overview">Overview</a></h2><h3 id="duration" class="section-header"><a href="#duration">Duration</a></h3>
<p>Chrono currently uses its own <a href="../chrono/struct.Duration.html" title="Duration"><code>Duration</code></a> type to represent the magnitude
of a time span. Since this has the same name as the newer, standard type for
duration, the reference will refer this type as <code>OldDuration</code>.</p>
<p>Note that this is an &quot;accurate&quot; duration represented as seconds and
nanoseconds and does not represent &quot;nominal&quot; components such as days or
months.</p>
<p>When the <code>oldtime</code> feature is enabled, <a href="../chrono/struct.Duration.html" title="Duration"><code>Duration</code></a> is an alias for the
<a href="https://docs.rs/time/0.1.40/time/struct.Duration.html"><code>time::Duration</code></a>
type from v0.1 of the time crate. time v0.1 is deprecated, so new code
should disable the <code>oldtime</code> feature and use the <code>chrono::Duration</code> type
instead. The <code>oldtime</code> feature is enabled by default for backwards
compatibility, but future versions of Chrono are likely to remove the
feature entirely.</p>
<p>Chrono does not yet natively support
the standard <a href="https://doc.rust-lang.org/std/time/struct.Duration.html"><code>Duration</code></a> type,
but it will be supported in the future.
Meanwhile you can convert between two types with
<a href="https://docs.rs/time/0.1.40/time/struct.Duration.html#method.from_std"><code>Duration::from_std</code></a>
and
<a href="https://docs.rs/time/0.1.40/time/struct.Duration.html#method.to_std"><code>Duration::to_std</code></a>
methods.</p>
<h3 id="date-and-time" class="section-header"><a href="#date-and-time">Date and Time</a></h3>
<p>Chrono provides a
<a href="./struct.DateTime.html"><strong><code>DateTime</code></strong></a>
type to represent a date and a time in a timezone.</p>
<p>For more abstract moment-in-time tracking such as internal timekeeping
that is unconcerned with timezones, consider
<a href="https://doc.rust-lang.org/std/time/struct.SystemTime.html"><code>time::SystemTime</code></a>,
which tracks your system clock, or
<a href="https://doc.rust-lang.org/std/time/struct.Instant.html"><code>time::Instant</code></a>, which
is an opaque but monotonically-increasing representation of a moment in time.</p>
<p><code>DateTime</code> is timezone-aware and must be constructed from
the <a href="./offset/trait.TimeZone.html"><strong><code>TimeZone</code></strong></a> object,
which defines how the local date is converted to and back from the UTC date.
There are three well-known <code>TimeZone</code> implementations:</p>
<ul>
<li>
<p><a href="./offset/struct.Utc.html"><strong><code>Utc</code></strong></a> specifies the UTC time zone. It is most efficient.</p>
</li>
<li>
<p><a href="./offset/struct.Local.html"><strong><code>Local</code></strong></a> specifies the system local time zone.</p>
</li>
<li>
<p><a href="./offset/struct.FixedOffset.html"><strong><code>FixedOffset</code></strong></a> specifies
an arbitrary, fixed time zone such as UTC+09:00 or UTC-10:30.
This often results from the parsed textual date and time.
Since it stores the most information and does not depend on the system environment,
you would want to normalize other <code>TimeZone</code>s into this type.</p>
</li>
</ul>
<p><code>DateTime</code>s with different <code>TimeZone</code> types are distinct and do not mix,
but can be converted to each other using
the <a href="./struct.DateTime.html#method.with_timezone"><code>DateTime::with_timezone</code></a> method.</p>
<p>You can get the current date and time in the UTC time zone
(<a href="./offset/struct.Utc.html#method.now"><code>Utc::now()</code></a>)
or in the local time zone
(<a href="./offset/struct.Local.html#method.now"><code>Local::now()</code></a>).</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>;
<span class="kw">let</span> <span class="ident">utc</span>: <span class="ident">DateTime</span><span class="op">&lt;</span><span class="ident">Utc</span><span class="op">&gt;</span> <span class="op">=</span> <span class="ident">Utc</span>::<span class="ident">now</span>(); <span class="comment">// e.g. `2014-11-28T12:45:59.324310806Z`</span>
<span class="kw">let</span> <span class="ident">local</span>: <span class="ident">DateTime</span><span class="op">&lt;</span><span class="ident">Local</span><span class="op">&gt;</span> <span class="op">=</span> <span class="ident">Local</span>::<span class="ident">now</span>(); <span class="comment">// e.g. `2014-11-28T21:45:59.324310806+09:00`</span></pre></div>
<p>Alternatively, you can create your own date and time.
This is a bit verbose due to Rust's lack of function and method overloading,
but in turn we get a rich combination of initialization methods.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>;
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">offset</span>::<span class="ident">LocalResult</span>;
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">Utc</span>.<span class="ident">ymd</span>(<span class="number">2014</span>, <span class="number">7</span>, <span class="number">8</span>).<span class="ident">and_hms</span>(<span class="number">9</span>, <span class="number">10</span>, <span class="number">11</span>); <span class="comment">// `2014-07-08T09:10:11Z`</span>
<span class="comment">// July 8 is 188th day of the year 2014 (`o` for &quot;ordinal&quot;)</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>, <span class="ident">Utc</span>.<span class="ident">yo</span>(<span class="number">2014</span>, <span class="number">189</span>).<span class="ident">and_hms</span>(<span class="number">9</span>, <span class="number">10</span>, <span class="number">11</span>));
<span class="comment">// July 8 is Tuesday in ISO week 28 of the year 2014.</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>, <span class="ident">Utc</span>.<span class="ident">isoywd</span>(<span class="number">2014</span>, <span class="number">28</span>, <span class="ident">Weekday</span>::<span class="ident">Tue</span>).<span class="ident">and_hms</span>(<span class="number">9</span>, <span class="number">10</span>, <span class="number">11</span>));
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">Utc</span>.<span class="ident">ymd</span>(<span class="number">2014</span>, <span class="number">7</span>, <span class="number">8</span>).<span class="ident">and_hms_milli</span>(<span class="number">9</span>, <span class="number">10</span>, <span class="number">11</span>, <span class="number">12</span>); <span class="comment">// `2014-07-08T09:10:11.012Z`</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>, <span class="ident">Utc</span>.<span class="ident">ymd</span>(<span class="number">2014</span>, <span class="number">7</span>, <span class="number">8</span>).<span class="ident">and_hms_micro</span>(<span class="number">9</span>, <span class="number">10</span>, <span class="number">11</span>, <span class="number">12_000</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>, <span class="ident">Utc</span>.<span class="ident">ymd</span>(<span class="number">2014</span>, <span class="number">7</span>, <span class="number">8</span>).<span class="ident">and_hms_nano</span>(<span class="number">9</span>, <span class="number">10</span>, <span class="number">11</span>, <span class="number">12_000_000</span>));
<span class="comment">// dynamic verification</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Utc</span>.<span class="ident">ymd_opt</span>(<span class="number">2014</span>, <span class="number">7</span>, <span class="number">8</span>).<span class="ident">and_hms_opt</span>(<span class="number">21</span>, <span class="number">15</span>, <span class="number">33</span>),
<span class="ident">LocalResult</span>::<span class="ident">Single</span>(<span class="ident">Utc</span>.<span class="ident">ymd</span>(<span class="number">2014</span>, <span class="number">7</span>, <span class="number">8</span>).<span class="ident">and_hms</span>(<span class="number">21</span>, <span class="number">15</span>, <span class="number">33</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Utc</span>.<span class="ident">ymd_opt</span>(<span class="number">2014</span>, <span class="number">7</span>, <span class="number">8</span>).<span class="ident">and_hms_opt</span>(<span class="number">80</span>, <span class="number">15</span>, <span class="number">33</span>), <span class="ident">LocalResult</span>::<span class="prelude-val">None</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Utc</span>.<span class="ident">ymd_opt</span>(<span class="number">2014</span>, <span class="number">7</span>, <span class="number">38</span>).<span class="ident">and_hms_opt</span>(<span class="number">21</span>, <span class="number">15</span>, <span class="number">33</span>), <span class="ident">LocalResult</span>::<span class="prelude-val">None</span>);
<span class="comment">// other time zone objects can be used to construct a local datetime.</span>
<span class="comment">// obviously, `local_dt` is normally different from `dt`, but `fixed_dt` should be identical.</span>
<span class="kw">let</span> <span class="ident">local_dt</span> <span class="op">=</span> <span class="ident">Local</span>.<span class="ident">ymd</span>(<span class="number">2014</span>, <span class="number">7</span>, <span class="number">8</span>).<span class="ident">and_hms_milli</span>(<span class="number">9</span>, <span class="number">10</span>, <span class="number">11</span>, <span class="number">12</span>);
<span class="kw">let</span> <span class="ident">fixed_dt</span> <span class="op">=</span> <span class="ident">FixedOffset</span>::<span class="ident">east</span>(<span class="number">9</span> <span class="op">*</span> <span class="number">3600</span>).<span class="ident">ymd</span>(<span class="number">2014</span>, <span class="number">7</span>, <span class="number">8</span>).<span class="ident">and_hms_milli</span>(<span class="number">18</span>, <span class="number">10</span>, <span class="number">11</span>, <span class="number">12</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>, <span class="ident">fixed_dt</span>);</pre></div>
<p>Various properties are available to the date and time, and can be altered individually.
Most of them are defined in the traits <a href="./trait.Datelike.html"><code>Datelike</code></a> and
<a href="./trait.Timelike.html"><code>Timelike</code></a> which you should <code>use</code> before.
Addition and subtraction is also supported.
The following illustrates most supported operations to the date and time:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>;
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">Duration</span>;
<span class="comment">// assume this returned `2014-11-28T21:45:59.324310806+09:00`:</span>
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">FixedOffset</span>::<span class="ident">east</span>(<span class="number">9</span><span class="kw-2">*</span><span class="number">3600</span>).<span class="ident">ymd</span>(<span class="number">2014</span>, <span class="number">11</span>, <span class="number">28</span>).<span class="ident">and_hms_nano</span>(<span class="number">21</span>, <span class="number">45</span>, <span class="number">59</span>, <span class="number">324310806</span>);
<span class="comment">// property accessors</span>
<span class="macro">assert_eq</span><span class="macro">!</span>((<span class="ident">dt</span>.<span class="ident">year</span>(), <span class="ident">dt</span>.<span class="ident">month</span>(), <span class="ident">dt</span>.<span class="ident">day</span>()), (<span class="number">2014</span>, <span class="number">11</span>, <span class="number">28</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>((<span class="ident">dt</span>.<span class="ident">month0</span>(), <span class="ident">dt</span>.<span class="ident">day0</span>()), (<span class="number">10</span>, <span class="number">27</span>)); <span class="comment">// for unfortunate souls</span>
<span class="macro">assert_eq</span><span class="macro">!</span>((<span class="ident">dt</span>.<span class="ident">hour</span>(), <span class="ident">dt</span>.<span class="ident">minute</span>(), <span class="ident">dt</span>.<span class="ident">second</span>()), (<span class="number">21</span>, <span class="number">45</span>, <span class="number">59</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">weekday</span>(), <span class="ident">Weekday</span>::<span class="ident">Fri</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">weekday</span>().<span class="ident">number_from_monday</span>(), <span class="number">5</span>); <span class="comment">// Mon=1, ..., Sun=7</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">ordinal</span>(), <span class="number">332</span>); <span class="comment">// the day of year</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">num_days_from_ce</span>(), <span class="number">735565</span>); <span class="comment">// the number of days from and including Jan 1, 1</span>
<span class="comment">// time zone accessor and manipulation</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">offset</span>().<span class="ident">fix</span>().<span class="ident">local_minus_utc</span>(), <span class="number">9</span> <span class="op">*</span> <span class="number">3600</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">timezone</span>(), <span class="ident">FixedOffset</span>::<span class="ident">east</span>(<span class="number">9</span> <span class="op">*</span> <span class="number">3600</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_timezone</span>(<span class="kw-2">&amp;</span><span class="ident">Utc</span>), <span class="ident">Utc</span>.<span class="ident">ymd</span>(<span class="number">2014</span>, <span class="number">11</span>, <span class="number">28</span>).<span class="ident">and_hms_nano</span>(<span class="number">12</span>, <span class="number">45</span>, <span class="number">59</span>, <span class="number">324310806</span>));
<span class="comment">// a sample of property manipulations (validates dynamically)</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_day</span>(<span class="number">29</span>).<span class="ident">unwrap</span>().<span class="ident">weekday</span>(), <span class="ident">Weekday</span>::<span class="ident">Sat</span>); <span class="comment">// 2014-11-29 is Saturday</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_day</span>(<span class="number">32</span>), <span class="prelude-val">None</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_year</span>(<span class="op">-</span><span class="number">300</span>).<span class="ident">unwrap</span>().<span class="ident">num_days_from_ce</span>(), <span class="op">-</span><span class="number">109606</span>); <span class="comment">// November 29, 301 BCE</span>
<span class="comment">// arithmetic operations</span>
<span class="kw">let</span> <span class="ident">dt1</span> <span class="op">=</span> <span class="ident">Utc</span>.<span class="ident">ymd</span>(<span class="number">2014</span>, <span class="number">11</span>, <span class="number">14</span>).<span class="ident">and_hms</span>(<span class="number">8</span>, <span class="number">9</span>, <span class="number">10</span>);
<span class="kw">let</span> <span class="ident">dt2</span> <span class="op">=</span> <span class="ident">Utc</span>.<span class="ident">ymd</span>(<span class="number">2014</span>, <span class="number">11</span>, <span class="number">14</span>).<span class="ident">and_hms</span>(<span class="number">10</span>, <span class="number">9</span>, <span class="number">8</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt1</span>.<span class="ident">signed_duration_since</span>(<span class="ident">dt2</span>), <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="op">-</span><span class="number">2</span> <span class="op">*</span> <span class="number">3600</span> <span class="op">+</span> <span class="number">2</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt2</span>.<span class="ident">signed_duration_since</span>(<span class="ident">dt1</span>), <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">2</span> <span class="op">*</span> <span class="number">3600</span> <span class="op">-</span> <span class="number">2</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Utc</span>.<span class="ident">ymd</span>(<span class="number">1970</span>, <span class="number">1</span>, <span class="number">1</span>).<span class="ident">and_hms</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">1_000_000_000</span>),
<span class="ident">Utc</span>.<span class="ident">ymd</span>(<span class="number">2001</span>, <span class="number">9</span>, <span class="number">9</span>).<span class="ident">and_hms</span>(<span class="number">1</span>, <span class="number">46</span>, <span class="number">40</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Utc</span>.<span class="ident">ymd</span>(<span class="number">1970</span>, <span class="number">1</span>, <span class="number">1</span>).<span class="ident">and_hms</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">1_000_000_000</span>),
<span class="ident">Utc</span>.<span class="ident">ymd</span>(<span class="number">1938</span>, <span class="number">4</span>, <span class="number">24</span>).<span class="ident">and_hms</span>(<span class="number">22</span>, <span class="number">13</span>, <span class="number">20</span>));</pre></div>
<h3 id="formatting-and-parsing" class="section-header"><a href="#formatting-and-parsing">Formatting and Parsing</a></h3>
<p>Formatting is done via the <a href="./struct.DateTime.html#method.format"><code>format</code></a> method,
which format is equivalent to the familiar <code>strftime</code> format.</p>
<p>See <a href="./format/strftime/index.html#specifiers"><code>format::strftime</code></a>
documentation for full syntax and list of specifiers.</p>
<p>The default <code>to_string</code> method and <code>{:?}</code> specifier also give a reasonable representation.
Chrono also provides <a href="./struct.DateTime.html#method.to_rfc2822"><code>to_rfc2822</code></a> and
<a href="./struct.DateTime.html#method.to_rfc3339"><code>to_rfc3339</code></a> methods
for well-known formats.</p>
<p>Chrono now also provides date formatting in almost any language without the
help of an additional C library. This functionality is under the feature
<code>unstable-locales</code>:</p>
<pre><code class="language-text">chrono { version = &quot;0.4&quot;, features = [&quot;unstable-locales&quot;]
</code></pre>
<p>The <code>unstable-locales</code> feature requires and implies at least the <code>alloc</code> feature.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>;
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">Utc</span>.<span class="ident">ymd</span>(<span class="number">2014</span>, <span class="number">11</span>, <span class="number">28</span>).<span class="ident">and_hms</span>(<span class="number">12</span>, <span class="number">0</span>, <span class="number">9</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">format</span>(<span class="string">&quot;%Y-%m-%d %H:%M:%S&quot;</span>).<span class="ident">to_string</span>(), <span class="string">&quot;2014-11-28 12:00:09&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">format</span>(<span class="string">&quot;%a %b %e %T %Y&quot;</span>).<span class="ident">to_string</span>(), <span class="string">&quot;Fri Nov 28 12:00:09 2014&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">format_localized</span>(<span class="string">&quot;%A %e %B %Y, %T&quot;</span>, <span class="ident">Locale</span>::<span class="ident">fr_BE</span>).<span class="ident">to_string</span>(), <span class="string">&quot;vendredi 28 novembre 2014, 12:00:09&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">format</span>(<span class="string">&quot;%a %b %e %T %Y&quot;</span>).<span class="ident">to_string</span>(), <span class="ident">dt</span>.<span class="ident">format</span>(<span class="string">&quot;%c&quot;</span>).<span class="ident">to_string</span>());
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">to_string</span>(), <span class="string">&quot;2014-11-28 12:00:09 UTC&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">to_rfc2822</span>(), <span class="string">&quot;Fri, 28 Nov 2014 12:00:09 +0000&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">to_rfc3339</span>(), <span class="string">&quot;2014-11-28T12:00:09+00:00&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">dt</span>), <span class="string">&quot;2014-11-28T12:00:09Z&quot;</span>);
<span class="comment">// Note that milli/nanoseconds are only printed if they are non-zero</span>
<span class="kw">let</span> <span class="ident">dt_nano</span> <span class="op">=</span> <span class="ident">Utc</span>.<span class="ident">ymd</span>(<span class="number">2014</span>, <span class="number">11</span>, <span class="number">28</span>).<span class="ident">and_hms_nano</span>(<span class="number">12</span>, <span class="number">0</span>, <span class="number">9</span>, <span class="number">1</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">dt_nano</span>), <span class="string">&quot;2014-11-28T12:00:09.000000001Z&quot;</span>);</pre></div>
<p>Parsing can be done with three methods:</p>
<ol>
<li>
<p>The standard <a href="https://doc.rust-lang.org/std/str/trait.FromStr.html"><code>FromStr</code></a> trait
(and <a href="https://doc.rust-lang.org/std/primitive.str.html#method.parse"><code>parse</code></a> method
on a string) can be used for parsing <code>DateTime&lt;FixedOffset&gt;</code>, <code>DateTime&lt;Utc&gt;</code> and
<code>DateTime&lt;Local&gt;</code> values. This parses what the <code>{:?}</code>
(<a href="https://doc.rust-lang.org/std/fmt/trait.Debug.html"><code>std::fmt::Debug</code></a>)
format specifier prints, and requires the offset to be present.</p>
</li>
<li>
<p><a href="./struct.DateTime.html#method.parse_from_str"><code>DateTime::parse_from_str</code></a> parses
a date and time with offsets and returns <code>DateTime&lt;FixedOffset&gt;</code>.
This should be used when the offset is a part of input and the caller cannot guess that.
It <em>cannot</em> be used when the offset can be missing.
<a href="./struct.DateTime.html#method.parse_from_rfc2822"><code>DateTime::parse_from_rfc2822</code></a>
and
<a href="./struct.DateTime.html#method.parse_from_rfc3339"><code>DateTime::parse_from_rfc3339</code></a>
are similar but for well-known formats.</p>
</li>
<li>
<p><a href="./offset/trait.TimeZone.html#method.datetime_from_str"><code>Offset::datetime_from_str</code></a> is
similar but returns <code>DateTime</code> of given offset.
When the explicit offset is missing from the input, it simply uses given offset.
It issues an error when the input contains an explicit offset different
from the current offset.</p>
</li>
</ol>
<p>More detailed control over the parsing process is available via
<a href="./format/index.html"><code>format</code></a> module.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>;
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">Utc</span>.<span class="ident">ymd</span>(<span class="number">2014</span>, <span class="number">11</span>, <span class="number">28</span>).<span class="ident">and_hms</span>(<span class="number">12</span>, <span class="number">0</span>, <span class="number">9</span>);
<span class="kw">let</span> <span class="ident">fixed_dt</span> <span class="op">=</span> <span class="ident">dt</span>.<span class="ident">with_timezone</span>(<span class="kw-2">&amp;</span><span class="ident">FixedOffset</span>::<span class="ident">east</span>(<span class="number">9</span><span class="kw-2">*</span><span class="number">3600</span>));
<span class="comment">// method 1</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">&quot;2014-11-28T12:00:09Z&quot;</span>.<span class="ident">parse</span>::<span class="op">&lt;</span><span class="ident">DateTime</span><span class="op">&lt;</span><span class="ident">Utc</span><span class="op">&gt;</span><span class="op">&gt;</span>(), <span class="prelude-val">Ok</span>(<span class="ident">dt</span>.<span class="ident">clone</span>()));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">&quot;2014-11-28T21:00:09+09:00&quot;</span>.<span class="ident">parse</span>::<span class="op">&lt;</span><span class="ident">DateTime</span><span class="op">&lt;</span><span class="ident">Utc</span><span class="op">&gt;</span><span class="op">&gt;</span>(), <span class="prelude-val">Ok</span>(<span class="ident">dt</span>.<span class="ident">clone</span>()));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">&quot;2014-11-28T21:00:09+09:00&quot;</span>.<span class="ident">parse</span>::<span class="op">&lt;</span><span class="ident">DateTime</span><span class="op">&lt;</span><span class="ident">FixedOffset</span><span class="op">&gt;</span><span class="op">&gt;</span>(), <span class="prelude-val">Ok</span>(<span class="ident">fixed_dt</span>.<span class="ident">clone</span>()));
<span class="comment">// method 2</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">DateTime</span>::<span class="ident">parse_from_str</span>(<span class="string">&quot;2014-11-28 21:00:09 +09:00&quot;</span>, <span class="string">&quot;%Y-%m-%d %H:%M:%S %z&quot;</span>),
<span class="prelude-val">Ok</span>(<span class="ident">fixed_dt</span>.<span class="ident">clone</span>()));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">DateTime</span>::<span class="ident">parse_from_rfc2822</span>(<span class="string">&quot;Fri, 28 Nov 2014 21:00:09 +0900&quot;</span>),
<span class="prelude-val">Ok</span>(<span class="ident">fixed_dt</span>.<span class="ident">clone</span>()));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">DateTime</span>::<span class="ident">parse_from_rfc3339</span>(<span class="string">&quot;2014-11-28T21:00:09+09:00&quot;</span>), <span class="prelude-val">Ok</span>(<span class="ident">fixed_dt</span>.<span class="ident">clone</span>()));
<span class="comment">// method 3</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Utc</span>.<span class="ident">datetime_from_str</span>(<span class="string">&quot;2014-11-28 12:00:09&quot;</span>, <span class="string">&quot;%Y-%m-%d %H:%M:%S&quot;</span>), <span class="prelude-val">Ok</span>(<span class="ident">dt</span>.<span class="ident">clone</span>()));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Utc</span>.<span class="ident">datetime_from_str</span>(<span class="string">&quot;Fri Nov 28 12:00:09 2014&quot;</span>, <span class="string">&quot;%a %b %e %T %Y&quot;</span>), <span class="prelude-val">Ok</span>(<span class="ident">dt</span>.<span class="ident">clone</span>()));
<span class="comment">// oops, the year is missing!</span>
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">Utc</span>.<span class="ident">datetime_from_str</span>(<span class="string">&quot;Fri Nov 28 12:00:09&quot;</span>, <span class="string">&quot;%a %b %e %T %Y&quot;</span>).<span class="ident">is_err</span>());
<span class="comment">// oops, the format string does not include the year at all!</span>
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">Utc</span>.<span class="ident">datetime_from_str</span>(<span class="string">&quot;Fri Nov 28 12:00:09&quot;</span>, <span class="string">&quot;%a %b %e %T&quot;</span>).<span class="ident">is_err</span>());
<span class="comment">// oops, the weekday is incorrect!</span>
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">Utc</span>.<span class="ident">datetime_from_str</span>(<span class="string">&quot;Sat Nov 28 12:00:09 2014&quot;</span>, <span class="string">&quot;%a %b %e %T %Y&quot;</span>).<span class="ident">is_err</span>());</pre></div>
<p>Again : See <a href="./format/strftime/index.html#specifiers"><code>format::strftime</code></a>
documentation for full syntax and list of specifiers.</p>
<h3 id="conversion-from-and-to-epoch-timestamps" class="section-header"><a href="#conversion-from-and-to-epoch-timestamps">Conversion from and to EPOCH timestamps</a></h3>
<p>Use <a href="./offset/trait.TimeZone.html#method.timestamp"><code>Utc.timestamp(seconds, nanoseconds)</code></a>
to construct a <a href="./struct.DateTime.html"><code>DateTime&lt;Utc&gt;</code></a> from a UNIX timestamp
(seconds, nanoseconds that passed since January 1st 1970).</p>
<p>Use <a href="./struct.DateTime.html#method.timestamp"><code>DateTime.timestamp</code></a> to get the timestamp (in seconds)
from a <a href="./struct.DateTime.html"><code>DateTime</code></a>. Additionally, you can use
<a href="./struct.DateTime.html#method.timestamp_subsec_nanos"><code>DateTime.timestamp_subsec_nanos</code></a>
to get the number of additional number of nanoseconds.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="comment">// We need the trait in scope to use Utc::timestamp().</span>
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">DateTime</span>, <span class="ident">TimeZone</span>, <span class="ident">Utc</span>};
<span class="comment">// Construct a datetime from epoch:</span>
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">Utc</span>.<span class="ident">timestamp</span>(<span class="number">1_500_000_000</span>, <span class="number">0</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">to_rfc2822</span>(), <span class="string">&quot;Fri, 14 Jul 2017 02:40:00 +0000&quot;</span>);
<span class="comment">// Get epoch value from a datetime:</span>
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">DateTime</span>::<span class="ident">parse_from_rfc2822</span>(<span class="string">&quot;Fri, 14 Jul 2017 02:40:00 +0000&quot;</span>).<span class="ident">unwrap</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">timestamp</span>(), <span class="number">1_500_000_000</span>);</pre></div>
<h3 id="individual-date" class="section-header"><a href="#individual-date">Individual date</a></h3>
<p>Chrono also provides an individual date type (<a href="./struct.Date.html"><strong><code>Date</code></strong></a>).
It also has time zones attached, and have to be constructed via time zones.
Most operations available to <code>DateTime</code> are also available to <code>Date</code> whenever appropriate.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>;
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">offset</span>::<span class="ident">LocalResult</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Utc</span>::<span class="ident">today</span>(), <span class="ident">Utc</span>::<span class="ident">now</span>().<span class="ident">date</span>());
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Local</span>::<span class="ident">today</span>(), <span class="ident">Local</span>::<span class="ident">now</span>().<span class="ident">date</span>());
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Utc</span>.<span class="ident">ymd</span>(<span class="number">2014</span>, <span class="number">11</span>, <span class="number">28</span>).<span class="ident">weekday</span>(), <span class="ident">Weekday</span>::<span class="ident">Fri</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Utc</span>.<span class="ident">ymd_opt</span>(<span class="number">2014</span>, <span class="number">11</span>, <span class="number">31</span>), <span class="ident">LocalResult</span>::<span class="prelude-val">None</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Utc</span>.<span class="ident">ymd</span>(<span class="number">2014</span>, <span class="number">11</span>, <span class="number">28</span>).<span class="ident">and_hms_milli</span>(<span class="number">7</span>, <span class="number">8</span>, <span class="number">9</span>, <span class="number">10</span>).<span class="ident">format</span>(<span class="string">&quot;%H%M%S&quot;</span>).<span class="ident">to_string</span>(),
<span class="string">&quot;070809&quot;</span>);</pre></div>
<p>There is no timezone-aware <code>Time</code> due to the lack of usefulness and also the complexity.</p>
<p><code>DateTime</code> has <a href="./struct.DateTime.html#method.date"><code>date</code></a> method
which returns a <code>Date</code> which represents its date component.
There is also a <a href="./struct.DateTime.html#method.time"><code>time</code></a> method,
which simply returns a naive local time described below.</p>
<h3 id="naive-date-and-time" class="section-header"><a href="#naive-date-and-time">Naive date and time</a></h3>
<p>Chrono provides naive counterparts to <code>Date</code>, (non-existent) <code>Time</code> and <code>DateTime</code>
as <a href="./naive/struct.NaiveDate.html"><strong><code>NaiveDate</code></strong></a>,
<a href="./naive/struct.NaiveTime.html"><strong><code>NaiveTime</code></strong></a> and
<a href="./naive/struct.NaiveDateTime.html"><strong><code>NaiveDateTime</code></strong></a> respectively.</p>
<p>They have almost equivalent interfaces as their timezone-aware twins,
but are not associated to time zones obviously and can be quite low-level.
They are mostly useful for building blocks for higher-level types.</p>
<p>Timezone-aware <code>DateTime</code> and <code>Date</code> types have two methods returning naive versions:
<a href="./struct.DateTime.html#method.naive_local"><code>naive_local</code></a> returns
a view to the naive local time,
and <a href="./struct.DateTime.html#method.naive_utc"><code>naive_utc</code></a> returns
a view to the naive UTC time.</p>
<h2 id="limitations" class="section-header"><a href="#limitations">Limitations</a></h2>
<p>Only proleptic Gregorian calendar (i.e. extended to support older dates) is supported.
Be very careful if you really have to deal with pre-20C dates, they can be in Julian or others.</p>
<p>Date types are limited in about +/- 262,000 years from the common epoch.
Time types are limited in the nanosecond accuracy.</p>
<p><a href="./naive/struct.NaiveTime.html#leap-second-handling">Leap seconds are supported in the representation but
Chrono doesn't try to make use of them</a>.
(The main reason is that leap seconds are not really predictable.)
Almost <em>every</em> operation over the possible leap seconds will ignore them.
Consider using <code>NaiveDateTime</code> with the implicit TAI (International Atomic Time) scale
if you want.</p>
<p>Chrono inherently does not support an inaccurate or partial date and time representation.
Any operation that can be ambiguous will return <code>None</code> in such cases.
For example, &quot;a month later&quot; of 2014-01-30 is not well-defined
and consequently <code>Utc.ymd(2014, 1, 30).with_month(2)</code> returns <code>None</code>.</p>
<p>Non ISO week handling is not yet supported.
For now you can use the <a href="https://crates.io/crates/chrono_ext">chrono_ext</a>
crate (<a href="https://github.com/bcourtine/chrono-ext/">sources</a>).</p>
<p>Advanced time zone handling is not yet supported.
For now you can try the <a href="https://github.com/chronotope/chrono-tz/">Chrono-tz</a> crate instead.</p>
</div><h2 id="reexports" class="section-header"><a href="#reexports">Re-exports</a></h2>
<table><tr><td><code>pub use format::<a class="struct" href="../chrono/format/struct.ParseError.html" title="struct chrono::format::ParseError">ParseError</a>;</code></td></tr><tr><td><code>pub use format::<a class="type" href="../chrono/format/type.ParseResult.html" title="type chrono::format::ParseResult">ParseResult</a>;</code></td></tr><tr><td><code>pub use naive::<a class="struct" href="../chrono/naive/struct.IsoWeek.html" title="struct chrono::naive::IsoWeek">IsoWeek</a>;</code></td></tr><tr><td><code>pub use naive::<a class="struct" href="../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>;</code></td></tr><tr><td><code>pub use naive::<a class="struct" href="../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>;</code></td></tr><tr><td><code>pub use naive::<a class="struct" href="../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>;</code></td></tr><tr><td><code>pub use offset::<a class="struct" href="../chrono/offset/struct.Local.html" title="struct chrono::offset::Local">Local</a>;</code></td></tr><tr><td><code>pub use offset::<a class="struct" href="../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>;</code></td></tr><tr><td><code>pub use offset::<a class="enum" href="../chrono/offset/enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>;</code></td></tr><tr><td><code>pub use offset::<a class="trait" href="../chrono/offset/trait.Offset.html" title="trait chrono::offset::Offset">Offset</a>;</code></td></tr><tr><td><code>pub use offset::<a class="trait" href="../chrono/offset/trait.TimeZone.html" title="trait chrono::offset::TimeZone">TimeZone</a>;</code></td></tr><tr><td><code>pub use offset::<a class="struct" href="../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a>;</code></td></tr></table><h2 id="modules" class="section-header"><a href="#modules">Modules</a></h2>
<table><tr class="module-item"><td><a class="mod" href="format/index.html" title="chrono::format mod">format</a></td><td class="docblock-short"><p>Formatting (and parsing) utilities for date and time.</p>
</td></tr><tr class="module-item"><td><a class="mod" href="naive/index.html" title="chrono::naive mod">naive</a></td><td class="docblock-short"><p>Date and time types unconcerned with timezones.</p>
</td></tr><tr class="module-item"><td><a class="mod" href="offset/index.html" title="chrono::offset mod">offset</a></td><td class="docblock-short"><p>The time zone, which calculates offsets from the local time to UTC.</p>
</td></tr><tr class="module-item"><td><a class="mod" href="prelude/index.html" title="chrono::prelude mod">prelude</a></td><td class="docblock-short"><p>A convenience module appropriate for glob imports (<code>use chrono::prelude::*;</code>).</p>
</td></tr></table><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
<table><tr class="module-item"><td><a class="struct" href="struct.Date.html" title="chrono::Date struct">Date</a></td><td class="docblock-short"><p>ISO 8601 calendar date with time zone.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.DateTime.html" title="chrono::DateTime struct">DateTime</a></td><td class="docblock-short"><p>ISO 8601 combined date and time with time zone.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.Duration.html" title="chrono::Duration struct">Duration</a></td><td class="docblock-short"><p>ISO 8601 time duration with nanosecond precision.
This also allows for the negative duration; see individual methods for details.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.ParseMonthError.html" title="chrono::ParseMonthError struct">ParseMonthError</a></td><td class="docblock-short"><p>An error resulting from reading <code>&lt;Month&gt;</code> value with <code>FromStr</code>.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.ParseWeekdayError.html" title="chrono::ParseWeekdayError struct">ParseWeekdayError</a></td><td class="docblock-short"><p>An error resulting from reading <code>Weekday</code> value with <code>FromStr</code>.</p>
</td></tr></table><h2 id="enums" class="section-header"><a href="#enums">Enums</a></h2>
<table><tr class="module-item"><td><a class="enum" href="enum.Month.html" title="chrono::Month enum">Month</a></td><td class="docblock-short"><p>The month of the year.</p>
</td></tr><tr class="module-item"><td><a class="enum" href="enum.RoundingError.html" title="chrono::RoundingError enum">RoundingError</a></td><td class="docblock-short"><p>An error from rounding by <code>Duration</code></p>
</td></tr><tr class="module-item"><td><a class="enum" href="enum.SecondsFormat.html" title="chrono::SecondsFormat enum">SecondsFormat</a></td><td class="docblock-short"><p>Specific formatting options for seconds. This may be extended in the
future, so exhaustive matching in external code is not recommended.</p>
</td></tr><tr class="module-item"><td><a class="enum" href="enum.Weekday.html" title="chrono::Weekday enum">Weekday</a></td><td class="docblock-short"><p>The day of week.</p>
</td></tr></table><h2 id="constants" class="section-header"><a href="#constants">Constants</a></h2>
<table><tr class="module-item"><td><a class="constant" href="constant.MAX_DATE.html" title="chrono::MAX_DATE constant">MAX_DATE</a></td><td class="docblock-short"><p>The maximum possible <code>Date</code>.</p>
</td></tr><tr class="module-item"><td><a class="constant" href="constant.MAX_DATETIME.html" title="chrono::MAX_DATETIME constant">MAX_DATETIME</a></td><td class="docblock-short"><p>The maximum possible <code>DateTime&lt;Utc&gt;</code>.</p>
</td></tr><tr class="module-item"><td><a class="constant" href="constant.MIN_DATE.html" title="chrono::MIN_DATE constant">MIN_DATE</a></td><td class="docblock-short"><p>The minimum possible <code>Date</code>.</p>
</td></tr><tr class="module-item"><td><a class="constant" href="constant.MIN_DATETIME.html" title="chrono::MIN_DATETIME constant">MIN_DATETIME</a></td><td class="docblock-short"><p>The minimum possible <code>DateTime&lt;Utc&gt;</code>.</p>
</td></tr></table><h2 id="traits" class="section-header"><a href="#traits">Traits</a></h2>
<table><tr class="module-item"><td><a class="trait" href="trait.Datelike.html" title="chrono::Datelike trait">Datelike</a></td><td class="docblock-short"><p>The common set of methods for date component.</p>
</td></tr><tr class="module-item"><td><a class="trait" href="trait.DurationRound.html" title="chrono::DurationRound trait">DurationRound</a></td><td class="docblock-short"><p>Extension trait for rounding or truncating a DateTime by a Duration.</p>
</td></tr><tr class="module-item"><td><a class="trait" href="trait.SubsecRound.html" title="chrono::SubsecRound trait">SubsecRound</a></td><td class="docblock-short"><p>Extension trait for subsecond rounding or truncation to a maximum number
of digits. Rounding can be used to decrease the error variance when
serializing/persisting to lower precision. Truncation is the default
behavior in Chrono display formatting. Either can be used to guarantee
equality (e.g. for testing) when round-tripping through a lower precision
format.</p>
</td></tr><tr class="module-item"><td><a class="trait" href="trait.Timelike.html" title="chrono::Timelike trait">Timelike</a></td><td class="docblock-short"><p>The common set of methods for time component.</p>
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "chrono";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
-5
View File
@@ -1,5 +0,0 @@
<!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 `MAX_DATE` constant in crate `chrono`."><meta name="keywords" content="rust, rustlang, rust-lang, MAX_DATE"><title>chrono::naive::MAX_DATE - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[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">&#9776;</div><a href='../../chrono/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../index.html">chrono</a>::<wbr><a href="index.html">naive</a></p><script>window.sidebarCurrent = {name: "MAX_DATE", ty: "constant", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../../src/chrono/naive/date.rs.html#106" title="goto source code">[src]</a></span><span class="in-band">Constant <a href="../index.html">chrono</a>::<wbr><a href="index.html">naive</a>::<wbr><a class="constant" href="">MAX_DATE</a></span></h1><pre class="rust const">pub const MAX_DATE: <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>;</pre><div class="docblock"><p>The maximum possible <code>NaiveDate</code> (December 31, 262143 CE).</p>
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "chrono";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
@@ -1,5 +0,0 @@
<!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 `MAX_DATETIME` constant in crate `chrono`."><meta name="keywords" content="rust, rustlang, rust-lang, MAX_DATETIME"><title>chrono::naive::MAX_DATETIME - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[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">&#9776;</div><a href='../../chrono/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../index.html">chrono</a>::<wbr><a href="index.html">naive</a></p><script>window.sidebarCurrent = {name: "MAX_DATETIME", ty: "constant", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#34" title="goto source code">[src]</a></span><span class="in-band">Constant <a href="../index.html">chrono</a>::<wbr><a href="index.html">naive</a>::<wbr><a class="constant" href="">MAX_DATETIME</a></span></h1><pre class="rust const">pub const MAX_DATETIME: <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>;</pre><div class="docblock"><p>The maximum possible <code>NaiveDateTime</code>.</p>
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "chrono";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
-5
View File
@@ -1,5 +0,0 @@
<!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 `MIN_DATE` constant in crate `chrono`."><meta name="keywords" content="rust, rustlang, rust-lang, MIN_DATE"><title>chrono::naive::MIN_DATE - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[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">&#9776;</div><a href='../../chrono/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../index.html">chrono</a>::<wbr><a href="index.html">naive</a></p><script>window.sidebarCurrent = {name: "MIN_DATE", ty: "constant", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../../src/chrono/naive/date.rs.html#104" title="goto source code">[src]</a></span><span class="in-band">Constant <a href="../index.html">chrono</a>::<wbr><a href="index.html">naive</a>::<wbr><a class="constant" href="">MIN_DATE</a></span></h1><pre class="rust const">pub const MIN_DATE: <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>;</pre><div class="docblock"><p>The minimum possible <code>NaiveDate</code> (January 1, 262145 BCE).</p>
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "chrono";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
@@ -1,5 +0,0 @@
<!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 `MIN_DATETIME` constant in crate `chrono`."><meta name="keywords" content="rust, rustlang, rust-lang, MIN_DATETIME"><title>chrono::naive::MIN_DATETIME - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[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">&#9776;</div><a href='../../chrono/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../index.html">chrono</a>::<wbr><a href="index.html">naive</a></p><script>window.sidebarCurrent = {name: "MIN_DATETIME", ty: "constant", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#32" title="goto source code">[src]</a></span><span class="in-band">Constant <a href="../index.html">chrono</a>::<wbr><a href="index.html">naive</a>::<wbr><a class="constant" href="">MIN_DATETIME</a></span></h1><pre class="rust const">pub const MIN_DATETIME: <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>;</pre><div class="docblock"><p>The minimum possible <code>NaiveDateTime</code>.</p>
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "chrono";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
@@ -1,10 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../chrono/naive/constant.MAX_DATE.html">
</head>
<body>
<p>Redirecting to <a href="../../../chrono/naive/constant.MAX_DATE.html">../../../chrono/naive/constant.MAX_DATE.html</a>...</p>
<script>location.replace("../../../chrono/naive/constant.MAX_DATE.html" + location.search + location.hash);</script>
</body>
</html>
@@ -1,10 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../chrono/naive/constant.MIN_DATE.html">
</head>
<body>
<p>Redirecting to <a href="../../../chrono/naive/constant.MIN_DATE.html">../../../chrono/naive/constant.MIN_DATE.html</a>...</p>
<script>location.replace("../../../chrono/naive/constant.MIN_DATE.html" + location.search + location.hash);</script>
</body>
</html>
@@ -1,10 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../chrono/naive/struct.NaiveDate.html">
</head>
<body>
<p>Redirecting to <a href="../../../chrono/naive/struct.NaiveDate.html">../../../chrono/naive/struct.NaiveDate.html</a>...</p>
<script>location.replace("../../../chrono/naive/struct.NaiveDate.html" + location.search + location.hash);</script>
</body>
</html>
@@ -1,10 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../chrono/naive/constant.MAX_DATETIME.html">
</head>
<body>
<p>Redirecting to <a href="../../../chrono/naive/constant.MAX_DATETIME.html">../../../chrono/naive/constant.MAX_DATETIME.html</a>...</p>
<script>location.replace("../../../chrono/naive/constant.MAX_DATETIME.html" + location.search + location.hash);</script>
</body>
</html>
@@ -1,10 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../chrono/naive/constant.MIN_DATETIME.html">
</head>
<body>
<p>Redirecting to <a href="../../../chrono/naive/constant.MIN_DATETIME.html">../../../chrono/naive/constant.MIN_DATETIME.html</a>...</p>
<script>location.replace("../../../chrono/naive/constant.MIN_DATETIME.html" + location.search + location.hash);</script>
</body>
</html>
@@ -1,10 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../chrono/naive/struct.NaiveDateTime.html">
</head>
<body>
<p>Redirecting to <a href="../../../chrono/naive/struct.NaiveDateTime.html">../../../chrono/naive/struct.NaiveDateTime.html</a>...</p>
<script>location.replace("../../../chrono/naive/struct.NaiveDateTime.html" + location.search + location.hash);</script>
</body>
</html>
-22
View File
@@ -1,22 +0,0 @@
<!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 `naive` mod in crate `chrono`."><meta name="keywords" content="rust, rustlang, rust-lang, naive"><title>chrono::naive - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[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">&#9776;</div><a href='../../chrono/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Module naive</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#constants">Constants</a></li></ul></div><p class="location"><a href="../index.html">chrono</a></p><script>window.sidebarCurrent = {name: "naive", ty: "mod", relpath: "../"};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../../src/chrono/lib.rs.html#541-578" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../index.html">chrono</a>::<wbr><a class="mod" href="">naive</a></span></h1><div class="docblock"><p>Date and time types unconcerned with timezones.</p>
<p>They are primarily building blocks for other types
(e.g. <a href="../offset/trait.TimeZone.html"><code>TimeZone</code></a>),
but can be also used for the simpler date and time handling.</p>
</div><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
<table><tr class="module-item"><td><a class="struct" href="struct.IsoWeek.html" title="chrono::naive::IsoWeek struct">IsoWeek</a></td><td class="docblock-short"><p>ISO 8601 week.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.NaiveDate.html" title="chrono::naive::NaiveDate struct">NaiveDate</a></td><td class="docblock-short"><p>ISO 8601 calendar date without timezone.
Allows for every <a href="#calendar-date">proleptic Gregorian date</a>
from Jan 1, 262145 BCE to Dec 31, 262143 CE.
Also supports the conversion from ISO 8601 ordinal and week date.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.NaiveDateTime.html" title="chrono::naive::NaiveDateTime struct">NaiveDateTime</a></td><td class="docblock-short"><p>ISO 8601 combined date and time without timezone.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.NaiveTime.html" title="chrono::naive::NaiveTime struct">NaiveTime</a></td><td class="docblock-short"><p>ISO 8601 time without timezone.
Allows for the nanosecond precision and optional leap second representation.</p>
</td></tr></table><h2 id="constants" class="section-header"><a href="#constants">Constants</a></h2>
<table><tr class="module-item"><td><a class="constant" href="constant.MAX_DATE.html" title="chrono::naive::MAX_DATE constant">MAX_DATE</a></td><td class="docblock-short"><p>The maximum possible <code>NaiveDate</code> (December 31, 262143 CE).</p>
</td></tr><tr class="module-item"><td><a class="constant" href="constant.MAX_DATETIME.html" title="chrono::naive::MAX_DATETIME constant">MAX_DATETIME</a></td><td class="docblock-short"><p>The maximum possible <code>NaiveDateTime</code>.</p>
</td></tr><tr class="module-item"><td><a class="constant" href="constant.MIN_DATE.html" title="chrono::naive::MIN_DATE constant">MIN_DATE</a></td><td class="docblock-short"><p>The minimum possible <code>NaiveDate</code> (January 1, 262145 BCE).</p>
</td></tr><tr class="module-item"><td><a class="constant" href="constant.MIN_DATETIME.html" title="chrono::naive::MIN_DATETIME constant">MIN_DATETIME</a></td><td class="docblock-short"><p>The minimum possible <code>NaiveDateTime</code>.</p>
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "chrono";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
@@ -1,10 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../chrono/naive/struct.IsoWeek.html">
</head>
<body>
<p>Redirecting to <a href="../../../chrono/naive/struct.IsoWeek.html">../../../chrono/naive/struct.IsoWeek.html</a>...</p>
<script>location.replace("../../../chrono/naive/struct.IsoWeek.html" + location.search + location.hash);</script>
</body>
</html>
-1
View File
@@ -1 +0,0 @@
initSidebarItems({"constant":[["MAX_DATE","The maximum possible `NaiveDate` (December 31, 262143 CE)."],["MAX_DATETIME","The maximum possible `NaiveDateTime`."],["MIN_DATE","The minimum possible `NaiveDate` (January 1, 262145 BCE)."],["MIN_DATETIME","The minimum possible `NaiveDateTime`."]],"struct":[["IsoWeek","ISO 8601 week."],["NaiveDate","ISO 8601 calendar date without timezone. Allows for every proleptic Gregorian date from Jan 1, 262145 BCE to Dec 31, 262143 CE. Also supports the conversion from ISO 8601 ordinal and week date."],["NaiveDateTime","ISO 8601 combined date and time without timezone."],["NaiveTime","ISO 8601 time without timezone. Allows for the nanosecond precision and optional leap second representation."]]});
File diff suppressed because one or more lines are too long
-899
View File
@@ -1,899 +0,0 @@
<!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 `NaiveDate` struct in crate `chrono`."><meta name="keywords" content="rust, rustlang, rust-lang, NaiveDate"><title>chrono::naive::NaiveDate - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[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">&#9776;</div><a href='../../chrono/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Struct NaiveDate</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.and_hms">and_hms</a><a href="#method.and_hms_micro">and_hms_micro</a><a href="#method.and_hms_micro_opt">and_hms_micro_opt</a><a href="#method.and_hms_milli">and_hms_milli</a><a href="#method.and_hms_milli_opt">and_hms_milli_opt</a><a href="#method.and_hms_nano">and_hms_nano</a><a href="#method.and_hms_nano_opt">and_hms_nano_opt</a><a href="#method.and_hms_opt">and_hms_opt</a><a href="#method.and_time">and_time</a><a href="#method.checked_add_signed">checked_add_signed</a><a href="#method.checked_sub_signed">checked_sub_signed</a><a href="#method.format">format</a><a href="#method.format_with_items">format_with_items</a><a href="#method.from_isoywd">from_isoywd</a><a href="#method.from_isoywd_opt">from_isoywd_opt</a><a href="#method.from_num_days_from_ce">from_num_days_from_ce</a><a href="#method.from_num_days_from_ce_opt">from_num_days_from_ce_opt</a><a href="#method.from_weekday_of_month">from_weekday_of_month</a><a href="#method.from_weekday_of_month_opt">from_weekday_of_month_opt</a><a href="#method.from_ymd">from_ymd</a><a href="#method.from_ymd_opt">from_ymd_opt</a><a href="#method.from_yo">from_yo</a><a href="#method.from_yo_opt">from_yo_opt</a><a href="#method.iter_days">iter_days</a><a href="#method.iter_weeks">iter_weeks</a><a href="#method.parse_from_str">parse_from_str</a><a href="#method.pred">pred</a><a href="#method.pred_opt">pred_opt</a><a href="#method.signed_duration_since">signed_duration_since</a><a href="#method.succ">succ</a><a href="#method.succ_opt">succ_opt</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Add%3CDuration%3E">Add&lt;Duration&gt;</a><a href="#impl-AddAssign%3CDuration%3E">AddAssign&lt;Duration&gt;</a><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Datelike">Datelike</a><a href="#impl-Debug">Debug</a><a href="#impl-Display">Display</a><a href="#impl-Eq">Eq</a><a href="#impl-FromStr">FromStr</a><a href="#impl-Hash">Hash</a><a href="#impl-Ord">Ord</a><a href="#impl-PartialEq%3CNaiveDate%3E">PartialEq&lt;NaiveDate&gt;</a><a href="#impl-PartialOrd%3CNaiveDate%3E">PartialOrd&lt;NaiveDate&gt;</a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a><a href="#impl-Sub%3CDuration%3E">Sub&lt;Duration&gt;</a><a href="#impl-Sub%3CNaiveDate%3E">Sub&lt;NaiveDate&gt;</a><a href="#impl-SubAssign%3CDuration%3E">SubAssign&lt;Duration&gt;</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><p class="location"><a href="../index.html">chrono</a>::<wbr><a href="index.html">naive</a></p><script>window.sidebarCurrent = {name: "NaiveDate", ty: "struct", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../../src/chrono/naive/date.rs.html#99-101" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="../index.html">chrono</a>::<wbr><a href="index.html">naive</a>::<wbr><a class="struct" href="">NaiveDate</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct NaiveDate { /* fields omitted */ }</pre></div><div class="docblock"><p>ISO 8601 calendar date without timezone.
Allows for every <a href="#calendar-date">proleptic Gregorian date</a>
from Jan 1, 262145 BCE to Dec 31, 262143 CE.
Also supports the conversion from ISO 8601 ordinal and week date.</p>
<h1 id="calendar-date" class="section-header"><a href="#calendar-date">Calendar Date</a></h1>
<p>The ISO 8601 <strong>calendar date</strong> follows the proleptic Gregorian calendar.
It is like a normal civil calendar but note some slight differences:</p>
<ul>
<li>
<p>Dates before the Gregorian calendar's inception in 1582 are defined via the extrapolation.
Be careful, as historical dates are often noted in the Julian calendar and others
and the transition to Gregorian may differ across countries (as late as early 20C).</p>
<p>(Some example: Both Shakespeare from Britain and Cervantes from Spain seemingly died
on the same calendar date---April 23, 1616---but in the different calendar.
Britain used the Julian calendar at that time, so Shakespeare's death is later.)</p>
</li>
<li>
<p>ISO 8601 calendars has the year 0, which is 1 BCE (a year before 1 CE).
If you need a typical BCE/BC and CE/AD notation for year numbers,
use the <a href="../trait.Datelike.html#method.year_ce"><code>Datelike::year_ce</code></a> method.</p>
</li>
</ul>
<h1 id="week-date" class="section-header"><a href="#week-date">Week Date</a></h1>
<p>The ISO 8601 <strong>week date</strong> is a triple of year number, week number
and <a href="../enum.Weekday.html">day of the week</a> with the following rules:</p>
<ul>
<li>
<p>A week consists of Monday through Sunday, and is always numbered within some year.
The week number ranges from 1 to 52 or 53 depending on the year.</p>
</li>
<li>
<p>The week 1 of given year is defined as the first week containing January 4 of that year,
or equivalently, the first week containing four or more days in that year.</p>
</li>
<li>
<p>The year number in the week date may <em>not</em> correspond to the actual Gregorian year.
For example, January 3, 2016 (Sunday) was on the last (53rd) week of 2015.</p>
</li>
</ul>
<p>Chrono's date types default to the ISO 8601 <a href="#calendar-date">calendar date</a>,
but <a href="../trait.Datelike.html#tymethod.iso_week"><code>Datelike::iso_week</code></a> and
<a href="../trait.Datelike.html#tymethod.weekday"><code>Datelike::weekday</code></a> methods
can be used to get the corresponding week date.</p>
<h1 id="ordinal-date" class="section-header"><a href="#ordinal-date">Ordinal Date</a></h1>
<p>The ISO 8601 <strong>ordinal date</strong> is a pair of year number and day of the year (&quot;ordinal&quot;).
The ordinal number ranges from 1 to 365 or 366 depending on the year.
The year number is the same as that of the <a href="#calendar-date">calendar date</a>.</p>
<p>This is currently the internal format of Chrono's date types.</p>
</div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/date.rs.html#136-1100" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from_ymd" class="method"><code>pub fn <a href="#method.from_ymd" class="fnname">from_ymd</a>(year: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, month: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, day: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#172-174" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDate</code> from the <a href="#calendar-date">calendar date</a>
(year, month and day).</p>
<p>Panics on the out-of-range date, invalid month and/or day.</p>
<h1 id="example" class="section-header"><a href="#example">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">Datelike</span>, <span class="ident">Weekday</span>};
<span class="kw">let</span> <span class="ident">d</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">3</span>, <span class="number">14</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">year</span>(), <span class="number">2015</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">month</span>(), <span class="number">3</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">day</span>(), <span class="number">14</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">ordinal</span>(), <span class="number">73</span>); <span class="comment">// day of year</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">iso_week</span>().<span class="ident">year</span>(), <span class="number">2015</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">iso_week</span>().<span class="ident">week</span>(), <span class="number">11</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">weekday</span>(), <span class="ident">Weekday</span>::<span class="ident">Sat</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">num_days_from_ce</span>(), <span class="number">735671</span>); <span class="comment">// days since January 1, 1 CE</span></pre></div>
</div><h4 id="method.from_ymd_opt" class="method"><code>pub fn <a href="#method.from_ymd_opt" class="fnname">from_ymd_opt</a>(year: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, month: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, day: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/date.rs.html#195-198" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDate</code> from the <a href="#calendar-date">calendar date</a>
(year, month and day).</p>
<p>Returns <code>None</code> on the out-of-range date, invalid month and/or day.</p>
<h1 id="example-1" class="section-header"><a href="#example-1">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveDate</span>;
<span class="kw">let</span> <span class="ident">from_ymd_opt</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd_opt</span>;
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_ymd_opt</span>(<span class="number">2015</span>, <span class="number">3</span>, <span class="number">14</span>).<span class="ident">is_some</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_ymd_opt</span>(<span class="number">2015</span>, <span class="number">0</span>, <span class="number">14</span>).<span class="ident">is_none</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_ymd_opt</span>(<span class="number">2015</span>, <span class="number">2</span>, <span class="number">29</span>).<span class="ident">is_none</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_ymd_opt</span>(<span class="op">-</span><span class="number">4</span>, <span class="number">2</span>, <span class="number">29</span>).<span class="ident">is_some</span>()); <span class="comment">// 5 BCE is a leap year</span>
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_ymd_opt</span>(<span class="number">400000</span>, <span class="number">1</span>, <span class="number">1</span>).<span class="ident">is_none</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_ymd_opt</span>(<span class="op">-</span><span class="number">400000</span>, <span class="number">1</span>, <span class="number">1</span>).<span class="ident">is_none</span>());</pre></div>
</div><h4 id="method.from_yo" class="method"><code>pub fn <a href="#method.from_yo" class="fnname">from_yo</a>(year: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, ordinal: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#220-222" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDate</code> from the <a href="#ordinal-date">ordinal date</a>
(year and day of the year).</p>
<p>Panics on the out-of-range date and/or invalid day of year.</p>
<h1 id="example-2" class="section-header"><a href="#example-2">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">Datelike</span>, <span class="ident">Weekday</span>};
<span class="kw">let</span> <span class="ident">d</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_yo</span>(<span class="number">2015</span>, <span class="number">73</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">ordinal</span>(), <span class="number">73</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">year</span>(), <span class="number">2015</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">month</span>(), <span class="number">3</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">day</span>(), <span class="number">14</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">iso_week</span>().<span class="ident">year</span>(), <span class="number">2015</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">iso_week</span>().<span class="ident">week</span>(), <span class="number">11</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">weekday</span>(), <span class="ident">Weekday</span>::<span class="ident">Sat</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">num_days_from_ce</span>(), <span class="number">735671</span>); <span class="comment">// days since January 1, 1 CE</span></pre></div>
</div><h4 id="method.from_yo_opt" class="method"><code>pub fn <a href="#method.from_yo_opt" class="fnname">from_yo_opt</a>(year: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, ordinal: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/date.rs.html#244-247" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDate</code> from the <a href="#ordinal-date">ordinal date</a>
(year and day of the year).</p>
<p>Returns <code>None</code> on the out-of-range date and/or invalid day of year.</p>
<h1 id="example-3" class="section-header"><a href="#example-3">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveDate</span>;
<span class="kw">let</span> <span class="ident">from_yo_opt</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_yo_opt</span>;
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_yo_opt</span>(<span class="number">2015</span>, <span class="number">100</span>).<span class="ident">is_some</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_yo_opt</span>(<span class="number">2015</span>, <span class="number">0</span>).<span class="ident">is_none</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_yo_opt</span>(<span class="number">2015</span>, <span class="number">365</span>).<span class="ident">is_some</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_yo_opt</span>(<span class="number">2015</span>, <span class="number">366</span>).<span class="ident">is_none</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_yo_opt</span>(<span class="op">-</span><span class="number">4</span>, <span class="number">366</span>).<span class="ident">is_some</span>()); <span class="comment">// 5 BCE is a leap year</span>
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_yo_opt</span>(<span class="number">400000</span>, <span class="number">1</span>).<span class="ident">is_none</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_yo_opt</span>(<span class="op">-</span><span class="number">400000</span>, <span class="number">1</span>).<span class="ident">is_none</span>());</pre></div>
</div><h4 id="method.from_isoywd" class="method"><code>pub fn <a href="#method.from_isoywd" class="fnname">from_isoywd</a>(year: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, week: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, weekday: <a class="enum" href="../../chrono/enum.Weekday.html" title="enum chrono::Weekday">Weekday</a>) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#270-272" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDate</code> from the <a href="#week-date">ISO week date</a>
(year, week number and day of the week).
The resulting <code>NaiveDate</code> may have a different year from the input year.</p>
<p>Panics on the out-of-range date and/or invalid week number.</p>
<h1 id="example-4" class="section-header"><a href="#example-4">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">Datelike</span>, <span class="ident">Weekday</span>};
<span class="kw">let</span> <span class="ident">d</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_isoywd</span>(<span class="number">2015</span>, <span class="number">11</span>, <span class="ident">Weekday</span>::<span class="ident">Sat</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">iso_week</span>().<span class="ident">year</span>(), <span class="number">2015</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">iso_week</span>().<span class="ident">week</span>(), <span class="number">11</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">weekday</span>(), <span class="ident">Weekday</span>::<span class="ident">Sat</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">year</span>(), <span class="number">2015</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">month</span>(), <span class="number">3</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">day</span>(), <span class="number">14</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">ordinal</span>(), <span class="number">73</span>); <span class="comment">// day of year</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">num_days_from_ce</span>(), <span class="number">735671</span>); <span class="comment">// days since January 1, 1 CE</span></pre></div>
</div><h4 id="method.from_isoywd_opt" class="method"><code>pub fn <a href="#method.from_isoywd_opt" class="fnname">from_isoywd_opt</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;year: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;week: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;weekday: <a class="enum" href="../../chrono/enum.Weekday.html" title="enum chrono::Weekday">Weekday</a><br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/date.rs.html#318-347" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDate</code> from the <a href="#week-date">ISO week date</a>
(year, week number and day of the week).
The resulting <code>NaiveDate</code> may have a different year from the input year.</p>
<p>Returns <code>None</code> on the out-of-range date and/or invalid week number.</p>
<h1 id="example-5" class="section-header"><a href="#example-5">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">Weekday</span>};
<span class="kw">let</span> <span class="ident">from_ymd</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>;
<span class="kw">let</span> <span class="ident">from_isoywd_opt</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_isoywd_opt</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_isoywd_opt</span>(<span class="number">2015</span>, <span class="number">0</span>, <span class="ident">Weekday</span>::<span class="ident">Sun</span>), <span class="prelude-val">None</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_isoywd_opt</span>(<span class="number">2015</span>, <span class="number">10</span>, <span class="ident">Weekday</span>::<span class="ident">Sun</span>), <span class="prelude-val">Some</span>(<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">3</span>, <span class="number">8</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_isoywd_opt</span>(<span class="number">2015</span>, <span class="number">30</span>, <span class="ident">Weekday</span>::<span class="ident">Mon</span>), <span class="prelude-val">Some</span>(<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">7</span>, <span class="number">20</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_isoywd_opt</span>(<span class="number">2015</span>, <span class="number">60</span>, <span class="ident">Weekday</span>::<span class="ident">Mon</span>), <span class="prelude-val">None</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_isoywd_opt</span>(<span class="number">400000</span>, <span class="number">10</span>, <span class="ident">Weekday</span>::<span class="ident">Fri</span>), <span class="prelude-val">None</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_isoywd_opt</span>(<span class="op">-</span><span class="number">400000</span>, <span class="number">10</span>, <span class="ident">Weekday</span>::<span class="ident">Sat</span>), <span class="prelude-val">None</span>);</pre></div>
<p>The year number of ISO week date may differ from that of the calendar date.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="comment">// Mo Tu We Th Fr Sa Su</span>
<span class="comment">// 2014-W52 22 23 24 25 26 27 28 has 4+ days of new year,</span>
<span class="comment">// 2015-W01 29 30 31 1 2 3 4 &lt;- so this is the first week</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_isoywd_opt</span>(<span class="number">2014</span>, <span class="number">52</span>, <span class="ident">Weekday</span>::<span class="ident">Sun</span>), <span class="prelude-val">Some</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">12</span>, <span class="number">28</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_isoywd_opt</span>(<span class="number">2014</span>, <span class="number">53</span>, <span class="ident">Weekday</span>::<span class="ident">Mon</span>), <span class="prelude-val">None</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_isoywd_opt</span>(<span class="number">2015</span>, <span class="number">1</span>, <span class="ident">Weekday</span>::<span class="ident">Mon</span>), <span class="prelude-val">Some</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">12</span>, <span class="number">29</span>)));
<span class="comment">// 2015-W52 21 22 23 24 25 26 27 has 4+ days of old year,</span>
<span class="comment">// 2015-W53 28 29 30 31 1 2 3 &lt;- so this is the last week</span>
<span class="comment">// 2016-W01 4 5 6 7 8 9 10</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_isoywd_opt</span>(<span class="number">2015</span>, <span class="number">52</span>, <span class="ident">Weekday</span>::<span class="ident">Sun</span>), <span class="prelude-val">Some</span>(<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">12</span>, <span class="number">27</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_isoywd_opt</span>(<span class="number">2015</span>, <span class="number">53</span>, <span class="ident">Weekday</span>::<span class="ident">Sun</span>), <span class="prelude-val">Some</span>(<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">1</span>, <span class="number">3</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_isoywd_opt</span>(<span class="number">2015</span>, <span class="number">54</span>, <span class="ident">Weekday</span>::<span class="ident">Mon</span>), <span class="prelude-val">None</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_isoywd_opt</span>(<span class="number">2016</span>, <span class="number">1</span>, <span class="ident">Weekday</span>::<span class="ident">Mon</span>), <span class="prelude-val">Some</span>(<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">1</span>, <span class="number">4</span>)));</pre></div>
</div><h4 id="method.from_num_days_from_ce" class="method"><code>pub fn <a href="#method.from_num_days_from_ce" class="fnname">from_num_days_from_ce</a>(days: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#393-395" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDate</code> from a day's number in the proleptic Gregorian calendar, with
January 1, 1 being day 1.</p>
<p>Panics if the date is out of range.</p>
<h1 id="example-6" class="section-header"><a href="#example-6">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">Datelike</span>, <span class="ident">Weekday</span>};
<span class="kw">let</span> <span class="ident">d</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_num_days_from_ce</span>(<span class="number">735671</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">num_days_from_ce</span>(), <span class="number">735671</span>); <span class="comment">// days since January 1, 1 CE</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">year</span>(), <span class="number">2015</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">month</span>(), <span class="number">3</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">day</span>(), <span class="number">14</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">ordinal</span>(), <span class="number">73</span>); <span class="comment">// day of year</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">iso_week</span>().<span class="ident">year</span>(), <span class="number">2015</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">iso_week</span>().<span class="ident">week</span>(), <span class="number">11</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">weekday</span>(), <span class="ident">Weekday</span>::<span class="ident">Sat</span>);</pre></div>
<p>While not directly supported by Chrono,
it is easy to convert from the Julian day number
(January 1, 4713 BCE in the <em>Julian</em> calendar being Day 0)
to Gregorian with this method.
(Note that this panics when <code>jd</code> is out of range.)</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveDate</span>;
<span class="kw">fn</span> <span class="ident">jd_to_date</span>(<span class="ident">jd</span>: <span class="ident">i32</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">NaiveDate</span> {
<span class="comment">// keep in mind that the Julian day number is 0-based</span>
<span class="comment">// while this method requires an 1-based number.</span>
<span class="ident">NaiveDate</span>::<span class="ident">from_num_days_from_ce</span>(<span class="ident">jd</span> <span class="op">-</span> <span class="number">1721425</span>)
}
<span class="comment">// January 1, 4713 BCE in Julian = November 24, 4714 BCE in Gregorian</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">jd_to_date</span>(<span class="number">0</span>), <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="op">-</span><span class="number">4713</span>, <span class="number">11</span>, <span class="number">24</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">jd_to_date</span>(<span class="number">1721426</span>), <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">1</span>, <span class="number">1</span>, <span class="number">1</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">jd_to_date</span>(<span class="number">2450000</span>), <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">1995</span>, <span class="number">10</span>, <span class="number">9</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">jd_to_date</span>(<span class="number">2451545</span>), <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2000</span>, <span class="number">1</span>, <span class="number">1</span>));</pre></div>
</div><h4 id="method.from_num_days_from_ce_opt" class="method"><code>pub fn <a href="#method.from_num_days_from_ce_opt" class="fnname">from_num_days_from_ce_opt</a>(days: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/date.rs.html#417-423" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDate</code> from a day's number in the proleptic Gregorian calendar, with
January 1, 1 being day 1.</p>
<p>Returns <code>None</code> if the date is out of range.</p>
<h1 id="example-7" class="section-header"><a href="#example-7">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveDate</span>;
<span class="kw">let</span> <span class="ident">from_ndays_opt</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_num_days_from_ce_opt</span>;
<span class="kw">let</span> <span class="ident">from_ymd</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ndays_opt</span>(<span class="number">730_000</span>), <span class="prelude-val">Some</span>(<span class="ident">from_ymd</span>(<span class="number">1999</span>, <span class="number">9</span>, <span class="number">3</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ndays_opt</span>(<span class="number">1</span>), <span class="prelude-val">Some</span>(<span class="ident">from_ymd</span>(<span class="number">1</span>, <span class="number">1</span>, <span class="number">1</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ndays_opt</span>(<span class="number">0</span>), <span class="prelude-val">Some</span>(<span class="ident">from_ymd</span>(<span class="number">0</span>, <span class="number">12</span>, <span class="number">31</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ndays_opt</span>(<span class="op">-</span><span class="number">1</span>), <span class="prelude-val">Some</span>(<span class="ident">from_ymd</span>(<span class="number">0</span>, <span class="number">12</span>, <span class="number">30</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ndays_opt</span>(<span class="number">100_000_000</span>), <span class="prelude-val">None</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ndays_opt</span>(<span class="op">-</span><span class="number">100_000_000</span>), <span class="prelude-val">None</span>);</pre></div>
</div><h4 id="method.from_weekday_of_month" class="method"><code>pub fn <a href="#method.from_weekday_of_month" class="fnname">from_weekday_of_month</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;year: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;month: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;weekday: <a class="enum" href="../../chrono/enum.Weekday.html" title="enum chrono::Weekday">Weekday</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><br>) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#450-452" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDate</code> by counting the number of occurrences of a particular day-of-week
since the beginning of the given month. For instance, if you want the 2nd Friday of March
2017, you would use <code>NaiveDate::from_weekday_of_month(2017, 3, Weekday::Fri, 2)</code>.</p>
<h1 id="panics" class="section-header"><a href="#panics">Panics</a></h1>
<p>The resulting <code>NaiveDate</code> is guaranteed to be in <code>month</code>. If <code>n</code> is larger than the number
of <code>weekday</code> in <code>month</code> (eg. the 6th Friday of March 2017) then this function will panic.</p>
<p><code>n</code> is 1-indexed. Passing <code>n=0</code> will cause a panic.</p>
<h1 id="example-8" class="section-header"><a href="#example-8">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">Weekday</span>};
<span class="kw">let</span> <span class="ident">from_weekday_of_month</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_weekday_of_month</span>;
<span class="kw">let</span> <span class="ident">from_ymd</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_weekday_of_month</span>(<span class="number">2018</span>, <span class="number">8</span>, <span class="ident">Weekday</span>::<span class="ident">Wed</span>, <span class="number">1</span>), <span class="ident">from_ymd</span>(<span class="number">2018</span>, <span class="number">8</span>, <span class="number">1</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_weekday_of_month</span>(<span class="number">2018</span>, <span class="number">8</span>, <span class="ident">Weekday</span>::<span class="ident">Fri</span>, <span class="number">1</span>), <span class="ident">from_ymd</span>(<span class="number">2018</span>, <span class="number">8</span>, <span class="number">3</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_weekday_of_month</span>(<span class="number">2018</span>, <span class="number">8</span>, <span class="ident">Weekday</span>::<span class="ident">Tue</span>, <span class="number">2</span>), <span class="ident">from_ymd</span>(<span class="number">2018</span>, <span class="number">8</span>, <span class="number">14</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_weekday_of_month</span>(<span class="number">2018</span>, <span class="number">8</span>, <span class="ident">Weekday</span>::<span class="ident">Fri</span>, <span class="number">4</span>), <span class="ident">from_ymd</span>(<span class="number">2018</span>, <span class="number">8</span>, <span class="number">24</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_weekday_of_month</span>(<span class="number">2018</span>, <span class="number">8</span>, <span class="ident">Weekday</span>::<span class="ident">Fri</span>, <span class="number">5</span>), <span class="ident">from_ymd</span>(<span class="number">2018</span>, <span class="number">8</span>, <span class="number">31</span>));</pre></div>
</div><h4 id="method.from_weekday_of_month_opt" class="method"><code>pub fn <a href="#method.from_weekday_of_month_opt" class="fnname">from_weekday_of_month_opt</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;year: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;month: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;weekday: <a class="enum" href="../../chrono/enum.Weekday.html" title="enum chrono::Weekday">Weekday</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;n: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/date.rs.html#466-479" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDate</code> by counting the number of occurrences of a particular day-of-week
since the beginning of the given month. For instance, if you want the 2nd Friday of March
2017, you would use <code>NaiveDate::from_weekday_of_month(2017, 3, Weekday::Fri, 2)</code>. <code>n</code> is 1-indexed.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">Weekday</span>};
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_weekday_of_month_opt</span>(<span class="number">2017</span>, <span class="number">3</span>, <span class="ident">Weekday</span>::<span class="ident">Fri</span>, <span class="number">2</span>),
<span class="ident">NaiveDate</span>::<span class="ident">from_ymd_opt</span>(<span class="number">2017</span>, <span class="number">3</span>, <span class="number">10</span>))</pre></div>
<p>Returns <code>None</code> if <code>n</code> out-of-range; ie. if <code>n</code> is larger than the number of <code>weekday</code> in
<code>month</code> (eg. the 6th Friday of March 2017), or if <code>n == 0</code>.</p>
</div><h4 id="method.parse_from_str" class="method"><code>pub fn <a href="#method.parse_from_str" class="fnname">parse_from_str</a>(s: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, fmt: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="type" href="../../chrono/format/type.ParseResult.html" title="type chrono::format::ParseResult">ParseResult</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/date.rs.html#523-527" title="goto source code">[src]</a></h4><div class="docblock"><p>Parses a string with the specified format string and returns a new <code>NaiveDate</code>.
See the <a href="../format/strftime/index.html"><code>format::strftime</code> module</a>
on the supported escape sequences.</p>
<h1 id="example-9" class="section-header"><a href="#example-9">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveDate</span>;
<span class="kw">let</span> <span class="ident">parse_from_str</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">parse_from_str</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parse_from_str</span>(<span class="string">&quot;2015-09-05&quot;</span>, <span class="string">&quot;%Y-%m-%d&quot;</span>),
<span class="prelude-val">Ok</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">5</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parse_from_str</span>(<span class="string">&quot;5sep2015&quot;</span>, <span class="string">&quot;%d%b%Y&quot;</span>),
<span class="prelude-val">Ok</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">5</span>)));</pre></div>
<p>Time and offset is ignored for the purpose of parsing.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parse_from_str</span>(<span class="string">&quot;2014-5-17T12:34:56+09:30&quot;</span>, <span class="string">&quot;%Y-%m-%dT%H:%M:%S%z&quot;</span>),
<span class="prelude-val">Ok</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">5</span>, <span class="number">17</span>)));</pre></div>
<p>Out-of-bound dates or insufficient fields are errors.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">parse_from_str</span>(<span class="string">&quot;2015/9&quot;</span>, <span class="string">&quot;%Y/%m&quot;</span>).<span class="ident">is_err</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">parse_from_str</span>(<span class="string">&quot;2015/9/31&quot;</span>, <span class="string">&quot;%Y/%m/%d&quot;</span>).<span class="ident">is_err</span>());</pre></div>
<p>All parsed fields should be consistent to each other, otherwise it's an error.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">parse_from_str</span>(<span class="string">&quot;Sat, 09 Aug 2013&quot;</span>, <span class="string">&quot;%a, %d %b %Y&quot;</span>).<span class="ident">is_err</span>());</pre></div>
</div><h4 id="method.and_time" class="method"><code>pub fn <a href="#method.and_time" class="fnname">and_time</a>(&amp;self, time: <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#544-546" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDateTime</code> from the current date and given <code>NaiveTime</code>.</p>
<h1 id="example-10" class="section-header"><a href="#example-10">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveTime</span>, <span class="ident">NaiveDateTime</span>};
<span class="kw">let</span> <span class="ident">d</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">6</span>, <span class="number">3</span>);
<span class="kw">let</span> <span class="ident">t</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms_milli</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>, <span class="number">789</span>);
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">d</span>.<span class="ident">and_time</span>(<span class="ident">t</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">date</span>(), <span class="ident">d</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">time</span>(), <span class="ident">t</span>);</pre></div>
</div><h4 id="method.and_hms" class="method"><code>pub fn <a href="#method.and_hms" class="fnname">and_hms</a>(&amp;self, hour: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, min: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, sec: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#568-570" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDateTime</code> from the current date, hour, minute and second.</p>
<p>No <a href="./struct.NaiveTime.html#leap-second-handling">leap second</a> is allowed here;
use <code>NaiveDate::and_hms_*</code> methods with a subsecond parameter instead.</p>
<p>Panics on invalid hour, minute and/or second.</p>
<h1 id="example-11" class="section-header"><a href="#example-11">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Datelike</span>, <span class="ident">Timelike</span>, <span class="ident">Weekday</span>};
<span class="kw">let</span> <span class="ident">d</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">6</span>, <span class="number">3</span>);
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">d</span>.<span class="ident">and_hms</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">year</span>(), <span class="number">2015</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">weekday</span>(), <span class="ident">Weekday</span>::<span class="ident">Wed</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">second</span>(), <span class="number">56</span>);</pre></div>
</div><h4 id="method.and_hms_opt" class="method"><code>pub fn <a href="#method.and_hms_opt" class="fnname">and_hms_opt</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;hour: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;min: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;sec: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/date.rs.html#591-593" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDateTime</code> from the current date, hour, minute and second.</p>
<p>No <a href="./struct.NaiveTime.html#leap-second-handling">leap second</a> is allowed here;
use <code>NaiveDate::and_hms_*_opt</code> methods with a subsecond parameter instead.</p>
<p>Returns <code>None</code> on invalid hour, minute and/or second.</p>
<h1 id="example-12" class="section-header"><a href="#example-12">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveDate</span>;
<span class="kw">let</span> <span class="ident">d</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">6</span>, <span class="number">3</span>);
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">and_hms_opt</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>).<span class="ident">is_some</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">and_hms_opt</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">60</span>).<span class="ident">is_none</span>()); <span class="comment">// use `and_hms_milli_opt` instead</span>
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">and_hms_opt</span>(<span class="number">12</span>, <span class="number">60</span>, <span class="number">56</span>).<span class="ident">is_none</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">and_hms_opt</span>(<span class="number">24</span>, <span class="number">34</span>, <span class="number">56</span>).<span class="ident">is_none</span>());</pre></div>
</div><h4 id="method.and_hms_milli" class="method"><code>pub fn <a href="#method.and_hms_milli" class="fnname">and_hms_milli</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;hour: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;min: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;sec: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;milli: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#616-618" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDateTime</code> from the current date, hour, minute, second and millisecond.</p>
<p>The millisecond part can exceed 1,000
in order to represent the <a href="./struct.NaiveTime.html#leap-second-handling">leap second</a>.</p>
<p>Panics on invalid hour, minute, second and/or millisecond.</p>
<h1 id="example-13" class="section-header"><a href="#example-13">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Datelike</span>, <span class="ident">Timelike</span>, <span class="ident">Weekday</span>};
<span class="kw">let</span> <span class="ident">d</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">6</span>, <span class="number">3</span>);
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">d</span>.<span class="ident">and_hms_milli</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>, <span class="number">789</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">year</span>(), <span class="number">2015</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">weekday</span>(), <span class="ident">Weekday</span>::<span class="ident">Wed</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">second</span>(), <span class="number">56</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">nanosecond</span>(), <span class="number">789_000_000</span>);</pre></div>
</div><h4 id="method.and_hms_milli_opt" class="method"><code>pub fn <a href="#method.and_hms_milli_opt" class="fnname">and_hms_milli_opt</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;hour: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;min: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;sec: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;milli: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/date.rs.html#641-649" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDateTime</code> from the current date, hour, minute, second and millisecond.</p>
<p>The millisecond part can exceed 1,000
in order to represent the <a href="./struct.NaiveTime.html#leap-second-handling">leap second</a>.</p>
<p>Returns <code>None</code> on invalid hour, minute, second and/or millisecond.</p>
<h1 id="example-14" class="section-header"><a href="#example-14">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveDate</span>;
<span class="kw">let</span> <span class="ident">d</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">6</span>, <span class="number">3</span>);
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">and_hms_milli_opt</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>, <span class="number">789</span>).<span class="ident">is_some</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">and_hms_milli_opt</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">59</span>, <span class="number">1_789</span>).<span class="ident">is_some</span>()); <span class="comment">// leap second</span>
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">and_hms_milli_opt</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">59</span>, <span class="number">2_789</span>).<span class="ident">is_none</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">and_hms_milli_opt</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">60</span>, <span class="number">789</span>).<span class="ident">is_none</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">and_hms_milli_opt</span>(<span class="number">12</span>, <span class="number">60</span>, <span class="number">56</span>, <span class="number">789</span>).<span class="ident">is_none</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">and_hms_milli_opt</span>(<span class="number">24</span>, <span class="number">34</span>, <span class="number">56</span>, <span class="number">789</span>).<span class="ident">is_none</span>());</pre></div>
</div><h4 id="method.and_hms_micro" class="method"><code>pub fn <a href="#method.and_hms_micro" class="fnname">and_hms_micro</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;hour: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;min: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;sec: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;micro: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#672-674" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDateTime</code> from the current date, hour, minute, second and microsecond.</p>
<p>The microsecond part can exceed 1,000,000
in order to represent the <a href="./struct.NaiveTime.html#leap-second-handling">leap second</a>.</p>
<p>Panics on invalid hour, minute, second and/or microsecond.</p>
<h1 id="example-15" class="section-header"><a href="#example-15">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Datelike</span>, <span class="ident">Timelike</span>, <span class="ident">Weekday</span>};
<span class="kw">let</span> <span class="ident">d</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">6</span>, <span class="number">3</span>);
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">d</span>.<span class="ident">and_hms_micro</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>, <span class="number">789_012</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">year</span>(), <span class="number">2015</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">weekday</span>(), <span class="ident">Weekday</span>::<span class="ident">Wed</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">second</span>(), <span class="number">56</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">nanosecond</span>(), <span class="number">789_012_000</span>);</pre></div>
</div><h4 id="method.and_hms_micro_opt" class="method"><code>pub fn <a href="#method.and_hms_micro_opt" class="fnname">and_hms_micro_opt</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;hour: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;min: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;sec: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;micro: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/date.rs.html#697-705" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDateTime</code> from the current date, hour, minute, second and microsecond.</p>
<p>The microsecond part can exceed 1,000,000
in order to represent the <a href="./struct.NaiveTime.html#leap-second-handling">leap second</a>.</p>
<p>Returns <code>None</code> on invalid hour, minute, second and/or microsecond.</p>
<h1 id="example-16" class="section-header"><a href="#example-16">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveDate</span>;
<span class="kw">let</span> <span class="ident">d</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">6</span>, <span class="number">3</span>);
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">and_hms_micro_opt</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>, <span class="number">789_012</span>).<span class="ident">is_some</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">and_hms_micro_opt</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">59</span>, <span class="number">1_789_012</span>).<span class="ident">is_some</span>()); <span class="comment">// leap second</span>
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">and_hms_micro_opt</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">59</span>, <span class="number">2_789_012</span>).<span class="ident">is_none</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">and_hms_micro_opt</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">60</span>, <span class="number">789_012</span>).<span class="ident">is_none</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">and_hms_micro_opt</span>(<span class="number">12</span>, <span class="number">60</span>, <span class="number">56</span>, <span class="number">789_012</span>).<span class="ident">is_none</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">and_hms_micro_opt</span>(<span class="number">24</span>, <span class="number">34</span>, <span class="number">56</span>, <span class="number">789_012</span>).<span class="ident">is_none</span>());</pre></div>
</div><h4 id="method.and_hms_nano" class="method"><code>pub fn <a href="#method.and_hms_nano" class="fnname">and_hms_nano</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;hour: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;min: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;sec: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;nano: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#728-730" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDateTime</code> from the current date, hour, minute, second and nanosecond.</p>
<p>The nanosecond part can exceed 1,000,000,000
in order to represent the <a href="./struct.NaiveTime.html#leap-second-handling">leap second</a>.</p>
<p>Panics on invalid hour, minute, second and/or nanosecond.</p>
<h1 id="example-17" class="section-header"><a href="#example-17">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Datelike</span>, <span class="ident">Timelike</span>, <span class="ident">Weekday</span>};
<span class="kw">let</span> <span class="ident">d</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">6</span>, <span class="number">3</span>);
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">d</span>.<span class="ident">and_hms_nano</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>, <span class="number">789_012_345</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">year</span>(), <span class="number">2015</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">weekday</span>(), <span class="ident">Weekday</span>::<span class="ident">Wed</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">second</span>(), <span class="number">56</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">nanosecond</span>(), <span class="number">789_012_345</span>);</pre></div>
</div><h4 id="method.and_hms_nano_opt" class="method"><code>pub fn <a href="#method.and_hms_nano_opt" class="fnname">and_hms_nano_opt</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;hour: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;min: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;sec: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;nano: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/date.rs.html#753-761" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDateTime</code> from the current date, hour, minute, second and nanosecond.</p>
<p>The nanosecond part can exceed 1,000,000,000
in order to represent the <a href="./struct.NaiveTime.html#leap-second-handling">leap second</a>.</p>
<p>Returns <code>None</code> on invalid hour, minute, second and/or nanosecond.</p>
<h1 id="example-18" class="section-header"><a href="#example-18">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveDate</span>;
<span class="kw">let</span> <span class="ident">d</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">6</span>, <span class="number">3</span>);
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">and_hms_nano_opt</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>, <span class="number">789_012_345</span>).<span class="ident">is_some</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">and_hms_nano_opt</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">59</span>, <span class="number">1_789_012_345</span>).<span class="ident">is_some</span>()); <span class="comment">// leap second</span>
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">and_hms_nano_opt</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">59</span>, <span class="number">2_789_012_345</span>).<span class="ident">is_none</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">and_hms_nano_opt</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">60</span>, <span class="number">789_012_345</span>).<span class="ident">is_none</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">and_hms_nano_opt</span>(<span class="number">12</span>, <span class="number">60</span>, <span class="number">56</span>, <span class="number">789_012_345</span>).<span class="ident">is_none</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">and_hms_nano_opt</span>(<span class="number">24</span>, <span class="number">34</span>, <span class="number">56</span>, <span class="number">789_012_345</span>).<span class="ident">is_none</span>());</pre></div>
</div><h4 id="method.succ" class="method"><code>pub fn <a href="#method.succ" class="fnname">succ</a>(&amp;self) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#810-812" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDate</code> for the next calendar date.</p>
<p>Panics when <code>self</code> is the last representable date.</p>
<h1 id="example-19" class="section-header"><a href="#example-19">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveDate</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">6</span>, <span class="number">3</span>).<span class="ident">succ</span>(), <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">6</span>, <span class="number">4</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">6</span>, <span class="number">30</span>).<span class="ident">succ</span>(), <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">7</span>, <span class="number">1</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">12</span>, <span class="number">31</span>).<span class="ident">succ</span>(), <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">1</span>, <span class="number">1</span>));</pre></div>
</div><h4 id="method.succ_opt" class="method"><code>pub fn <a href="#method.succ_opt" class="fnname">succ_opt</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/date.rs.html#829-831" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDate</code> for the next calendar date.</p>
<p>Returns <code>None</code> when <code>self</code> is the last representable date.</p>
<h1 id="example-20" class="section-header"><a href="#example-20">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveDate</span>;
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">naive</span>::<span class="ident">MAX_DATE</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">6</span>, <span class="number">3</span>).<span class="ident">succ_opt</span>(),
<span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">6</span>, <span class="number">4</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">MAX_DATE</span>.<span class="ident">succ_opt</span>(), <span class="prelude-val">None</span>);</pre></div>
</div><h4 id="method.pred" class="method"><code>pub fn <a href="#method.pred" class="fnname">pred</a>(&amp;self) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#847-849" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDate</code> for the previous calendar date.</p>
<p>Panics when <code>self</code> is the first representable date.</p>
<h1 id="example-21" class="section-header"><a href="#example-21">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveDate</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">6</span>, <span class="number">3</span>).<span class="ident">pred</span>(), <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">6</span>, <span class="number">2</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">6</span>, <span class="number">1</span>).<span class="ident">pred</span>(), <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">5</span>, <span class="number">31</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">1</span>, <span class="number">1</span>).<span class="ident">pred</span>(), <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">12</span>, <span class="number">31</span>));</pre></div>
</div><h4 id="method.pred_opt" class="method"><code>pub fn <a href="#method.pred_opt" class="fnname">pred_opt</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/date.rs.html#866-868" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDate</code> for the previous calendar date.</p>
<p>Returns <code>None</code> when <code>self</code> is the first representable date.</p>
<h1 id="example-22" class="section-header"><a href="#example-22">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveDate</span>;
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">naive</span>::<span class="ident">MIN_DATE</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">6</span>, <span class="number">3</span>).<span class="ident">pred_opt</span>(),
<span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">6</span>, <span class="number">2</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">MIN_DATE</span>.<span class="ident">pred_opt</span>(), <span class="prelude-val">None</span>);</pre></div>
</div><h4 id="method.checked_add_signed" class="method"><code>pub fn <a href="#method.checked_add_signed" class="fnname">checked_add_signed</a>(self, rhs: <a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/date.rs.html#891-902" title="goto source code">[src]</a></h4><div class="docblock"><p>Adds the <code>days</code> part of given <code>Duration</code> to the current date.</p>
<p>Returns <code>None</code> when it will result in overflow.</p>
<h1 id="example-23" class="section-header"><a href="#example-23">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">Duration</span>, <span class="ident">NaiveDate</span>};
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">naive</span>::<span class="ident">MAX_DATE</span>;
<span class="kw">let</span> <span class="ident">d</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">5</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">checked_add_signed</span>(<span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">40</span>)),
<span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">10</span>, <span class="number">15</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">checked_add_signed</span>(<span class="ident">Duration</span>::<span class="ident">days</span>(<span class="op">-</span><span class="number">40</span>)),
<span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">7</span>, <span class="number">27</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">checked_add_signed</span>(<span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">1_000_000_000</span>)), <span class="prelude-val">None</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">checked_add_signed</span>(<span class="ident">Duration</span>::<span class="ident">days</span>(<span class="op">-</span><span class="number">1_000_000_000</span>)), <span class="prelude-val">None</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">MAX_DATE</span>.<span class="ident">checked_add_signed</span>(<span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">1</span>)), <span class="prelude-val">None</span>);</pre></div>
</div><h4 id="method.checked_sub_signed" class="method"><code>pub fn <a href="#method.checked_sub_signed" class="fnname">checked_sub_signed</a>(self, rhs: <a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/date.rs.html#925-936" title="goto source code">[src]</a></h4><div class="docblock"><p>Subtracts the <code>days</code> part of given <code>Duration</code> from the current date.</p>
<p>Returns <code>None</code> when it will result in overflow.</p>
<h1 id="example-24" class="section-header"><a href="#example-24">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">Duration</span>, <span class="ident">NaiveDate</span>};
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">naive</span>::<span class="ident">MIN_DATE</span>;
<span class="kw">let</span> <span class="ident">d</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">5</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">checked_sub_signed</span>(<span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">40</span>)),
<span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">7</span>, <span class="number">27</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">checked_sub_signed</span>(<span class="ident">Duration</span>::<span class="ident">days</span>(<span class="op">-</span><span class="number">40</span>)),
<span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">10</span>, <span class="number">15</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">checked_sub_signed</span>(<span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">1_000_000_000</span>)), <span class="prelude-val">None</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">checked_sub_signed</span>(<span class="ident">Duration</span>::<span class="ident">days</span>(<span class="op">-</span><span class="number">1_000_000_000</span>)), <span class="prelude-val">None</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">MIN_DATE</span>.<span class="ident">checked_sub_signed</span>(<span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">1</span>)), <span class="prelude-val">None</span>);</pre></div>
</div><h4 id="method.signed_duration_since" class="method"><code>pub fn <a href="#method.signed_duration_since" class="fnname">signed_duration_since</a>(self, rhs: <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>) -&gt; <a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#962-972" title="goto source code">[src]</a></h4><div class="docblock"><p>Subtracts another <code>NaiveDate</code> from the current date.
Returns a <code>Duration</code> of integral numbers.</p>
<p>This does not overflow or underflow at all,
as all possible output fits in the range of <code>Duration</code>.</p>
<h1 id="example-25" class="section-header"><a href="#example-25">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">Duration</span>, <span class="ident">NaiveDate</span>};
<span class="kw">let</span> <span class="ident">from_ymd</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>;
<span class="kw">let</span> <span class="ident">since</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">signed_duration_since</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">since</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>), <span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>)), <span class="ident">Duration</span>::<span class="ident">zero</span>());
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">since</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>), <span class="ident">from_ymd</span>(<span class="number">2013</span>, <span class="number">12</span>, <span class="number">31</span>)), <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">1</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">since</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>), <span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">2</span>)), <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="op">-</span><span class="number">1</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">since</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>), <span class="ident">from_ymd</span>(<span class="number">2013</span>, <span class="number">9</span>, <span class="number">23</span>)), <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">100</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">since</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>), <span class="ident">from_ymd</span>(<span class="number">2013</span>, <span class="number">1</span>, <span class="number">1</span>)), <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">365</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">since</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>), <span class="ident">from_ymd</span>(<span class="number">2010</span>, <span class="number">1</span>, <span class="number">1</span>)), <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">365</span><span class="kw-2">*</span><span class="number">4</span> <span class="op">+</span> <span class="number">1</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">since</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>), <span class="ident">from_ymd</span>(<span class="number">1614</span>, <span class="number">1</span>, <span class="number">1</span>)), <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">365</span><span class="kw-2">*</span><span class="number">400</span> <span class="op">+</span> <span class="number">97</span>));</pre></div>
</div><h4 id="method.format_with_items" class="method"><code>pub fn <a href="#method.format_with_items" class="fnname">format_with_items</a>&lt;'a, I, B&gt;(&amp;self, items: I) -&gt; <a class="struct" href="../../chrono/format/struct.DelayedFormat.html" title="struct chrono::format::DelayedFormat">DelayedFormat</a>&lt;I&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a>&lt;Item = B&gt; + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;<a class="enum" href="../../chrono/format/enum.Item.html" title="enum chrono::format::Item">Item</a>&lt;'a&gt;&gt;,&nbsp;</span></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#1003-1009" title="goto source code">[src]</a></h4><div class="docblock"><p>Formats the date with the specified formatting items.
Otherwise it is the same as the ordinary <code>format</code> method.</p>
<p>The <code>Iterator</code> of items should be <code>Clone</code>able,
since the resulting <code>DelayedFormat</code> value may be formatted multiple times.</p>
<h1 id="example-26" class="section-header"><a href="#example-26">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveDate</span>;
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">format</span>::<span class="ident">strftime</span>::<span class="ident">StrftimeItems</span>;
<span class="kw">let</span> <span class="ident">fmt</span> <span class="op">=</span> <span class="ident">StrftimeItems</span>::<span class="ident">new</span>(<span class="string">&quot;%Y-%m-%d&quot;</span>);
<span class="kw">let</span> <span class="ident">d</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">5</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">format_with_items</span>(<span class="ident">fmt</span>.<span class="ident">clone</span>()).<span class="ident">to_string</span>(), <span class="string">&quot;2015-09-05&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">format</span>(<span class="string">&quot;%Y-%m-%d&quot;</span>).<span class="ident">to_string</span>(), <span class="string">&quot;2015-09-05&quot;</span>);</pre></div>
<p>The resulting <code>DelayedFormat</code> can be formatted directly via the <code>Display</code> trait.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">d</span>.<span class="ident">format_with_items</span>(<span class="ident">fmt</span>)), <span class="string">&quot;2015-09-05&quot;</span>);</pre></div>
</div><h4 id="method.format" class="method"><code>pub fn <a href="#method.format" class="fnname">format</a>&lt;'a&gt;(&amp;self, fmt: &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="struct" href="../../chrono/format/struct.DelayedFormat.html" title="struct chrono::format::DelayedFormat">DelayedFormat</a>&lt;<a class="struct" href="../../chrono/format/strftime/struct.StrftimeItems.html" title="struct chrono::format::strftime::StrftimeItems">StrftimeItems</a>&lt;'a&gt;&gt;</code><a class="srclink" href="../../src/chrono/naive/date.rs.html#1045-1047" title="goto source code">[src]</a></h4><div class="docblock"><p>Formats the date with the specified format string.
See the <a href="../format/strftime/index.html"><code>format::strftime</code> module</a>
on the supported escape sequences.</p>
<p>This returns a <code>DelayedFormat</code>,
which gets converted to a string only when actual formatting happens.
You may use the <code>to_string</code> method to get a <code>String</code>,
or just feed it into <code>print!</code> and other formatting macros.
(In this way it avoids the redundant memory allocation.)</p>
<p>A wrong format string does <em>not</em> issue an error immediately.
Rather, converting or formatting the <code>DelayedFormat</code> fails.
You are recommended to immediately use <code>DelayedFormat</code> for this reason.</p>
<h1 id="example-27" class="section-header"><a href="#example-27">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveDate</span>;
<span class="kw">let</span> <span class="ident">d</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">5</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">format</span>(<span class="string">&quot;%Y-%m-%d&quot;</span>).<span class="ident">to_string</span>(), <span class="string">&quot;2015-09-05&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">format</span>(<span class="string">&quot;%A, %-d %B, %C%y&quot;</span>).<span class="ident">to_string</span>(), <span class="string">&quot;Saturday, 5 September, 2015&quot;</span>);</pre></div>
<p>The resulting <code>DelayedFormat</code> can be formatted directly via the <code>Display</code> trait.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">d</span>.<span class="ident">format</span>(<span class="string">&quot;%Y-%m-%d&quot;</span>)), <span class="string">&quot;2015-09-05&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">d</span>.<span class="ident">format</span>(<span class="string">&quot;%A, %-d %B, %C%y&quot;</span>)), <span class="string">&quot;Saturday, 5 September, 2015&quot;</span>);</pre></div>
</div><h4 id="method.iter_days" class="method"><code>pub fn <a href="#method.iter_days" class="fnname">iter_days</a>(&amp;self) -&gt; NaiveDateDaysIterator</code><a class="srclink" href="../../src/chrono/naive/date.rs.html#1071-1073" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns an iterator that steps by days until the last representable date.</p>
<h1 id="example-28" class="section-header"><a href="#example-28">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">expected</span> <span class="op">=</span> [
<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">2</span>, <span class="number">27</span>),
<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">2</span>, <span class="number">28</span>),
<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">2</span>, <span class="number">29</span>),
<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">3</span>, <span class="number">1</span>),
];
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">count</span> <span class="op">=</span> <span class="number">0</span>;
<span class="kw">for</span> (<span class="ident">idx</span>, <span class="ident">d</span>) <span class="kw">in</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">2</span>, <span class="number">27</span>).<span class="ident">iter_days</span>().<span class="ident">take</span>(<span class="number">4</span>).<span class="ident">enumerate</span>() {
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>, <span class="ident">expected</span>[<span class="ident">idx</span>]);
<span class="ident">count</span> <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
}
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">count</span>, <span class="number">4</span>);</pre></div>
</div><h4 id="method.iter_weeks" class="method"><code>pub fn <a href="#method.iter_weeks" class="fnname">iter_weeks</a>(&amp;self) -&gt; NaiveDateWeeksIterator</code><a class="srclink" href="../../src/chrono/naive/date.rs.html#1097-1099" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns an iterator that steps by weeks until the last representable date.</p>
<h1 id="example-29" class="section-header"><a href="#example-29">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">expected</span> <span class="op">=</span> [
<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">2</span>, <span class="number">27</span>),
<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">3</span>, <span class="number">5</span>),
<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">3</span>, <span class="number">12</span>),
<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">3</span>, <span class="number">19</span>),
];
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">count</span> <span class="op">=</span> <span class="number">0</span>;
<span class="kw">for</span> (<span class="ident">idx</span>, <span class="ident">d</span>) <span class="kw">in</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">2</span>, <span class="number">27</span>).<span class="ident">iter_weeks</span>().<span class="ident">take</span>(<span class="number">4</span>).<span class="ident">enumerate</span>() {
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>, <span class="ident">expected</span>[<span class="ident">idx</span>]);
<span class="ident">count</span> <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
}
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">count</span>, <span class="number">4</span>);</pre></div>
</div></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Add%3CDuration%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html" title="trait core::ops::arith::Add">Add</a>&lt;<a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>&gt; for <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a href="#impl-Add%3CDuration%3E" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/date.rs.html#1468-1475" title="goto source code">[src]</a></h3><div class="docblock"><p>An addition of <code>Duration</code> to <code>NaiveDate</code> discards the fractional days,
rounding to the closest integral number of days towards <code>Duration::zero()</code>.</p>
<p>Panics on underflow or overflow.
Use <a href="#method.checked_add_signed"><code>NaiveDate::checked_add_signed</code></a> to detect that.</p>
<h1 id="example-49" class="section-header"><a href="#example-49">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">Duration</span>, <span class="ident">NaiveDate</span>};
<span class="kw">let</span> <span class="ident">from_ymd</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">zero</span>(), <span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">86399</span>), <span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="op">-</span><span class="number">86399</span>), <span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">1</span>), <span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">2</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="op">-</span><span class="number">1</span>), <span class="ident">from_ymd</span>(<span class="number">2013</span>, <span class="number">12</span>, <span class="number">31</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">364</span>), <span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">12</span>, <span class="number">31</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">365</span><span class="kw-2">*</span><span class="number">4</span> <span class="op">+</span> <span class="number">1</span>), <span class="ident">from_ymd</span>(<span class="number">2018</span>, <span class="number">1</span>, <span class="number">1</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">365</span><span class="kw-2">*</span><span class="number">400</span> <span class="op">+</span> <span class="number">97</span>), <span class="ident">from_ymd</span>(<span class="number">2414</span>, <span class="number">1</span>, <span class="number">1</span>));</pre></div>
</div><div class="impl-items"><h4 id="associatedtype.Output-2" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#associatedtype.Output" class="type">Output</a> = <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>+</code> operator.</p>
</div><h4 id="method.add" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add" class="fnname">add</a>(self, rhs: <a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a>) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#1472-1474" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>+</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add">Read more</a></p>
</div></div><h3 id="impl-AddAssign%3CDuration%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.AddAssign.html" title="trait core::ops::arith::AddAssign">AddAssign</a>&lt;<a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>&gt; for <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a href="#impl-AddAssign%3CDuration%3E" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/date.rs.html#1477-1482" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.add_assign" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.AddAssign.html#tymethod.add_assign" class="fnname">add_assign</a>(&amp;mut self, rhs: <a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a>)</code><a class="srclink" href="../../src/chrono/naive/date.rs.html#1479-1481" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>+=</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.AddAssign.html#tymethod.add_assign">Read more</a></p>
</div></div><h3 id="impl-Clone" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a href="#impl-Clone" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/date.rs.html#98" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&amp;self) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#98" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id="method.clone_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&amp;mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self)</code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#128-130" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3 id="impl-Copy" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a href="#impl-Copy" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/date.rs.html#98" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Datelike" class="impl"><code class="in-band">impl <a class="trait" href="../../chrono/trait.Datelike.html" title="trait chrono::Datelike">Datelike</a> for <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a href="#impl-Datelike" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/date.rs.html#1102-1442" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.year" class="method"><code>fn <a href="../../chrono/trait.Datelike.html#tymethod.year" class="fnname">year</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#1114-1116" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the year number in the <a href="#calendar-date">calendar date</a>.</p>
<h1 id="example-30" class="section-header"><a href="#example-30">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">Datelike</span>};
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">year</span>(), <span class="number">2015</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="op">-</span><span class="number">308</span>, <span class="number">3</span>, <span class="number">14</span>).<span class="ident">year</span>(), <span class="op">-</span><span class="number">308</span>); <span class="comment">// 309 BCE</span></pre></div>
</div><h4 id="method.month" class="method"><code>fn <a href="../../chrono/trait.Datelike.html#tymethod.month" class="fnname">month</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#1131-1133" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the month number starting from 1.</p>
<p>The return value ranges from 1 to 12.</p>
<h1 id="example-31" class="section-header"><a href="#example-31">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">Datelike</span>};
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">month</span>(), <span class="number">9</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="op">-</span><span class="number">308</span>, <span class="number">3</span>, <span class="number">14</span>).<span class="ident">month</span>(), <span class="number">3</span>);</pre></div>
</div><h4 id="method.month0" class="method"><code>fn <a href="../../chrono/trait.Datelike.html#tymethod.month0" class="fnname">month0</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#1148-1150" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the month number starting from 0.</p>
<p>The return value ranges from 0 to 11.</p>
<h1 id="example-32" class="section-header"><a href="#example-32">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">Datelike</span>};
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">month0</span>(), <span class="number">8</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="op">-</span><span class="number">308</span>, <span class="number">3</span>, <span class="number">14</span>).<span class="ident">month0</span>(), <span class="number">2</span>);</pre></div>
</div><h4 id="method.day" class="method"><code>fn <a href="../../chrono/trait.Datelike.html#tymethod.day" class="fnname">day</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#1188-1190" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the day of month starting from 1.</p>
<p>The return value ranges from 1 to 31. (The last day of month differs by months.)</p>
<h1 id="example-33" class="section-header"><a href="#example-33">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">Datelike</span>};
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">day</span>(), <span class="number">8</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="op">-</span><span class="number">308</span>, <span class="number">3</span>, <span class="number">14</span>).<span class="ident">day</span>(), <span class="number">14</span>);</pre></div>
<p>Combined with <a href="#method.pred"><code>NaiveDate::pred</code></a>,
one can determine the number of days in a particular month.
(Note that this panics when <code>year</code> is out of range.)</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">Datelike</span>};
<span class="kw">fn</span> <span class="ident">ndays_in_month</span>(<span class="ident">year</span>: <span class="ident">i32</span>, <span class="ident">month</span>: <span class="ident">u32</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">u32</span> {
<span class="comment">// the first day of the next month...</span>
<span class="kw">let</span> (<span class="ident">y</span>, <span class="ident">m</span>) <span class="op">=</span> <span class="kw">if</span> <span class="ident">month</span> <span class="op">=</span><span class="op">=</span> <span class="number">12</span> { (<span class="ident">year</span> <span class="op">+</span> <span class="number">1</span>, <span class="number">1</span>) } <span class="kw">else</span> { (<span class="ident">year</span>, <span class="ident">month</span> <span class="op">+</span> <span class="number">1</span>) };
<span class="kw">let</span> <span class="ident">d</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="ident">y</span>, <span class="ident">m</span>, <span class="number">1</span>);
<span class="comment">// ...is preceded by the last day of the original month</span>
<span class="ident">d</span>.<span class="ident">pred</span>().<span class="ident">day</span>()
}
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ndays_in_month</span>(<span class="number">2015</span>, <span class="number">8</span>), <span class="number">31</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ndays_in_month</span>(<span class="number">2015</span>, <span class="number">9</span>), <span class="number">30</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ndays_in_month</span>(<span class="number">2015</span>, <span class="number">12</span>), <span class="number">31</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ndays_in_month</span>(<span class="number">2016</span>, <span class="number">2</span>), <span class="number">29</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ndays_in_month</span>(<span class="number">2017</span>, <span class="number">2</span>), <span class="number">28</span>);</pre></div>
</div><h4 id="method.day0" class="method"><code>fn <a href="../../chrono/trait.Datelike.html#tymethod.day0" class="fnname">day0</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#1205-1207" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the day of month starting from 0.</p>
<p>The return value ranges from 0 to 30. (The last day of month differs by months.)</p>
<h1 id="example-34" class="section-header"><a href="#example-34">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">Datelike</span>};
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">day0</span>(), <span class="number">7</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="op">-</span><span class="number">308</span>, <span class="number">3</span>, <span class="number">14</span>).<span class="ident">day0</span>(), <span class="number">13</span>);</pre></div>
</div><h4 id="method.ordinal" class="method"><code>fn <a href="../../chrono/trait.Datelike.html#tymethod.ordinal" class="fnname">ordinal</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#1244-1246" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the day of year starting from 1.</p>
<p>The return value ranges from 1 to 366. (The last day of year differs by years.)</p>
<h1 id="example-35" class="section-header"><a href="#example-35">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">Datelike</span>};
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">ordinal</span>(), <span class="number">251</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="op">-</span><span class="number">308</span>, <span class="number">3</span>, <span class="number">14</span>).<span class="ident">ordinal</span>(), <span class="number">74</span>);</pre></div>
<p>Combined with <a href="#method.pred"><code>NaiveDate::pred</code></a>,
one can determine the number of days in a particular year.
(Note that this panics when <code>year</code> is out of range.)</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">Datelike</span>};
<span class="kw">fn</span> <span class="ident">ndays_in_year</span>(<span class="ident">year</span>: <span class="ident">i32</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">u32</span> {
<span class="comment">// the first day of the next year...</span>
<span class="kw">let</span> <span class="ident">d</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="ident">year</span> <span class="op">+</span> <span class="number">1</span>, <span class="number">1</span>, <span class="number">1</span>);
<span class="comment">// ...is preceded by the last day of the original year</span>
<span class="ident">d</span>.<span class="ident">pred</span>().<span class="ident">ordinal</span>()
}
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ndays_in_year</span>(<span class="number">2015</span>), <span class="number">365</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ndays_in_year</span>(<span class="number">2016</span>), <span class="number">366</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ndays_in_year</span>(<span class="number">2017</span>), <span class="number">365</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ndays_in_year</span>(<span class="number">2000</span>), <span class="number">366</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ndays_in_year</span>(<span class="number">2100</span>), <span class="number">365</span>);</pre></div>
</div><h4 id="method.ordinal0" class="method"><code>fn <a href="../../chrono/trait.Datelike.html#tymethod.ordinal0" class="fnname">ordinal0</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#1261-1263" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the day of year starting from 0.</p>
<p>The return value ranges from 0 to 365. (The last day of year differs by years.)</p>
<h1 id="example-36" class="section-header"><a href="#example-36">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">Datelike</span>};
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">ordinal0</span>(), <span class="number">250</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="op">-</span><span class="number">308</span>, <span class="number">3</span>, <span class="number">14</span>).<span class="ident">ordinal0</span>(), <span class="number">73</span>);</pre></div>
</div><h4 id="method.weekday" class="method"><code>fn <a href="../../chrono/trait.Datelike.html#tymethod.weekday" class="fnname">weekday</a>(&amp;self) -&gt; <a class="enum" href="../../chrono/enum.Weekday.html" title="enum chrono::Weekday">Weekday</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#1276-1278" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the day of week.</p>
<h1 id="example-37" class="section-header"><a href="#example-37">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">Datelike</span>, <span class="ident">Weekday</span>};
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">weekday</span>(), <span class="ident">Weekday</span>::<span class="ident">Tue</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="op">-</span><span class="number">308</span>, <span class="number">3</span>, <span class="number">14</span>).<span class="ident">weekday</span>(), <span class="ident">Weekday</span>::<span class="ident">Fri</span>);</pre></div>
</div><h4 id="method.iso_week" class="method hidden"><code>fn <a href="../../chrono/trait.Datelike.html#tymethod.iso_week" class="fnname">iso_week</a>(&amp;self) -&gt; <a class="struct" href="../../chrono/naive/struct.IsoWeek.html" title="struct chrono::naive::IsoWeek">IsoWeek</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#1281-1283" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the ISO week.</p>
</div><h4 id="method.with_year" class="method"><code>fn <a href="../../chrono/trait.Datelike.html#tymethod.with_year" class="fnname">with_year</a>(&amp;self, year: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/date.rs.html#1308-1317" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDate</code> with the year number changed.</p>
<p>Returns <code>None</code> when the resulting <code>NaiveDate</code> would be invalid.</p>
<h1 id="example-38" class="section-header"><a href="#example-38">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">Datelike</span>};
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">with_year</span>(<span class="number">2016</span>),
<span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">9</span>, <span class="number">8</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">with_year</span>(<span class="op">-</span><span class="number">308</span>),
<span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="op">-</span><span class="number">308</span>, <span class="number">9</span>, <span class="number">8</span>)));</pre></div>
<p>A leap day (February 29) is a good example that this method can return <code>None</code>.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">2</span>, <span class="number">29</span>).<span class="ident">with_year</span>(<span class="number">2015</span>).<span class="ident">is_none</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">2</span>, <span class="number">29</span>).<span class="ident">with_year</span>(<span class="number">2020</span>).<span class="ident">is_some</span>());</pre></div>
</div><h4 id="method.with_month" class="method"><code>fn <a href="../../chrono/trait.Datelike.html#tymethod.with_month" class="fnname">with_month</a>(&amp;self, month: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/date.rs.html#1334-1336" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDate</code> with the month number (starting from 1) changed.</p>
<p>Returns <code>None</code> when the resulting <code>NaiveDate</code> would be invalid.</p>
<h1 id="example-39" class="section-header"><a href="#example-39">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">Datelike</span>};
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">with_month</span>(<span class="number">10</span>),
<span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">10</span>, <span class="number">8</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">with_month</span>(<span class="number">13</span>), <span class="prelude-val">None</span>); <span class="comment">// no month 13</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">30</span>).<span class="ident">with_month</span>(<span class="number">2</span>), <span class="prelude-val">None</span>); <span class="comment">// no February 30</span></pre></div>
</div><h4 id="method.with_month0" class="method"><code>fn <a href="../../chrono/trait.Datelike.html#tymethod.with_month0" class="fnname">with_month0</a>(&amp;self, month0: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/date.rs.html#1353-1355" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDate</code> with the month number (starting from 0) changed.</p>
<p>Returns <code>None</code> when the resulting <code>NaiveDate</code> would be invalid.</p>
<h1 id="example-40" class="section-header"><a href="#example-40">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">Datelike</span>};
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">with_month0</span>(<span class="number">9</span>),
<span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">10</span>, <span class="number">8</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">with_month0</span>(<span class="number">12</span>), <span class="prelude-val">None</span>); <span class="comment">// no month 13</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">30</span>).<span class="ident">with_month0</span>(<span class="number">1</span>), <span class="prelude-val">None</span>); <span class="comment">// no February 30</span></pre></div>
</div><h4 id="method.with_day" class="method"><code>fn <a href="../../chrono/trait.Datelike.html#tymethod.with_day" class="fnname">with_day</a>(&amp;self, day: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/date.rs.html#1372-1374" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDate</code> with the day of month (starting from 1) changed.</p>
<p>Returns <code>None</code> when the resulting <code>NaiveDate</code> would be invalid.</p>
<h1 id="example-41" class="section-header"><a href="#example-41">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">Datelike</span>};
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">with_day</span>(<span class="number">30</span>),
<span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">30</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">with_day</span>(<span class="number">31</span>),
<span class="prelude-val">None</span>); <span class="comment">// no September 31</span></pre></div>
</div><h4 id="method.with_day0" class="method"><code>fn <a href="../../chrono/trait.Datelike.html#tymethod.with_day0" class="fnname">with_day0</a>(&amp;self, day0: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/date.rs.html#1391-1393" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDate</code> with the day of month (starting from 0) changed.</p>
<p>Returns <code>None</code> when the resulting <code>NaiveDate</code> would be invalid.</p>
<h1 id="example-42" class="section-header"><a href="#example-42">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">Datelike</span>};
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">with_day0</span>(<span class="number">29</span>),
<span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">30</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">with_day0</span>(<span class="number">30</span>),
<span class="prelude-val">None</span>); <span class="comment">// no September 31</span></pre></div>
</div><h4 id="method.with_ordinal" class="method"><code>fn <a href="../../chrono/trait.Datelike.html#tymethod.with_ordinal" class="fnname">with_ordinal</a>(&amp;self, ordinal: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/date.rs.html#1415-1417" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDate</code> with the day of year (starting from 1) changed.</p>
<p>Returns <code>None</code> when the resulting <code>NaiveDate</code> would be invalid.</p>
<h1 id="example-43" class="section-header"><a href="#example-43">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">Datelike</span>};
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">1</span>, <span class="number">1</span>).<span class="ident">with_ordinal</span>(<span class="number">60</span>),
<span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">3</span>, <span class="number">1</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">1</span>, <span class="number">1</span>).<span class="ident">with_ordinal</span>(<span class="number">366</span>),
<span class="prelude-val">None</span>); <span class="comment">// 2015 had only 365 days</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">1</span>, <span class="number">1</span>).<span class="ident">with_ordinal</span>(<span class="number">60</span>),
<span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">2</span>, <span class="number">29</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">1</span>, <span class="number">1</span>).<span class="ident">with_ordinal</span>(<span class="number">366</span>),
<span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">12</span>, <span class="number">31</span>)));</pre></div>
</div><h4 id="method.with_ordinal0" class="method"><code>fn <a href="../../chrono/trait.Datelike.html#tymethod.with_ordinal0" class="fnname">with_ordinal0</a>(&amp;self, ordinal0: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/date.rs.html#1439-1441" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDate</code> with the day of year (starting from 0) changed.</p>
<p>Returns <code>None</code> when the resulting <code>NaiveDate</code> would be invalid.</p>
<h1 id="example-44" class="section-header"><a href="#example-44">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">Datelike</span>};
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">1</span>, <span class="number">1</span>).<span class="ident">with_ordinal0</span>(<span class="number">59</span>),
<span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">3</span>, <span class="number">1</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">1</span>, <span class="number">1</span>).<span class="ident">with_ordinal0</span>(<span class="number">365</span>),
<span class="prelude-val">None</span>); <span class="comment">// 2015 had only 365 days</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">1</span>, <span class="number">1</span>).<span class="ident">with_ordinal0</span>(<span class="number">59</span>),
<span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">2</span>, <span class="number">29</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">1</span>, <span class="number">1</span>).<span class="ident">with_ordinal0</span>(<span class="number">365</span>),
<span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">12</span>, <span class="number">31</span>)));</pre></div>
</div><h4 id="method.year_ce" class="method hidden"><code>fn <a href="../../chrono/trait.Datelike.html#method.year_ce" class="fnname">year_ce</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code><a class="srclink" href="../../src/chrono/lib.rs.html#1252-1259" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the absolute year number starting from 1 with a boolean flag,
which is false when the year predates the epoch (BCE/BC) and true otherwise (CE/AD). <a href="../../chrono/trait.Datelike.html#method.year_ce">Read more</a></p>
</div><h4 id="method.num_days_from_ce" class="method hidden"><code>fn <a href="../../chrono/trait.Datelike.html#method.num_days_from_ce" class="fnname">num_days_from_ce</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a></code><a class="srclink" href="../../src/chrono/lib.rs.html#1344-1359" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Counts the days in the proleptic Gregorian calendar, with January 1, Year 1 (CE) as day 1. <a href="../../chrono/trait.Datelike.html#method.num_days_from_ce">Read more</a></p>
</div></div><h3 id="impl-Debug" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/date.rs.html#1639-1650" title="goto source code">[src]</a></h3><div class="docblock"><p>The <code>Debug</code> output of the naive date <code>d</code> is the same as
<a href="../format/strftime/index.html"><code>d.format(&quot;%Y-%m-%d&quot;)</code></a>.</p>
<p>The string printed can be readily parsed via the <code>parse</code> method on <code>str</code>.</p>
<h1 id="example-45" class="section-header"><a href="#example-45">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveDate</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">5</span>)), <span class="string">&quot;2015-09-05&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>( <span class="number">0</span>, <span class="number">1</span>, <span class="number">1</span>)), <span class="string">&quot;0000-01-01&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">9999</span>, <span class="number">12</span>, <span class="number">31</span>)), <span class="string">&quot;9999-12-31&quot;</span>);</pre></div>
<p>ISO 8601 requires an explicit sign for years before 1 BCE or after 9999 CE.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>( <span class="op">-</span><span class="number">1</span>, <span class="number">1</span>, <span class="number">1</span>)), <span class="string">&quot;-0001-01-01&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">10000</span>, <span class="number">12</span>, <span class="number">31</span>)), <span class="string">&quot;+10000-12-31&quot;</span>);</pre></div>
</div><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#1640-1649" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id="impl-Display" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a href="#impl-Display" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/date.rs.html#1674-1678" title="goto source code">[src]</a></h3><div class="docblock"><p>The <code>Display</code> output of the naive date <code>d</code> is the same as
<a href="../format/strftime/index.html"><code>d.format(&quot;%Y-%m-%d&quot;)</code></a>.</p>
<p>The string printed can be readily parsed via the <code>parse</code> method on <code>str</code>.</p>
<h1 id="example-46" class="section-header"><a href="#example-46">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveDate</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">5</span>)), <span class="string">&quot;2015-09-05&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>( <span class="number">0</span>, <span class="number">1</span>, <span class="number">1</span>)), <span class="string">&quot;0000-01-01&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">9999</span>, <span class="number">12</span>, <span class="number">31</span>)), <span class="string">&quot;9999-12-31&quot;</span>);</pre></div>
<p>ISO 8601 requires an explicit sign for years before 1 BCE or after 9999 CE.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>( <span class="op">-</span><span class="number">1</span>, <span class="number">1</span>, <span class="number">1</span>)), <span class="string">&quot;-0001-01-01&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">10000</span>, <span class="number">12</span>, <span class="number">31</span>)), <span class="string">&quot;+10000-12-31&quot;</span>);</pre></div>
</div><div class="impl-items"><h4 id="method.fmt-1" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#1675-1677" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id="impl-Eq" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a href="#impl-Eq" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/date.rs.html#98" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-FromStr" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html" title="trait core::str::traits::FromStr">FromStr</a> for <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a href="#impl-FromStr" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/date.rs.html#1696-1715" title="goto source code">[src]</a></h3><div class="docblock"><p>Parsing a <code>str</code> into a <code>NaiveDate</code> uses the same format,
<a href="../format/strftime/index.html"><code>%Y-%m-%d</code></a>, as in <code>Debug</code> and <code>Display</code>.</p>
<h1 id="example-50" class="section-header"><a href="#example-50">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveDate</span>;
<span class="kw">let</span> <span class="ident">d</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">18</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">&quot;2015-09-18&quot;</span>.<span class="ident">parse</span>::<span class="op">&lt;</span><span class="ident">NaiveDate</span><span class="op">&gt;</span>(), <span class="prelude-val">Ok</span>(<span class="ident">d</span>));
<span class="kw">let</span> <span class="ident">d</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">12345</span>, <span class="number">6</span>, <span class="number">7</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">&quot;+12345-6-7&quot;</span>.<span class="ident">parse</span>::<span class="op">&lt;</span><span class="ident">NaiveDate</span><span class="op">&gt;</span>(), <span class="prelude-val">Ok</span>(<span class="ident">d</span>));
<span class="macro">assert</span><span class="macro">!</span>(<span class="string">&quot;foo&quot;</span>.<span class="ident">parse</span>::<span class="op">&lt;</span><span class="ident">NaiveDate</span><span class="op">&gt;</span>().<span class="ident">is_err</span>());</pre></div>
</div><div class="impl-items"><h4 id="associatedtype.Err" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#associatedtype.Err" class="type">Err</a> = <a class="struct" href="../../chrono/format/struct.ParseError.html" title="struct chrono::format::ParseError">ParseError</a></code></h4><div class='docblock'><p>The associated error which can be returned from parsing.</p>
</div><h4 id="method.from_str" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#tymethod.from_str" class="fnname">from_str</a>(s: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="type" href="../../chrono/format/type.ParseResult.html" title="type chrono::format::ParseResult">ParseResult</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/date.rs.html#1699-1714" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Parses a string <code>s</code> to return a value of this type. <a href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#tymethod.from_str">Read more</a></p>
</div></div><h3 id="impl-Hash" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> for <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a href="#impl-Hash" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/date.rs.html#98" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.hash" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash" class="fnname">hash</a>&lt;__H:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>&gt;(&amp;self, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>__H)</code><a class="srclink" href="../../src/chrono/naive/date.rs.html#98" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Feeds this value into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash">Read more</a></p>
</div><h4 id="method.hash_slice" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice" class="fnname">hash_slice</a>&lt;H&gt;(data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[Self]</a>, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>H) <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.3.0">1.3.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#184-191" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice">Read more</a></p>
</div></div><h3 id="impl-Ord" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a href="#impl-Ord" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/date.rs.html#98" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.cmp" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp" class="fnname">cmp</a>(&amp;self, other: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#98" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method returns an <a href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="Ordering"><code>Ordering</code></a> between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></p>
</div><h4 id="method.max" class="method hidden"><code><span class="docblock attributes">#[must_use]</span>pub fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max" class="fnname">max</a>(self, other: Self) -&gt; Self</code><span class="since" title="Stable since Rust version 1.21.0">1.21.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#719-724" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Compares and returns the maximum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max">Read more</a></p>
</div><h4 id="method.min" class="method hidden"><code><span class="docblock attributes">#[must_use]</span>pub fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min" class="fnname">min</a>(self, other: Self) -&gt; Self</code><span class="since" title="Stable since Rust version 1.21.0">1.21.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#739-744" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Compares and returns the minimum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min">Read more</a></p>
</div><h4 id="method.clamp" class="method hidden"><code><span class="docblock attributes">#[must_use]</span>pub fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp" class="fnname">clamp</a>(self, min: Self, max: Self) -&gt; Self</code><span class="since" title="Stable since Rust version 1.50.0">1.50.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#764-776" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Restrict a value to a certain interval. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp">Read more</a></p>
</div></div><h3 id="impl-PartialEq%3CNaiveDate%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>&gt; for <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a href="#impl-PartialEq%3CNaiveDate%3E" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/date.rs.html#98" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.eq" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq" class="fnname">eq</a>(&amp;self, other: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#98" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id="method.ne" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne" class="fnname">ne</a>(&amp;self, other: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#98" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 id="impl-PartialOrd%3CNaiveDate%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>&gt; for <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a href="#impl-PartialOrd%3CNaiveDate%3E" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/date.rs.html#98" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.partial_cmp" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp" class="fnname">partial_cmp</a>(&amp;self, other: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/date.rs.html#98" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
</div><h4 id="method.lt" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt" class="fnname">lt</a>(&amp;self, other: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#98" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
</div><h4 id="method.le" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le" class="fnname">le</a>(&amp;self, other: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#98" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;=</code>
operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
</div><h4 id="method.gt" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt" class="fnname">gt</a>(&amp;self, other: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#98" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
</div><h4 id="method.ge" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge" class="fnname">ge</a>(&amp;self, other: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#98" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;=</code>
operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
</div></div><h3 id="impl-StructuralEq" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a href="#impl-StructuralEq" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/date.rs.html#98" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-StructuralPartialEq" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a href="#impl-StructuralPartialEq" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/date.rs.html#98" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sub%3CDuration%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html" title="trait core::ops::arith::Sub">Sub</a>&lt;<a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>&gt; for <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a href="#impl-Sub%3CDuration%3E" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/date.rs.html#1509-1516" title="goto source code">[src]</a></h3><div class="docblock"><p>A subtraction of <code>Duration</code> from <code>NaiveDate</code> discards the fractional days,
rounding to the closest integral number of days towards <code>Duration::zero()</code>.
It is the same as the addition with a negated <code>Duration</code>.</p>
<p>Panics on underflow or overflow.
Use <a href="#method.checked_sub_signed"><code>NaiveDate::checked_sub_signed</code></a> to detect that.</p>
<h1 id="example-47" class="section-header"><a href="#example-47">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">Duration</span>, <span class="ident">NaiveDate</span>};
<span class="kw">let</span> <span class="ident">from_ymd</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">zero</span>(), <span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">86399</span>), <span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="op">-</span><span class="number">86399</span>), <span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">1</span>), <span class="ident">from_ymd</span>(<span class="number">2013</span>, <span class="number">12</span>, <span class="number">31</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="op">-</span><span class="number">1</span>), <span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">2</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">364</span>), <span class="ident">from_ymd</span>(<span class="number">2013</span>, <span class="number">1</span>, <span class="number">2</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">365</span><span class="kw-2">*</span><span class="number">4</span> <span class="op">+</span> <span class="number">1</span>), <span class="ident">from_ymd</span>(<span class="number">2010</span>, <span class="number">1</span>, <span class="number">1</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">365</span><span class="kw-2">*</span><span class="number">400</span> <span class="op">+</span> <span class="number">97</span>), <span class="ident">from_ymd</span>(<span class="number">1614</span>, <span class="number">1</span>, <span class="number">1</span>));</pre></div>
</div><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#associatedtype.Output" class="type">Output</a> = <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>-</code> operator.</p>
</div><h4 id="method.sub" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#tymethod.sub" class="fnname">sub</a>(self, rhs: <a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a>) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#1513-1515" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>-</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#tymethod.sub">Read more</a></p>
</div></div><h3 id="impl-Sub%3CNaiveDate%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html" title="trait core::ops::arith::Sub">Sub</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>&gt; for <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a href="#impl-Sub%3CNaiveDate%3E" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/date.rs.html#1551-1558" title="goto source code">[src]</a></h3><div class="docblock"><p>Subtracts another <code>NaiveDate</code> from the current date.
Returns a <code>Duration</code> of integral numbers.</p>
<p>This does not overflow or underflow at all,
as all possible output fits in the range of <code>Duration</code>.</p>
<p>The implementation is a wrapper around
<a href="#method.signed_duration_since"><code>NaiveDate::signed_duration_since</code></a>.</p>
<h1 id="example-48" class="section-header"><a href="#example-48">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">Duration</span>, <span class="ident">NaiveDate</span>};
<span class="kw">let</span> <span class="ident">from_ymd</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">-</span> <span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>), <span class="ident">Duration</span>::<span class="ident">zero</span>());
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">-</span> <span class="ident">from_ymd</span>(<span class="number">2013</span>, <span class="number">12</span>, <span class="number">31</span>), <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">1</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">-</span> <span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">2</span>), <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="op">-</span><span class="number">1</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">-</span> <span class="ident">from_ymd</span>(<span class="number">2013</span>, <span class="number">9</span>, <span class="number">23</span>), <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">100</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">-</span> <span class="ident">from_ymd</span>(<span class="number">2013</span>, <span class="number">1</span>, <span class="number">1</span>), <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">365</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">-</span> <span class="ident">from_ymd</span>(<span class="number">2010</span>, <span class="number">1</span>, <span class="number">1</span>), <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">365</span><span class="kw-2">*</span><span class="number">4</span> <span class="op">+</span> <span class="number">1</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">-</span> <span class="ident">from_ymd</span>(<span class="number">1614</span>, <span class="number">1</span>, <span class="number">1</span>), <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">365</span><span class="kw-2">*</span><span class="number">400</span> <span class="op">+</span> <span class="number">97</span>));</pre></div>
</div><div class="impl-items"><h4 id="associatedtype.Output-1" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#associatedtype.Output" class="type">Output</a> = <a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>-</code> operator.</p>
</div><h4 id="method.sub-1" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#tymethod.sub" class="fnname">sub</a>(self, rhs: <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>) -&gt; <a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a></code><a class="srclink" href="../../src/chrono/naive/date.rs.html#1555-1557" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>-</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#tymethod.sub">Read more</a></p>
</div></div><h3 id="impl-SubAssign%3CDuration%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.SubAssign.html" title="trait core::ops::arith::SubAssign">SubAssign</a>&lt;<a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>&gt; for <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a href="#impl-SubAssign%3CDuration%3E" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/date.rs.html#1518-1523" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.sub_assign" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.SubAssign.html#tymethod.sub_assign" class="fnname">sub_assign</a>(&amp;mut self, rhs: <a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a>)</code><a class="srclink" href="../../src/chrono/naive/date.rs.html#1520-1522" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>-=</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.SubAssign.html#tymethod.sub_assign">Read more</a></p>
</div></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></div><h3 id="impl-Borrow%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211-213" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id="impl-BorrowMut%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id="impl-From%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</code><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-Into%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-Into%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -&gt; U</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-ToOwned" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,&nbsp;</span></code><a href="#impl-ToOwned" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Owned" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
</div><h4 id="method.to_owned" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fnname">to_owned</a>(&amp;self) -&gt; T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
</div><h4 id="method.clone_into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fnname">clone_into</a>(&amp;self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T)</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><details><summary><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
</div></div><h3 id="impl-ToString" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-ToString" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2194-2207" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_string" class="method hidden"><code>pub default fn <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string" class="fnname">to_string</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2200-2206" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
</div></div><h3 id="impl-TryFrom%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id="method.try_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-TryInto%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-TryInto%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#575-584" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error-1" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id="method.try_into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#581-583" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "chrono";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
-865
View File
@@ -1,865 +0,0 @@
<!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 `NaiveDateTime` struct in crate `chrono`."><meta name="keywords" content="rust, rustlang, rust-lang, NaiveDateTime"><title>chrono::naive::NaiveDateTime - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[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">&#9776;</div><a href='../../chrono/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Struct NaiveDateTime</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.checked_add_signed">checked_add_signed</a><a href="#method.checked_sub_signed">checked_sub_signed</a><a href="#method.date">date</a><a href="#method.format">format</a><a href="#method.format_with_items">format_with_items</a><a href="#method.from_timestamp">from_timestamp</a><a href="#method.from_timestamp_opt">from_timestamp_opt</a><a href="#method.new">new</a><a href="#method.parse_from_str">parse_from_str</a><a href="#method.signed_duration_since">signed_duration_since</a><a href="#method.time">time</a><a href="#method.timestamp">timestamp</a><a href="#method.timestamp_millis">timestamp_millis</a><a href="#method.timestamp_nanos">timestamp_nanos</a><a href="#method.timestamp_subsec_micros">timestamp_subsec_micros</a><a href="#method.timestamp_subsec_millis">timestamp_subsec_millis</a><a href="#method.timestamp_subsec_nanos">timestamp_subsec_nanos</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Add%3CDuration%3E">Add&lt;Duration&gt;</a><a href="#impl-Add%3CFixedOffset%3E">Add&lt;FixedOffset&gt;</a><a href="#impl-AddAssign%3CDuration%3E">AddAssign&lt;Duration&gt;</a><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Datelike">Datelike</a><a href="#impl-Debug">Debug</a><a href="#impl-Display">Display</a><a href="#impl-Eq">Eq</a><a href="#impl-FromStr">FromStr</a><a href="#impl-Hash">Hash</a><a href="#impl-Ord">Ord</a><a href="#impl-PartialEq%3CNaiveDateTime%3E">PartialEq&lt;NaiveDateTime&gt;</a><a href="#impl-PartialOrd%3CNaiveDateTime%3E">PartialOrd&lt;NaiveDateTime&gt;</a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a><a href="#impl-Sub%3CDuration%3E">Sub&lt;Duration&gt;</a><a href="#impl-Sub%3CFixedOffset%3E">Sub&lt;FixedOffset&gt;</a><a href="#impl-Sub%3CNaiveDateTime%3E">Sub&lt;NaiveDateTime&gt;</a><a href="#impl-SubAssign%3CDuration%3E">SubAssign&lt;Duration&gt;</a><a href="#impl-Timelike">Timelike</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><p class="location"><a href="../index.html">chrono</a>::<wbr><a href="index.html">naive</a></p><script>window.sidebarCurrent = {name: "NaiveDateTime", ty: "struct", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#62-65" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="../index.html">chrono</a>::<wbr><a href="index.html">naive</a>::<wbr><a class="struct" href="">NaiveDateTime</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct NaiveDateTime { /* fields omitted */ }</pre></div><div class="docblock"><p>ISO 8601 combined date and time without timezone.</p>
<h1 id="example" class="section-header"><a href="#example">Example</a></h1>
<p><code>NaiveDateTime</code> is commonly created from <a href="./struct.NaiveDate.html"><code>NaiveDate</code></a>.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>};
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">7</span>, <span class="number">8</span>).<span class="ident">and_hms</span>(<span class="number">9</span>, <span class="number">10</span>, <span class="number">11</span>);</pre></div>
<p>You can use typical <a href="../trait.Datelike.html">date-like</a> and
<a href="../trait.Timelike.html">time-like</a> methods,
provided that relevant traits are in the scope.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">Datelike</span>, <span class="ident">Timelike</span>, <span class="ident">Weekday</span>};
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">weekday</span>(), <span class="ident">Weekday</span>::<span class="ident">Fri</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">num_seconds_from_midnight</span>(), <span class="number">33011</span>);</pre></div>
</div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#67-700" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.new" class="method"><code>pub fn <a href="#method.new" class="fnname">new</a>(date: <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>, time: <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#85-87" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDateTime</code> from date and time components.
Equivalent to <a href="./struct.NaiveDate.html#method.and_time"><code>date.and_time(time)</code></a>
and many other helper constructors on <code>NaiveDate</code>.</p>
<h1 id="example-1" class="section-header"><a href="#example-1">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveTime</span>, <span class="ident">NaiveDateTime</span>};
<span class="kw">let</span> <span class="ident">d</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">6</span>, <span class="number">3</span>);
<span class="kw">let</span> <span class="ident">t</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms_milli</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>, <span class="number">789</span>);
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveDateTime</span>::<span class="ident">new</span>(<span class="ident">d</span>, <span class="ident">t</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">date</span>(), <span class="ident">d</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">time</span>(), <span class="ident">t</span>);</pre></div>
</div><h4 id="method.from_timestamp" class="method"><code>pub fn <a href="#method.from_timestamp" class="fnname">from_timestamp</a>(secs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>, nsecs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#115-118" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDateTime</code> corresponding to a UTC date and time,
from the number of non-leap seconds
since the midnight UTC on January 1, 1970 (aka &quot;UNIX timestamp&quot;)
and the number of nanoseconds since the last whole non-leap second.</p>
<p>For a non-naive version of this function see
<a href="../offset/trait.TimeZone.html#method.timestamp"><code>TimeZone::timestamp</code></a>.</p>
<p>The nanosecond part can exceed 1,000,000,000 in order to represent the
<a href="./struct.NaiveTime.html#leap-second-handling">leap second</a>. (The true &quot;UNIX
timestamp&quot; cannot represent a leap second unambiguously.)</p>
<p>Panics on the out-of-range number of seconds and/or invalid nanosecond.</p>
<h1 id="example-2" class="section-header"><a href="#example-2">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDateTime</span>, <span class="ident">NaiveDate</span>};
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveDateTime</span>::<span class="ident">from_timestamp</span>(<span class="number">0</span>, <span class="number">42_000_000</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>, <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">1970</span>, <span class="number">1</span>, <span class="number">1</span>).<span class="ident">and_hms_milli</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">42</span>));
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveDateTime</span>::<span class="ident">from_timestamp</span>(<span class="number">1_000_000_000</span>, <span class="number">0</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>, <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2001</span>, <span class="number">9</span>, <span class="number">9</span>).<span class="ident">and_hms</span>(<span class="number">1</span>, <span class="number">46</span>, <span class="number">40</span>));</pre></div>
</div><h4 id="method.from_timestamp_opt" class="method"><code>pub fn <a href="#method.from_timestamp_opt" class="fnname">from_timestamp_opt</a>(secs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>, nsecs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#146-157" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDateTime</code> corresponding to a UTC date and time,
from the number of non-leap seconds
since the midnight UTC on January 1, 1970 (aka &quot;UNIX timestamp&quot;)
and the number of nanoseconds since the last whole non-leap second.</p>
<p>The nanosecond part can exceed 1,000,000,000
in order to represent the <a href="./struct.NaiveTime.html#leap-second-handling">leap second</a>.
(The true &quot;UNIX timestamp&quot; cannot represent a leap second unambiguously.)</p>
<p>Returns <code>None</code> on the out-of-range number of seconds and/or invalid nanosecond.</p>
<h1 id="example-3" class="section-header"><a href="#example-3">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDateTime</span>, <span class="ident">NaiveDate</span>};
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">i64</span>;
<span class="kw">let</span> <span class="ident">from_timestamp_opt</span> <span class="op">=</span> <span class="ident">NaiveDateTime</span>::<span class="ident">from_timestamp_opt</span>;
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_timestamp_opt</span>(<span class="number">0</span>, <span class="number">0</span>).<span class="ident">is_some</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_timestamp_opt</span>(<span class="number">0</span>, <span class="number">999_999_999</span>).<span class="ident">is_some</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_timestamp_opt</span>(<span class="number">0</span>, <span class="number">1_500_000_000</span>).<span class="ident">is_some</span>()); <span class="comment">// leap second</span>
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_timestamp_opt</span>(<span class="number">0</span>, <span class="number">2_000_000_000</span>).<span class="ident">is_none</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_timestamp_opt</span>(<span class="ident">i64</span>::<span class="ident">MAX</span>, <span class="number">0</span>).<span class="ident">is_none</span>());</pre></div>
</div><h4 id="method.parse_from_str" class="method"><code>pub fn <a href="#method.parse_from_str" class="fnname">parse_from_str</a>(s: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, fmt: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="type" href="../../chrono/format/type.ParseResult.html" title="type chrono::format::ParseResult">ParseResult</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#220-224" title="goto source code">[src]</a></h4><div class="docblock"><p>Parses a string with the specified format string and returns a new <code>NaiveDateTime</code>.
See the <a href="../format/strftime/index.html"><code>format::strftime</code> module</a>
on the supported escape sequences.</p>
<h1 id="example-4" class="section-header"><a href="#example-4">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDateTime</span>, <span class="ident">NaiveDate</span>};
<span class="kw">let</span> <span class="ident">parse_from_str</span> <span class="op">=</span> <span class="ident">NaiveDateTime</span>::<span class="ident">parse_from_str</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parse_from_str</span>(<span class="string">&quot;2015-09-05 23:56:04&quot;</span>, <span class="string">&quot;%Y-%m-%d %H:%M:%S&quot;</span>),
<span class="prelude-val">Ok</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">5</span>).<span class="ident">and_hms</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parse_from_str</span>(<span class="string">&quot;5sep2015pm012345.6789&quot;</span>, <span class="string">&quot;%d%b%Y%p%I%M%S%.f&quot;</span>),
<span class="prelude-val">Ok</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">5</span>).<span class="ident">and_hms_micro</span>(<span class="number">13</span>, <span class="number">23</span>, <span class="number">45</span>, <span class="number">678_900</span>)));</pre></div>
<p>Offset is ignored for the purpose of parsing.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parse_from_str</span>(<span class="string">&quot;2014-5-17T12:34:56+09:30&quot;</span>, <span class="string">&quot;%Y-%m-%dT%H:%M:%S%z&quot;</span>),
<span class="prelude-val">Ok</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">5</span>, <span class="number">17</span>).<span class="ident">and_hms</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>)));</pre></div>
<p><a href="./struct.NaiveTime.html#leap-second-handling">Leap seconds</a> are correctly handled by
treating any time of the form <code>hh:mm:60</code> as a leap second.
(This equally applies to the formatting, so the round trip is possible.)</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parse_from_str</span>(<span class="string">&quot;2015-07-01 08:59:60.123&quot;</span>, <span class="string">&quot;%Y-%m-%d %H:%M:%S%.f&quot;</span>),
<span class="prelude-val">Ok</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">7</span>, <span class="number">1</span>).<span class="ident">and_hms_milli</span>(<span class="number">8</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">1_123</span>)));</pre></div>
<p>Missing seconds are assumed to be zero,
but out-of-bound times or insufficient fields are errors otherwise.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parse_from_str</span>(<span class="string">&quot;94/9/4 7:15&quot;</span>, <span class="string">&quot;%y/%m/%d %H:%M&quot;</span>),
<span class="prelude-val">Ok</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">1994</span>, <span class="number">9</span>, <span class="number">4</span>).<span class="ident">and_hms</span>(<span class="number">7</span>, <span class="number">15</span>, <span class="number">0</span>)));
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">parse_from_str</span>(<span class="string">&quot;04m33s&quot;</span>, <span class="string">&quot;%Mm%Ss&quot;</span>).<span class="ident">is_err</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">parse_from_str</span>(<span class="string">&quot;94/9/4 12&quot;</span>, <span class="string">&quot;%y/%m/%d %H&quot;</span>).<span class="ident">is_err</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">parse_from_str</span>(<span class="string">&quot;94/9/4 17:60&quot;</span>, <span class="string">&quot;%y/%m/%d %H:%M&quot;</span>).<span class="ident">is_err</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">parse_from_str</span>(<span class="string">&quot;94/9/4 24:00:00&quot;</span>, <span class="string">&quot;%y/%m/%d %H:%M:%S&quot;</span>).<span class="ident">is_err</span>());</pre></div>
<p>All parsed fields should be consistent to each other, otherwise it's an error.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">fmt</span> <span class="op">=</span> <span class="string">&quot;%Y-%m-%d %H:%M:%S = UNIX timestamp %s&quot;</span>;
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">parse_from_str</span>(<span class="string">&quot;2001-09-09 01:46:39 = UNIX timestamp 999999999&quot;</span>, <span class="ident">fmt</span>).<span class="ident">is_ok</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">parse_from_str</span>(<span class="string">&quot;1970-01-01 00:00:00 = UNIX timestamp 1&quot;</span>, <span class="ident">fmt</span>).<span class="ident">is_err</span>());</pre></div>
</div><h4 id="method.date" class="method"><code>pub fn <a href="#method.date" class="fnname">date</a>(&amp;self) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#237-239" title="goto source code">[src]</a></h4><div class="docblock"><p>Retrieves a date component.</p>
<h1 id="example-5" class="section-header"><a href="#example-5">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveDate</span>;
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">7</span>, <span class="number">8</span>).<span class="ident">and_hms</span>(<span class="number">9</span>, <span class="number">10</span>, <span class="number">11</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">date</span>(), <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">7</span>, <span class="number">8</span>));</pre></div>
</div><h4 id="method.time" class="method"><code>pub fn <a href="#method.time" class="fnname">time</a>(&amp;self) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#252-254" title="goto source code">[src]</a></h4><div class="docblock"><p>Retrieves a time component.</p>
<h1 id="example-6" class="section-header"><a href="#example-6">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveTime</span>};
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">7</span>, <span class="number">8</span>).<span class="ident">and_hms</span>(<span class="number">9</span>, <span class="number">10</span>, <span class="number">11</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">time</span>(), <span class="ident">NaiveTime</span>::<span class="ident">from_hms</span>(<span class="number">9</span>, <span class="number">10</span>, <span class="number">11</span>));</pre></div>
</div><h4 id="method.timestamp" class="method"><code>pub fn <a href="#method.timestamp" class="fnname">timestamp</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#279-284" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the number of non-leap seconds since the midnight on January 1, 1970.</p>
<p>Note that this does <em>not</em> account for the timezone!
The true &quot;UNIX timestamp&quot; would count seconds since the midnight <em>UTC</em> on the epoch.</p>
<h1 id="example-7" class="section-header"><a href="#example-7">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveDate</span>;
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">1970</span>, <span class="number">1</span>, <span class="number">1</span>).<span class="ident">and_hms_milli</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">1</span>, <span class="number">980</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">timestamp</span>(), <span class="number">1</span>);
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2001</span>, <span class="number">9</span>, <span class="number">9</span>).<span class="ident">and_hms</span>(<span class="number">1</span>, <span class="number">46</span>, <span class="number">40</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">timestamp</span>(), <span class="number">1_000_000_000</span>);
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">1969</span>, <span class="number">12</span>, <span class="number">31</span>).<span class="ident">and_hms</span>(<span class="number">23</span>, <span class="number">59</span>, <span class="number">59</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">timestamp</span>(), <span class="op">-</span><span class="number">1</span>);
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="op">-</span><span class="number">1</span>, <span class="number">1</span>, <span class="number">1</span>).<span class="ident">and_hms</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">timestamp</span>(), <span class="op">-</span><span class="number">62198755200</span>);</pre></div>
</div><h4 id="method.timestamp_millis" class="method"><code>pub fn <a href="#method.timestamp_millis" class="fnname">timestamp_millis</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#311-314" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the number of non-leap <em>milliseconds</em> since midnight on January 1, 1970.</p>
<p>Note that this does <em>not</em> account for the timezone!
The true &quot;UNIX timestamp&quot; would count seconds since the midnight <em>UTC</em> on the epoch.</p>
<p>Note also that this does reduce the number of years that can be
represented from ~584 Billion to ~584 Million. (If this is a problem,
please file an issue to let me know what domain needs millisecond
precision over billions of years, I'm curious.)</p>
<h1 id="example-8" class="section-header"><a href="#example-8">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveDate</span>;
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">1970</span>, <span class="number">1</span>, <span class="number">1</span>).<span class="ident">and_hms_milli</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">1</span>, <span class="number">444</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">timestamp_millis</span>(), <span class="number">1_444</span>);
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2001</span>, <span class="number">9</span>, <span class="number">9</span>).<span class="ident">and_hms_milli</span>(<span class="number">1</span>, <span class="number">46</span>, <span class="number">40</span>, <span class="number">555</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">timestamp_millis</span>(), <span class="number">1_000_000_000_555</span>);
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">1969</span>, <span class="number">12</span>, <span class="number">31</span>).<span class="ident">and_hms_milli</span>(<span class="number">23</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">100</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">timestamp_millis</span>(), <span class="op">-</span><span class="number">900</span>);</pre></div>
</div><h4 id="method.timestamp_nanos" class="method"><code>pub fn <a href="#method.timestamp_nanos" class="fnname">timestamp_nanos</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#350-353" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the number of non-leap <em>nanoseconds</em> since midnight on January 1, 1970.</p>
<p>Note that this does <em>not</em> account for the timezone!
The true &quot;UNIX timestamp&quot; would count seconds since the midnight <em>UTC</em> on the epoch.</p>
<h1 id="panics" class="section-header"><a href="#panics">Panics</a></h1>
<p>Note also that this does reduce the number of years that can be
represented from ~584 Billion to ~584 years. The dates that can be
represented as nanoseconds are between 1677-09-21T00:12:44.0 and
2262-04-11T23:47:16.854775804.</p>
<p>(If this is a problem, please file an issue to let me know what domain
needs nanosecond precision over millennia, I'm curious.)</p>
<h1 id="example-9" class="section-header"><a href="#example-9">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>};
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">1970</span>, <span class="number">1</span>, <span class="number">1</span>).<span class="ident">and_hms_nano</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">1</span>, <span class="number">444</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">timestamp_nanos</span>(), <span class="number">1_000_000_444</span>);
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2001</span>, <span class="number">9</span>, <span class="number">9</span>).<span class="ident">and_hms_nano</span>(<span class="number">1</span>, <span class="number">46</span>, <span class="number">40</span>, <span class="number">555</span>);
<span class="kw">const</span> <span class="ident">A_BILLION</span>: <span class="ident">i64</span> <span class="op">=</span> <span class="number">1_000_000_000</span>;
<span class="kw">let</span> <span class="ident">nanos</span> <span class="op">=</span> <span class="ident">dt</span>.<span class="ident">timestamp_nanos</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">nanos</span>, <span class="number">1_000_000_000_000_000_555</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(
<span class="ident">dt</span>,
<span class="ident">NaiveDateTime</span>::<span class="ident">from_timestamp</span>(<span class="ident">nanos</span> <span class="op">/</span> <span class="ident">A_BILLION</span>, (<span class="ident">nanos</span> <span class="op">%</span> <span class="ident">A_BILLION</span>) <span class="kw">as</span> <span class="ident">u32</span>)
);</pre></div>
</div><h4 id="method.timestamp_subsec_millis" class="method"><code>pub fn <a href="#method.timestamp_subsec_millis" class="fnname">timestamp_subsec_millis</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#372-374" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the number of milliseconds since the last whole non-leap second.</p>
<p>The return value ranges from 0 to 999,
or for <a href="./struct.NaiveTime.html#leap-second-handling">leap seconds</a>, to 1,999.</p>
<h1 id="example-10" class="section-header"><a href="#example-10">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveDate</span>;
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">7</span>, <span class="number">8</span>).<span class="ident">and_hms_nano</span>(<span class="number">9</span>, <span class="number">10</span>, <span class="number">11</span>, <span class="number">123_456_789</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">timestamp_subsec_millis</span>(), <span class="number">123</span>);
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">7</span>, <span class="number">1</span>).<span class="ident">and_hms_nano</span>(<span class="number">8</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">1_234_567_890</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">timestamp_subsec_millis</span>(), <span class="number">1_234</span>);</pre></div>
</div><h4 id="method.timestamp_subsec_micros" class="method"><code>pub fn <a href="#method.timestamp_subsec_micros" class="fnname">timestamp_subsec_micros</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#393-395" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the number of microseconds since the last whole non-leap second.</p>
<p>The return value ranges from 0 to 999,999,
or for <a href="./struct.NaiveTime.html#leap-second-handling">leap seconds</a>, to 1,999,999.</p>
<h1 id="example-11" class="section-header"><a href="#example-11">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveDate</span>;
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">7</span>, <span class="number">8</span>).<span class="ident">and_hms_nano</span>(<span class="number">9</span>, <span class="number">10</span>, <span class="number">11</span>, <span class="number">123_456_789</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">timestamp_subsec_micros</span>(), <span class="number">123_456</span>);
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">7</span>, <span class="number">1</span>).<span class="ident">and_hms_nano</span>(<span class="number">8</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">1_234_567_890</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">timestamp_subsec_micros</span>(), <span class="number">1_234_567</span>);</pre></div>
</div><h4 id="method.timestamp_subsec_nanos" class="method"><code>pub fn <a href="#method.timestamp_subsec_nanos" class="fnname">timestamp_subsec_nanos</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#414-416" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the number of nanoseconds since the last whole non-leap second.</p>
<p>The return value ranges from 0 to 999,999,999,
or for <a href="./struct.NaiveTime.html#leap-second-handling">leap seconds</a>, to 1,999,999,999.</p>
<h1 id="example-12" class="section-header"><a href="#example-12">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveDate</span>;
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">7</span>, <span class="number">8</span>).<span class="ident">and_hms_nano</span>(<span class="number">9</span>, <span class="number">10</span>, <span class="number">11</span>, <span class="number">123_456_789</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">timestamp_subsec_nanos</span>(), <span class="number">123_456_789</span>);
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">7</span>, <span class="number">1</span>).<span class="ident">and_hms_nano</span>(<span class="number">8</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">1_234_567_890</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">timestamp_subsec_nanos</span>(), <span class="number">1_234_567_890</span>);</pre></div>
</div><h4 id="method.checked_add_signed" class="method"><code>pub fn <a href="#method.checked_add_signed" class="fnname">checked_add_signed</a>(self, rhs: <a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#489-499" title="goto source code">[src]</a></h4><div class="docblock"><p>Adds given <code>Duration</code> to the current date and time.</p>
<p>As a part of Chrono's <a href="./struct.NaiveTime.html#leap-second-handling">leap second handling</a>,
the addition assumes that <strong>there is no leap second ever</strong>,
except when the <code>NaiveDateTime</code> itself represents a leap second
in which case the assumption becomes that <strong>there is exactly a single leap second ever</strong>.</p>
<p>Returns <code>None</code> when it will result in overflow.</p>
<h1 id="example-13" class="section-header"><a href="#example-13">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">Duration</span>, <span class="ident">NaiveDate</span>};
<span class="kw">let</span> <span class="ident">from_ymd</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>;
<span class="kw">let</span> <span class="ident">d</span> <span class="op">=</span> <span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">7</span>, <span class="number">8</span>);
<span class="kw">let</span> <span class="ident">hms</span> <span class="op">=</span> <span class="op">|</span><span class="ident">h</span>, <span class="ident">m</span>, <span class="ident">s</span><span class="op">|</span> <span class="ident">d</span>.<span class="ident">and_hms</span>(<span class="ident">h</span>, <span class="ident">m</span>, <span class="ident">s</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>).<span class="ident">checked_add_signed</span>(<span class="ident">Duration</span>::<span class="ident">zero</span>()),
<span class="prelude-val">Some</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>).<span class="ident">checked_add_signed</span>(<span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">1</span>)),
<span class="prelude-val">Some</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">8</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>).<span class="ident">checked_add_signed</span>(<span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="op">-</span><span class="number">1</span>)),
<span class="prelude-val">Some</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">6</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>).<span class="ident">checked_add_signed</span>(<span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">3600</span> <span class="op">+</span> <span class="number">60</span>)),
<span class="prelude-val">Some</span>(<span class="ident">hms</span>(<span class="number">4</span>, <span class="number">6</span>, <span class="number">7</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>).<span class="ident">checked_add_signed</span>(<span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">86_400</span>)),
<span class="prelude-val">Some</span>(<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">7</span>, <span class="number">9</span>).<span class="ident">and_hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>)));
<span class="kw">let</span> <span class="ident">hmsm</span> <span class="op">=</span> <span class="op">|</span><span class="ident">h</span>, <span class="ident">m</span>, <span class="ident">s</span>, <span class="ident">milli</span><span class="op">|</span> <span class="ident">d</span>.<span class="ident">and_hms_milli</span>(<span class="ident">h</span>, <span class="ident">m</span>, <span class="ident">s</span>, <span class="ident">milli</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">980</span>).<span class="ident">checked_add_signed</span>(<span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">450</span>)),
<span class="prelude-val">Some</span>(<span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">8</span>, <span class="number">430</span>)));</pre></div>
<p>Overflow returns <code>None</code>.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>).<span class="ident">checked_add_signed</span>(<span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">1_000_000_000</span>)), <span class="prelude-val">None</span>);</pre></div>
<p>Leap seconds are handled,
but the addition assumes that it is the only leap second happened.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">leap</span> <span class="op">=</span> <span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">1_300</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span>.<span class="ident">checked_add_signed</span>(<span class="ident">Duration</span>::<span class="ident">zero</span>()),
<span class="prelude-val">Some</span>(<span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">1_300</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span>.<span class="ident">checked_add_signed</span>(<span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="op">-</span><span class="number">500</span>)),
<span class="prelude-val">Some</span>(<span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">800</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span>.<span class="ident">checked_add_signed</span>(<span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">500</span>)),
<span class="prelude-val">Some</span>(<span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">1_800</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span>.<span class="ident">checked_add_signed</span>(<span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">800</span>)),
<span class="prelude-val">Some</span>(<span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">6</span>, <span class="number">0</span>, <span class="number">100</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span>.<span class="ident">checked_add_signed</span>(<span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">10</span>)),
<span class="prelude-val">Some</span>(<span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">6</span>, <span class="number">9</span>, <span class="number">300</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span>.<span class="ident">checked_add_signed</span>(<span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="op">-</span><span class="number">10</span>)),
<span class="prelude-val">Some</span>(<span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">50</span>, <span class="number">300</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span>.<span class="ident">checked_add_signed</span>(<span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">1</span>)),
<span class="prelude-val">Some</span>(<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">7</span>, <span class="number">9</span>).<span class="ident">and_hms_milli</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">300</span>)));</pre></div>
</div><h4 id="method.checked_sub_signed" class="method"><code>pub fn <a href="#method.checked_sub_signed" class="fnname">checked_sub_signed</a>(self, rhs: <a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#568-578" title="goto source code">[src]</a></h4><div class="docblock"><p>Subtracts given <code>Duration</code> from the current date and time.</p>
<p>As a part of Chrono's <a href="./struct.NaiveTime.html#leap-second-handling">leap second handling</a>,
the subtraction assumes that <strong>there is no leap second ever</strong>,
except when the <code>NaiveDateTime</code> itself represents a leap second
in which case the assumption becomes that <strong>there is exactly a single leap second ever</strong>.</p>
<p>Returns <code>None</code> when it will result in overflow.</p>
<h1 id="example-14" class="section-header"><a href="#example-14">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">Duration</span>, <span class="ident">NaiveDate</span>};
<span class="kw">let</span> <span class="ident">from_ymd</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>;
<span class="kw">let</span> <span class="ident">d</span> <span class="op">=</span> <span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">7</span>, <span class="number">8</span>);
<span class="kw">let</span> <span class="ident">hms</span> <span class="op">=</span> <span class="op">|</span><span class="ident">h</span>, <span class="ident">m</span>, <span class="ident">s</span><span class="op">|</span> <span class="ident">d</span>.<span class="ident">and_hms</span>(<span class="ident">h</span>, <span class="ident">m</span>, <span class="ident">s</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>).<span class="ident">checked_sub_signed</span>(<span class="ident">Duration</span>::<span class="ident">zero</span>()),
<span class="prelude-val">Some</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>).<span class="ident">checked_sub_signed</span>(<span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">1</span>)),
<span class="prelude-val">Some</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">6</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>).<span class="ident">checked_sub_signed</span>(<span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="op">-</span><span class="number">1</span>)),
<span class="prelude-val">Some</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">8</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>).<span class="ident">checked_sub_signed</span>(<span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">3600</span> <span class="op">+</span> <span class="number">60</span>)),
<span class="prelude-val">Some</span>(<span class="ident">hms</span>(<span class="number">2</span>, <span class="number">4</span>, <span class="number">7</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>).<span class="ident">checked_sub_signed</span>(<span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">86_400</span>)),
<span class="prelude-val">Some</span>(<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">7</span>, <span class="number">7</span>).<span class="ident">and_hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>)));
<span class="kw">let</span> <span class="ident">hmsm</span> <span class="op">=</span> <span class="op">|</span><span class="ident">h</span>, <span class="ident">m</span>, <span class="ident">s</span>, <span class="ident">milli</span><span class="op">|</span> <span class="ident">d</span>.<span class="ident">and_hms_milli</span>(<span class="ident">h</span>, <span class="ident">m</span>, <span class="ident">s</span>, <span class="ident">milli</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">450</span>).<span class="ident">checked_sub_signed</span>(<span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">670</span>)),
<span class="prelude-val">Some</span>(<span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">6</span>, <span class="number">780</span>)));</pre></div>
<p>Overflow returns <code>None</code>.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>).<span class="ident">checked_sub_signed</span>(<span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">1_000_000_000</span>)), <span class="prelude-val">None</span>);</pre></div>
<p>Leap seconds are handled,
but the subtraction assumes that it is the only leap second happened.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">leap</span> <span class="op">=</span> <span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">1_300</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span>.<span class="ident">checked_sub_signed</span>(<span class="ident">Duration</span>::<span class="ident">zero</span>()),
<span class="prelude-val">Some</span>(<span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">1_300</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span>.<span class="ident">checked_sub_signed</span>(<span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">200</span>)),
<span class="prelude-val">Some</span>(<span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">1_100</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span>.<span class="ident">checked_sub_signed</span>(<span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">500</span>)),
<span class="prelude-val">Some</span>(<span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">800</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span>.<span class="ident">checked_sub_signed</span>(<span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">60</span>)),
<span class="prelude-val">Some</span>(<span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">0</span>, <span class="number">300</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span>.<span class="ident">checked_sub_signed</span>(<span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">1</span>)),
<span class="prelude-val">Some</span>(<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">7</span>, <span class="number">7</span>).<span class="ident">and_hms_milli</span>(<span class="number">3</span>, <span class="number">6</span>, <span class="number">0</span>, <span class="number">300</span>)));</pre></div>
</div><h4 id="method.signed_duration_since" class="method"><code>pub fn <a href="#method.signed_duration_since" class="fnname">signed_duration_since</a>(self, rhs: <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>) -&gt; <a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#622-624" title="goto source code">[src]</a></h4><div class="docblock"><p>Subtracts another <code>NaiveDateTime</code> from the current date and time.
This does not overflow or underflow at all.</p>
<p>As a part of Chrono's <a href="./struct.NaiveTime.html#leap-second-handling">leap second handling</a>,
the subtraction assumes that <strong>there is no leap second ever</strong>,
except when any of the <code>NaiveDateTime</code>s themselves represents a leap second
in which case the assumption becomes that
<strong>there are exactly one (or two) leap second(s) ever</strong>.</p>
<h1 id="example-15" class="section-header"><a href="#example-15">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">Duration</span>, <span class="ident">NaiveDate</span>};
<span class="kw">let</span> <span class="ident">from_ymd</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>;
<span class="kw">let</span> <span class="ident">d</span> <span class="op">=</span> <span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">7</span>, <span class="number">8</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">and_hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>).<span class="ident">signed_duration_since</span>(<span class="ident">d</span>.<span class="ident">and_hms</span>(<span class="number">2</span>, <span class="number">4</span>, <span class="number">6</span>)),
<span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">3600</span> <span class="op">+</span> <span class="number">60</span> <span class="op">+</span> <span class="number">1</span>));
<span class="comment">// July 8 is 190th day in the year 2016</span>
<span class="kw">let</span> <span class="ident">d0</span> <span class="op">=</span> <span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">1</span>, <span class="number">1</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">and_hms_milli</span>(<span class="number">0</span>, <span class="number">7</span>, <span class="number">6</span>, <span class="number">500</span>).<span class="ident">signed_duration_since</span>(<span class="ident">d0</span>.<span class="ident">and_hms</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>)),
<span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">189</span> <span class="op">*</span> <span class="number">86_400</span> <span class="op">+</span> <span class="number">7</span> <span class="op">*</span> <span class="number">60</span> <span class="op">+</span> <span class="number">6</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">500</span>));</pre></div>
<p>Leap seconds are handled, but the subtraction assumes that
there were no other leap seconds happened.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">leap</span> <span class="op">=</span> <span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">6</span>, <span class="number">30</span>).<span class="ident">and_hms_milli</span>(<span class="number">23</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">1_500</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span>.<span class="ident">signed_duration_since</span>(<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">6</span>, <span class="number">30</span>).<span class="ident">and_hms</span>(<span class="number">23</span>, <span class="number">0</span>, <span class="number">0</span>)),
<span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">3600</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">500</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">7</span>, <span class="number">1</span>).<span class="ident">and_hms</span>(<span class="number">1</span>, <span class="number">0</span>, <span class="number">0</span>).<span class="ident">signed_duration_since</span>(<span class="ident">leap</span>),
<span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">3600</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">500</span>));</pre></div>
</div><h4 id="method.format_with_items" class="method"><code>pub fn <a href="#method.format_with_items" class="fnname">format_with_items</a>&lt;'a, I, B&gt;(&amp;self, items: I) -&gt; <a class="struct" href="../../chrono/format/struct.DelayedFormat.html" title="struct chrono::format::DelayedFormat">DelayedFormat</a>&lt;I&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a>&lt;Item = B&gt; + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;<a class="enum" href="../../chrono/format/enum.Item.html" title="enum chrono::format::Item">Item</a>&lt;'a&gt;&gt;,&nbsp;</span></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#655-661" title="goto source code">[src]</a></h4><div class="docblock"><p>Formats the combined date and time with the specified formatting items.
Otherwise it is the same as the ordinary <a href="#method.format"><code>format</code></a> method.</p>
<p>The <code>Iterator</code> of items should be <code>Clone</code>able,
since the resulting <code>DelayedFormat</code> value may be formatted multiple times.</p>
<h1 id="example-16" class="section-header"><a href="#example-16">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveDate</span>;
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">format</span>::<span class="ident">strftime</span>::<span class="ident">StrftimeItems</span>;
<span class="kw">let</span> <span class="ident">fmt</span> <span class="op">=</span> <span class="ident">StrftimeItems</span>::<span class="ident">new</span>(<span class="string">&quot;%Y-%m-%d %H:%M:%S&quot;</span>);
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">5</span>).<span class="ident">and_hms</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">format_with_items</span>(<span class="ident">fmt</span>.<span class="ident">clone</span>()).<span class="ident">to_string</span>(), <span class="string">&quot;2015-09-05 23:56:04&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">format</span>(<span class="string">&quot;%Y-%m-%d %H:%M:%S&quot;</span>).<span class="ident">to_string</span>(), <span class="string">&quot;2015-09-05 23:56:04&quot;</span>);</pre></div>
<p>The resulting <code>DelayedFormat</code> can be formatted directly via the <code>Display</code> trait.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">dt</span>.<span class="ident">format_with_items</span>(<span class="ident">fmt</span>)), <span class="string">&quot;2015-09-05 23:56:04&quot;</span>);</pre></div>
</div><h4 id="method.format" class="method"><code>pub fn <a href="#method.format" class="fnname">format</a>&lt;'a&gt;(&amp;self, fmt: &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="struct" href="../../chrono/format/struct.DelayedFormat.html" title="struct chrono::format::DelayedFormat">DelayedFormat</a>&lt;<a class="struct" href="../../chrono/format/strftime/struct.StrftimeItems.html" title="struct chrono::format::strftime::StrftimeItems">StrftimeItems</a>&lt;'a&gt;&gt;</code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#697-699" title="goto source code">[src]</a></h4><div class="docblock"><p>Formats the combined date and time with the specified format string.
See the <a href="../format/strftime/index.html"><code>format::strftime</code> module</a>
on the supported escape sequences.</p>
<p>This returns a <code>DelayedFormat</code>,
which gets converted to a string only when actual formatting happens.
You may use the <code>to_string</code> method to get a <code>String</code>,
or just feed it into <code>print!</code> and other formatting macros.
(In this way it avoids the redundant memory allocation.)</p>
<p>A wrong format string does <em>not</em> issue an error immediately.
Rather, converting or formatting the <code>DelayedFormat</code> fails.
You are recommended to immediately use <code>DelayedFormat</code> for this reason.</p>
<h1 id="example-17" class="section-header"><a href="#example-17">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveDate</span>;
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">5</span>).<span class="ident">and_hms</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">format</span>(<span class="string">&quot;%Y-%m-%d %H:%M:%S&quot;</span>).<span class="ident">to_string</span>(), <span class="string">&quot;2015-09-05 23:56:04&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">format</span>(<span class="string">&quot;around %l %p on %b %-d&quot;</span>).<span class="ident">to_string</span>(), <span class="string">&quot;around 11 PM on Sep 5&quot;</span>);</pre></div>
<p>The resulting <code>DelayedFormat</code> can be formatted directly via the <code>Display</code> trait.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">dt</span>.<span class="ident">format</span>(<span class="string">&quot;%Y-%m-%d %H:%M:%S&quot;</span>)), <span class="string">&quot;2015-09-05 23:56:04&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">dt</span>.<span class="ident">format</span>(<span class="string">&quot;around %l %p on %b %-d&quot;</span>)), <span class="string">&quot;around 11 PM on Sep 5&quot;</span>);</pre></div>
</div></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Add%3CDuration%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html" title="trait core::ops::arith::Add">Add</a>&lt;<a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>&gt; for <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a href="#impl-Add%3CDuration%3E" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#1252-1259" title="goto source code">[src]</a></h3><div class="docblock"><p>An addition of <code>Duration</code> to <code>NaiveDateTime</code> yields another <code>NaiveDateTime</code>.</p>
<p>As a part of Chrono's <a href="./struct.NaiveTime.html#leap-second-handling">leap second handling</a>,
the addition assumes that <strong>there is no leap second ever</strong>,
except when the <code>NaiveDateTime</code> itself represents a leap second
in which case the assumption becomes that <strong>there is exactly a single leap second ever</strong>.</p>
<p>Panics on underflow or overflow.
Use <a href="#method.checked_add_signed"><code>NaiveDateTime::checked_add_signed</code></a> to detect that.</p>
<h1 id="example-45" class="section-header"><a href="#example-45">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">Duration</span>, <span class="ident">NaiveDate</span>};
<span class="kw">let</span> <span class="ident">from_ymd</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>;
<span class="kw">let</span> <span class="ident">d</span> <span class="op">=</span> <span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">7</span>, <span class="number">8</span>);
<span class="kw">let</span> <span class="ident">hms</span> <span class="op">=</span> <span class="op">|</span><span class="ident">h</span>, <span class="ident">m</span>, <span class="ident">s</span><span class="op">|</span> <span class="ident">d</span>.<span class="ident">and_hms</span>(<span class="ident">h</span>, <span class="ident">m</span>, <span class="ident">s</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">zero</span>(), <span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">1</span>), <span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">8</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="op">-</span><span class="number">1</span>), <span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">6</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">3600</span> <span class="op">+</span> <span class="number">60</span>), <span class="ident">hms</span>(<span class="number">4</span>, <span class="number">6</span>, <span class="number">7</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">86_400</span>),
<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">7</span>, <span class="number">9</span>).<span class="ident">and_hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">365</span>),
<span class="ident">from_ymd</span>(<span class="number">2017</span>, <span class="number">7</span>, <span class="number">8</span>).<span class="ident">and_hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>));
<span class="kw">let</span> <span class="ident">hmsm</span> <span class="op">=</span> <span class="op">|</span><span class="ident">h</span>, <span class="ident">m</span>, <span class="ident">s</span>, <span class="ident">milli</span><span class="op">|</span> <span class="ident">d</span>.<span class="ident">and_hms_milli</span>(<span class="ident">h</span>, <span class="ident">m</span>, <span class="ident">s</span>, <span class="ident">milli</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">980</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">450</span>), <span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">8</span>, <span class="number">430</span>));</pre></div>
<p>Leap seconds are handled,
but the addition assumes that it is the only leap second happened.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">leap</span> <span class="op">=</span> <span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">1_300</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">zero</span>(), <span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">1_300</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="op">-</span><span class="number">500</span>), <span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">800</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">500</span>), <span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">1_800</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">800</span>), <span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">6</span>, <span class="number">0</span>, <span class="number">100</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">10</span>), <span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">6</span>, <span class="number">9</span>, <span class="number">300</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="op">-</span><span class="number">10</span>), <span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">50</span>, <span class="number">300</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">1</span>),
<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">7</span>, <span class="number">9</span>).<span class="ident">and_hms_milli</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">300</span>));</pre></div>
</div><div class="impl-items"><h4 id="associatedtype.Output-4" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#associatedtype.Output" class="type">Output</a> = <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>+</code> operator.</p>
</div><h4 id="method.add-1" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add" class="fnname">add</a>(self, rhs: <a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a>) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#1256-1258" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>+</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add">Read more</a></p>
</div></div><h3 id="impl-Add%3CFixedOffset%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html" title="trait core::ops::arith::Add">Add</a>&lt;<a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>&gt; for <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a href="#impl-Add%3CFixedOffset%3E" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#182-189" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Output-3" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#associatedtype.Output" class="type">Output</a> = <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>+</code> operator.</p>
</div><h4 id="method.add" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add" class="fnname">add</a>(self, rhs: <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#186-188" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>+</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add">Read more</a></p>
</div></div><h3 id="impl-AddAssign%3CDuration%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.AddAssign.html" title="trait core::ops::arith::AddAssign">AddAssign</a>&lt;<a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>&gt; for <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a href="#impl-AddAssign%3CDuration%3E" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#1261-1266" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.add_assign" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.AddAssign.html#tymethod.add_assign" class="fnname">add_assign</a>(&amp;mut self, rhs: <a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a>)</code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#1263-1265" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>+=</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.AddAssign.html#tymethod.add_assign">Read more</a></p>
</div></div><h3 id="impl-Clone" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a href="#impl-Clone" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#61" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&amp;self) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#61" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id="method.clone_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&amp;mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self)</code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#128-130" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3 id="impl-Copy" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a href="#impl-Copy" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#61" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Datelike" class="impl"><code class="in-band">impl <a class="trait" href="../../chrono/trait.Datelike.html" title="trait chrono::Datelike">Datelike</a> for <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a href="#impl-Datelike" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#702-1018" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.year" class="method"><code>fn <a href="../../chrono/trait.Datelike.html#tymethod.year" class="fnname">year</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#716-718" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the year number in the <a href="./index.html#calendar-date">calendar date</a>.</p>
<p>See also the <a href="./struct.NaiveDate.html#method.year"><code>NaiveDate::year</code></a> method.</p>
<h1 id="example-18" class="section-header"><a href="#example-18">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Datelike</span>};
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">25</span>).<span class="ident">and_hms</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">year</span>(), <span class="number">2015</span>);</pre></div>
</div><h4 id="method.month" class="method"><code>fn <a href="../../chrono/trait.Datelike.html#tymethod.month" class="fnname">month</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#735-737" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the month number starting from 1.</p>
<p>The return value ranges from 1 to 12.</p>
<p>See also the <a href="./struct.NaiveDate.html#method.month"><code>NaiveDate::month</code></a> method.</p>
<h1 id="example-19" class="section-header"><a href="#example-19">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Datelike</span>};
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">25</span>).<span class="ident">and_hms</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">month</span>(), <span class="number">9</span>);</pre></div>
</div><h4 id="method.month0" class="method"><code>fn <a href="../../chrono/trait.Datelike.html#tymethod.month0" class="fnname">month0</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#754-756" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the month number starting from 0.</p>
<p>The return value ranges from 0 to 11.</p>
<p>See also the <a href="./struct.NaiveDate.html#method.month0"><code>NaiveDate::month0</code></a> method.</p>
<h1 id="example-20" class="section-header"><a href="#example-20">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Datelike</span>};
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">25</span>).<span class="ident">and_hms</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">month0</span>(), <span class="number">8</span>);</pre></div>
</div><h4 id="method.day" class="method"><code>fn <a href="../../chrono/trait.Datelike.html#tymethod.day" class="fnname">day</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#773-775" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the day of month starting from 1.</p>
<p>The return value ranges from 1 to 31. (The last day of month differs by months.)</p>
<p>See also the <a href="./struct.NaiveDate.html#method.day"><code>NaiveDate::day</code></a> method.</p>
<h1 id="example-21" class="section-header"><a href="#example-21">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Datelike</span>};
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">25</span>).<span class="ident">and_hms</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">day</span>(), <span class="number">25</span>);</pre></div>
</div><h4 id="method.day0" class="method"><code>fn <a href="../../chrono/trait.Datelike.html#tymethod.day0" class="fnname">day0</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#792-794" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the day of month starting from 0.</p>
<p>The return value ranges from 0 to 30. (The last day of month differs by months.)</p>
<p>See also the <a href="./struct.NaiveDate.html#method.day0"><code>NaiveDate::day0</code></a> method.</p>
<h1 id="example-22" class="section-header"><a href="#example-22">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Datelike</span>};
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">25</span>).<span class="ident">and_hms</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">day0</span>(), <span class="number">24</span>);</pre></div>
</div><h4 id="method.ordinal" class="method"><code>fn <a href="../../chrono/trait.Datelike.html#tymethod.ordinal" class="fnname">ordinal</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#811-813" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the day of year starting from 1.</p>
<p>The return value ranges from 1 to 366. (The last day of year differs by years.)</p>
<p>See also the <a href="./struct.NaiveDate.html#method.ordinal"><code>NaiveDate::ordinal</code></a> method.</p>
<h1 id="example-23" class="section-header"><a href="#example-23">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Datelike</span>};
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">25</span>).<span class="ident">and_hms</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">ordinal</span>(), <span class="number">268</span>);</pre></div>
</div><h4 id="method.ordinal0" class="method"><code>fn <a href="../../chrono/trait.Datelike.html#tymethod.ordinal0" class="fnname">ordinal0</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#830-832" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the day of year starting from 0.</p>
<p>The return value ranges from 0 to 365. (The last day of year differs by years.)</p>
<p>See also the <a href="./struct.NaiveDate.html#method.ordinal0"><code>NaiveDate::ordinal0</code></a> method.</p>
<h1 id="example-24" class="section-header"><a href="#example-24">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Datelike</span>};
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">25</span>).<span class="ident">and_hms</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">ordinal0</span>(), <span class="number">267</span>);</pre></div>
</div><h4 id="method.weekday" class="method"><code>fn <a href="../../chrono/trait.Datelike.html#tymethod.weekday" class="fnname">weekday</a>(&amp;self) -&gt; <a class="enum" href="../../chrono/enum.Weekday.html" title="enum chrono::Weekday">Weekday</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#847-849" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the day of week.</p>
<p>See also the <a href="./struct.NaiveDate.html#method.weekday"><code>NaiveDate::weekday</code></a> method.</p>
<h1 id="example-25" class="section-header"><a href="#example-25">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Datelike</span>, <span class="ident">Weekday</span>};
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">25</span>).<span class="ident">and_hms</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">weekday</span>(), <span class="ident">Weekday</span>::<span class="ident">Fri</span>);</pre></div>
</div><h4 id="method.iso_week" class="method hidden"><code>fn <a href="../../chrono/trait.Datelike.html#tymethod.iso_week" class="fnname">iso_week</a>(&amp;self) -&gt; <a class="struct" href="../../chrono/naive/struct.IsoWeek.html" title="struct chrono::naive::IsoWeek">IsoWeek</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#852-854" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the ISO week.</p>
</div><h4 id="method.with_year" class="method"><code>fn <a href="../../chrono/trait.Datelike.html#tymethod.with_year" class="fnname">with_year</a>(&amp;self, year: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#873-875" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDateTime</code> with the year number changed.</p>
<p>Returns <code>None</code> when the resulting <code>NaiveDateTime</code> would be invalid.</p>
<p>See also the
<a href="./struct.NaiveDate.html#method.with_year"><code>NaiveDate::with_year</code></a> method.</p>
<h1 id="example-26" class="section-header"><a href="#example-26">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Datelike</span>};
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">25</span>).<span class="ident">and_hms</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_year</span>(<span class="number">2016</span>), <span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">9</span>, <span class="number">25</span>).<span class="ident">and_hms</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_year</span>(<span class="op">-</span><span class="number">308</span>), <span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="op">-</span><span class="number">308</span>, <span class="number">9</span>, <span class="number">25</span>).<span class="ident">and_hms</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>)));</pre></div>
</div><h4 id="method.with_month" class="method"><code>fn <a href="../../chrono/trait.Datelike.html#tymethod.with_month" class="fnname">with_month</a>(&amp;self, month: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#895-897" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDateTime</code> with the month number (starting from 1) changed.</p>
<p>Returns <code>None</code> when the resulting <code>NaiveDateTime</code> would be invalid.</p>
<p>See also the
<a href="./struct.NaiveDate.html#method.with_month"><code>NaiveDate::with_month</code></a> method.</p>
<h1 id="example-27" class="section-header"><a href="#example-27">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Datelike</span>};
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">30</span>).<span class="ident">and_hms</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_month</span>(<span class="number">10</span>), <span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">10</span>, <span class="number">30</span>).<span class="ident">and_hms</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_month</span>(<span class="number">13</span>), <span class="prelude-val">None</span>); <span class="comment">// no month 13</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_month</span>(<span class="number">2</span>), <span class="prelude-val">None</span>); <span class="comment">// no February 30</span></pre></div>
</div><h4 id="method.with_month0" class="method"><code>fn <a href="../../chrono/trait.Datelike.html#tymethod.with_month0" class="fnname">with_month0</a>(&amp;self, month0: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#917-919" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDateTime</code> with the month number (starting from 0) changed.</p>
<p>Returns <code>None</code> when the resulting <code>NaiveDateTime</code> would be invalid.</p>
<p>See also the
<a href="./struct.NaiveDate.html#method.with_month0"><code>NaiveDate::with_month0</code></a> method.</p>
<h1 id="example-28" class="section-header"><a href="#example-28">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Datelike</span>};
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">30</span>).<span class="ident">and_hms</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_month0</span>(<span class="number">9</span>), <span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">10</span>, <span class="number">30</span>).<span class="ident">and_hms</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_month0</span>(<span class="number">12</span>), <span class="prelude-val">None</span>); <span class="comment">// no month 13</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_month0</span>(<span class="number">1</span>), <span class="prelude-val">None</span>); <span class="comment">// no February 30</span></pre></div>
</div><h4 id="method.with_day" class="method"><code>fn <a href="../../chrono/trait.Datelike.html#tymethod.with_day" class="fnname">with_day</a>(&amp;self, day: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#938-940" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDateTime</code> with the day of month (starting from 1) changed.</p>
<p>Returns <code>None</code> when the resulting <code>NaiveDateTime</code> would be invalid.</p>
<p>See also the
<a href="./struct.NaiveDate.html#method.with_day"><code>NaiveDate::with_day</code></a> method.</p>
<h1 id="example-29" class="section-header"><a href="#example-29">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Datelike</span>};
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">and_hms</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_day</span>(<span class="number">30</span>), <span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">30</span>).<span class="ident">and_hms</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_day</span>(<span class="number">31</span>), <span class="prelude-val">None</span>); <span class="comment">// no September 31</span></pre></div>
</div><h4 id="method.with_day0" class="method"><code>fn <a href="../../chrono/trait.Datelike.html#tymethod.with_day0" class="fnname">with_day0</a>(&amp;self, day0: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#959-961" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDateTime</code> with the day of month (starting from 0) changed.</p>
<p>Returns <code>None</code> when the resulting <code>NaiveDateTime</code> would be invalid.</p>
<p>See also the
<a href="./struct.NaiveDate.html#method.with_day0"><code>NaiveDate::with_day0</code></a> method.</p>
<h1 id="example-30" class="section-header"><a href="#example-30">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Datelike</span>};
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">and_hms</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_day0</span>(<span class="number">29</span>), <span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">30</span>).<span class="ident">and_hms</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_day0</span>(<span class="number">30</span>), <span class="prelude-val">None</span>); <span class="comment">// no September 31</span></pre></div>
</div><h4 id="method.with_ordinal" class="method"><code>fn <a href="../../chrono/trait.Datelike.html#tymethod.with_ordinal" class="fnname">with_ordinal</a>(&amp;self, ordinal: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#987-989" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDateTime</code> with the day of year (starting from 1) changed.</p>
<p>Returns <code>None</code> when the resulting <code>NaiveDateTime</code> would be invalid.</p>
<p>See also the
<a href="./struct.NaiveDate.html#method.with_ordinal"><code>NaiveDate::with_ordinal</code></a> method.</p>
<h1 id="example-31" class="section-header"><a href="#example-31">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Datelike</span>};
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">and_hms</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_ordinal</span>(<span class="number">60</span>),
<span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">3</span>, <span class="number">1</span>).<span class="ident">and_hms</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_ordinal</span>(<span class="number">366</span>), <span class="prelude-val">None</span>); <span class="comment">// 2015 had only 365 days</span>
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">and_hms</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_ordinal</span>(<span class="number">60</span>),
<span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">2</span>, <span class="number">29</span>).<span class="ident">and_hms</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_ordinal</span>(<span class="number">366</span>),
<span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">12</span>, <span class="number">31</span>).<span class="ident">and_hms</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>)));</pre></div>
</div><h4 id="method.with_ordinal0" class="method"><code>fn <a href="../../chrono/trait.Datelike.html#tymethod.with_ordinal0" class="fnname">with_ordinal0</a>(&amp;self, ordinal0: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#1015-1017" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDateTime</code> with the day of year (starting from 0) changed.</p>
<p>Returns <code>None</code> when the resulting <code>NaiveDateTime</code> would be invalid.</p>
<p>See also the
<a href="./struct.NaiveDate.html#method.with_ordinal0"><code>NaiveDate::with_ordinal0</code></a> method.</p>
<h1 id="example-32" class="section-header"><a href="#example-32">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Datelike</span>};
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">and_hms</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_ordinal0</span>(<span class="number">59</span>),
<span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">3</span>, <span class="number">1</span>).<span class="ident">and_hms</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_ordinal0</span>(<span class="number">365</span>), <span class="prelude-val">None</span>); <span class="comment">// 2015 had only 365 days</span>
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">and_hms</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_ordinal0</span>(<span class="number">59</span>),
<span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">2</span>, <span class="number">29</span>).<span class="ident">and_hms</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_ordinal0</span>(<span class="number">365</span>),
<span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">12</span>, <span class="number">31</span>).<span class="ident">and_hms</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>)));</pre></div>
</div><h4 id="method.year_ce" class="method hidden"><code>fn <a href="../../chrono/trait.Datelike.html#method.year_ce" class="fnname">year_ce</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code><a class="srclink" href="../../src/chrono/lib.rs.html#1252-1259" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the absolute year number starting from 1 with a boolean flag,
which is false when the year predates the epoch (BCE/BC) and true otherwise (CE/AD). <a href="../../chrono/trait.Datelike.html#method.year_ce">Read more</a></p>
</div><h4 id="method.num_days_from_ce" class="method hidden"><code>fn <a href="../../chrono/trait.Datelike.html#method.num_days_from_ce" class="fnname">num_days_from_ce</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a></code><a class="srclink" href="../../src/chrono/lib.rs.html#1344-1359" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Counts the days in the proleptic Gregorian calendar, with January 1, Year 1 (CE) as day 1. <a href="../../chrono/trait.Datelike.html#method.num_days_from_ce">Read more</a></p>
</div></div><h3 id="impl-Debug" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#1416-1420" title="goto source code">[src]</a></h3><div class="docblock"><p>The <code>Debug</code> output of the naive date and time <code>dt</code> is the same as
<a href="../format/strftime/index.html"><code>dt.format(&quot;%Y-%m-%dT%H:%M:%S%.f&quot;)</code></a>.</p>
<p>The string printed can be readily parsed via the <code>parse</code> method on <code>str</code>.</p>
<p>It should be noted that, for leap seconds not on the minute boundary,
it may print a representation not distinguishable from non-leap seconds.
This doesn't matter in practice, since such leap seconds never happened.
(By the time of the first leap second on 1972-06-30,
every time zone offset around the world has standardized to the 5-minute alignment.)</p>
<h1 id="example-41" class="section-header"><a href="#example-41">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveDate</span>;
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">11</span>, <span class="number">15</span>).<span class="ident">and_hms</span>(<span class="number">7</span>, <span class="number">39</span>, <span class="number">24</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">dt</span>), <span class="string">&quot;2016-11-15T07:39:24&quot;</span>);</pre></div>
<p>Leap seconds may also be used.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">6</span>, <span class="number">30</span>).<span class="ident">and_hms_milli</span>(<span class="number">23</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">1_500</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">dt</span>), <span class="string">&quot;2015-06-30T23:59:60.500&quot;</span>);</pre></div>
</div><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#1417-1419" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id="impl-Display" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a href="#impl-Display" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#1447-1451" title="goto source code">[src]</a></h3><div class="docblock"><p>The <code>Display</code> output of the naive date and time <code>dt</code> is the same as
<a href="../format/strftime/index.html"><code>dt.format(&quot;%Y-%m-%d %H:%M:%S%.f&quot;)</code></a>.</p>
<p>It should be noted that, for leap seconds not on the minute boundary,
it may print a representation not distinguishable from non-leap seconds.
This doesn't matter in practice, since such leap seconds never happened.
(By the time of the first leap second on 1972-06-30,
every time zone offset around the world has standardized to the 5-minute alignment.)</p>
<h1 id="example-42" class="section-header"><a href="#example-42">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveDate</span>;
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">11</span>, <span class="number">15</span>).<span class="ident">and_hms</span>(<span class="number">7</span>, <span class="number">39</span>, <span class="number">24</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">dt</span>), <span class="string">&quot;2016-11-15 07:39:24&quot;</span>);</pre></div>
<p>Leap seconds may also be used.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">6</span>, <span class="number">30</span>).<span class="ident">and_hms_milli</span>(<span class="number">23</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">1_500</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">dt</span>), <span class="string">&quot;2015-06-30 23:59:60.500&quot;</span>);</pre></div>
</div><div class="impl-items"><h4 id="method.fmt-1" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#1448-1450" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id="impl-Eq" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a href="#impl-Eq" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#61" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-FromStr" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html" title="trait core::str::traits::FromStr">FromStr</a> for <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a href="#impl-FromStr" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#1469-1498" title="goto source code">[src]</a></h3><div class="docblock"><p>Parsing a <code>str</code> into a <code>NaiveDateTime</code> uses the same format,
<a href="../format/strftime/index.html"><code>%Y-%m-%dT%H:%M:%S%.f</code></a>, as in <code>Debug</code>.</p>
<h1 id="example-46" class="section-header"><a href="#example-46">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDateTime</span>, <span class="ident">NaiveDate</span>};
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">18</span>).<span class="ident">and_hms</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">&quot;2015-09-18T23:56:04&quot;</span>.<span class="ident">parse</span>::<span class="op">&lt;</span><span class="ident">NaiveDateTime</span><span class="op">&gt;</span>(), <span class="prelude-val">Ok</span>(<span class="ident">dt</span>));
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">12345</span>, <span class="number">6</span>, <span class="number">7</span>).<span class="ident">and_hms_milli</span>(<span class="number">7</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">1_500</span>); <span class="comment">// leap second</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">&quot;+12345-6-7T7:59:60.5&quot;</span>.<span class="ident">parse</span>::<span class="op">&lt;</span><span class="ident">NaiveDateTime</span><span class="op">&gt;</span>(), <span class="prelude-val">Ok</span>(<span class="ident">dt</span>));
<span class="macro">assert</span><span class="macro">!</span>(<span class="string">&quot;foo&quot;</span>.<span class="ident">parse</span>::<span class="op">&lt;</span><span class="ident">NaiveDateTime</span><span class="op">&gt;</span>().<span class="ident">is_err</span>());</pre></div>
</div><div class="impl-items"><h4 id="associatedtype.Err" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#associatedtype.Err" class="type">Err</a> = <a class="struct" href="../../chrono/format/struct.ParseError.html" title="struct chrono::format::ParseError">ParseError</a></code></h4><div class='docblock'><p>The associated error which can be returned from parsing.</p>
</div><h4 id="method.from_str" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#tymethod.from_str" class="fnname">from_str</a>(s: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="type" href="../../chrono/format/type.ParseResult.html" title="type chrono::format::ParseResult">ParseResult</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#1472-1497" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Parses a string <code>s</code> to return a value of this type. <a href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#tymethod.from_str">Read more</a></p>
</div></div><h3 id="impl-Hash" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> for <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a href="#impl-Hash" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#1192-1197" title="goto source code">[src]</a></h3><div class="docblock"><p><code>NaiveDateTime</code> can be used as a key to the hash maps (in principle).</p>
<p>Practically this also takes account of fractional seconds, so it is not recommended.
(For the obvious reason this also distinguishes leap seconds from non-leap seconds.)</p>
</div><div class="impl-items"><h4 id="method.hash" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash" class="fnname">hash</a>&lt;H:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>&gt;(&amp;self, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>H)</code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#1193-1196" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Feeds this value into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash">Read more</a></p>
</div><h4 id="method.hash_slice" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice" class="fnname">hash_slice</a>&lt;H&gt;(data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[Self]</a>, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>H) <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.3.0">1.3.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#184-191" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice">Read more</a></p>
</div></div><h3 id="impl-Ord" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a href="#impl-Ord" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#61" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.cmp" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp" class="fnname">cmp</a>(&amp;self, other: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#61" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method returns an <a href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="Ordering"><code>Ordering</code></a> between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></p>
</div><h4 id="method.max" class="method hidden"><code><span class="docblock attributes">#[must_use]</span>pub fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max" class="fnname">max</a>(self, other: Self) -&gt; Self</code><span class="since" title="Stable since Rust version 1.21.0">1.21.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#719-724" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Compares and returns the maximum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max">Read more</a></p>
</div><h4 id="method.min" class="method hidden"><code><span class="docblock attributes">#[must_use]</span>pub fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min" class="fnname">min</a>(self, other: Self) -&gt; Self</code><span class="since" title="Stable since Rust version 1.21.0">1.21.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#739-744" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Compares and returns the minimum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min">Read more</a></p>
</div><h4 id="method.clamp" class="method hidden"><code><span class="docblock attributes">#[must_use]</span>pub fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp" class="fnname">clamp</a>(self, min: Self, max: Self) -&gt; Self</code><span class="since" title="Stable since Rust version 1.50.0">1.50.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#764-776" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Restrict a value to a certain interval. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp">Read more</a></p>
</div></div><h3 id="impl-PartialEq%3CNaiveDateTime%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>&gt; for <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a href="#impl-PartialEq%3CNaiveDateTime%3E" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#61" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.eq" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq" class="fnname">eq</a>(&amp;self, other: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#61" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id="method.ne" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne" class="fnname">ne</a>(&amp;self, other: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#61" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 id="impl-PartialOrd%3CNaiveDateTime%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>&gt; for <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a href="#impl-PartialOrd%3CNaiveDateTime%3E" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#61" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.partial_cmp" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp" class="fnname">partial_cmp</a>(&amp;self, other: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#61" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
</div><h4 id="method.lt" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt" class="fnname">lt</a>(&amp;self, other: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#61" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
</div><h4 id="method.le" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le" class="fnname">le</a>(&amp;self, other: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#61" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;=</code>
operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
</div><h4 id="method.gt" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt" class="fnname">gt</a>(&amp;self, other: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#61" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
</div><h4 id="method.ge" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge" class="fnname">ge</a>(&amp;self, other: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#61" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;=</code>
operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
</div></div><h3 id="impl-StructuralEq" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a href="#impl-StructuralEq" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#61" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-StructuralPartialEq" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a href="#impl-StructuralPartialEq" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#61" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sub%3CDuration%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html" title="trait core::ops::arith::Sub">Sub</a>&lt;<a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>&gt; for <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a href="#impl-Sub%3CDuration%3E" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#1320-1327" title="goto source code">[src]</a></h3><div class="docblock"><p>A subtraction of <code>Duration</code> from <code>NaiveDateTime</code> yields another <code>NaiveDateTime</code>.
It is the same as the addition with a negated <code>Duration</code>.</p>
<p>As a part of Chrono's <a href="./struct.NaiveTime.html#leap-second-handling">leap second handling</a>,
the addition assumes that <strong>there is no leap second ever</strong>,
except when the <code>NaiveDateTime</code> itself represents a leap second
in which case the assumption becomes that <strong>there is exactly a single leap second ever</strong>.</p>
<p>Panics on underflow or overflow.
Use <a href="#method.checked_sub_signed"><code>NaiveDateTime::checked_sub_signed</code></a> to detect that.</p>
<h1 id="example-43" class="section-header"><a href="#example-43">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">Duration</span>, <span class="ident">NaiveDate</span>};
<span class="kw">let</span> <span class="ident">from_ymd</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>;
<span class="kw">let</span> <span class="ident">d</span> <span class="op">=</span> <span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">7</span>, <span class="number">8</span>);
<span class="kw">let</span> <span class="ident">hms</span> <span class="op">=</span> <span class="op">|</span><span class="ident">h</span>, <span class="ident">m</span>, <span class="ident">s</span><span class="op">|</span> <span class="ident">d</span>.<span class="ident">and_hms</span>(<span class="ident">h</span>, <span class="ident">m</span>, <span class="ident">s</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">zero</span>(), <span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">1</span>), <span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">6</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="op">-</span><span class="number">1</span>), <span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">8</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">3600</span> <span class="op">+</span> <span class="number">60</span>), <span class="ident">hms</span>(<span class="number">2</span>, <span class="number">4</span>, <span class="number">7</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">86_400</span>),
<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">7</span>, <span class="number">7</span>).<span class="ident">and_hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">365</span>),
<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">7</span>, <span class="number">9</span>).<span class="ident">and_hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>));
<span class="kw">let</span> <span class="ident">hmsm</span> <span class="op">=</span> <span class="op">|</span><span class="ident">h</span>, <span class="ident">m</span>, <span class="ident">s</span>, <span class="ident">milli</span><span class="op">|</span> <span class="ident">d</span>.<span class="ident">and_hms_milli</span>(<span class="ident">h</span>, <span class="ident">m</span>, <span class="ident">s</span>, <span class="ident">milli</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">450</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">670</span>), <span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">6</span>, <span class="number">780</span>));</pre></div>
<p>Leap seconds are handled,
but the subtraction assumes that it is the only leap second happened.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">leap</span> <span class="op">=</span> <span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">1_300</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">zero</span>(), <span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">1_300</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">200</span>), <span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">1_100</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">500</span>), <span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">800</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">60</span>), <span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">0</span>, <span class="number">300</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">1</span>),
<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">7</span>, <span class="number">7</span>).<span class="ident">and_hms_milli</span>(<span class="number">3</span>, <span class="number">6</span>, <span class="number">0</span>, <span class="number">300</span>));</pre></div>
</div><div class="impl-items"><h4 id="associatedtype.Output-1" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#associatedtype.Output" class="type">Output</a> = <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>-</code> operator.</p>
</div><h4 id="method.sub-1" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#tymethod.sub" class="fnname">sub</a>(self, rhs: <a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a>) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#1324-1326" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>-</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#tymethod.sub">Read more</a></p>
</div></div><h3 id="impl-Sub%3CFixedOffset%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html" title="trait core::ops::arith::Sub">Sub</a>&lt;<a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>&gt; for <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a href="#impl-Sub%3CFixedOffset%3E" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#191-198" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#associatedtype.Output" class="type">Output</a> = <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>-</code> operator.</p>
</div><h4 id="method.sub" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#tymethod.sub" class="fnname">sub</a>(self, rhs: <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#195-197" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>-</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#tymethod.sub">Read more</a></p>
</div></div><h3 id="impl-Sub%3CNaiveDateTime%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html" title="trait core::ops::arith::Sub">Sub</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>&gt; for <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a href="#impl-Sub%3CNaiveDateTime%3E" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#1380-1387" title="goto source code">[src]</a></h3><div class="docblock"><p>Subtracts another <code>NaiveDateTime</code> from the current date and time.
This does not overflow or underflow at all.</p>
<p>As a part of Chrono's <a href="./struct.NaiveTime.html#leap-second-handling">leap second handling</a>,
the subtraction assumes that <strong>there is no leap second ever</strong>,
except when any of the <code>NaiveDateTime</code>s themselves represents a leap second
in which case the assumption becomes that
<strong>there are exactly one (or two) leap second(s) ever</strong>.</p>
<p>The implementation is a wrapper around
<a href="#method.signed_duration_since"><code>NaiveDateTime::signed_duration_since</code></a>.</p>
<h1 id="example-44" class="section-header"><a href="#example-44">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">Duration</span>, <span class="ident">NaiveDate</span>};
<span class="kw">let</span> <span class="ident">from_ymd</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>;
<span class="kw">let</span> <span class="ident">d</span> <span class="op">=</span> <span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">7</span>, <span class="number">8</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">and_hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>) <span class="op">-</span> <span class="ident">d</span>.<span class="ident">and_hms</span>(<span class="number">2</span>, <span class="number">4</span>, <span class="number">6</span>), <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">3600</span> <span class="op">+</span> <span class="number">60</span> <span class="op">+</span> <span class="number">1</span>));
<span class="comment">// July 8 is 190th day in the year 2016</span>
<span class="kw">let</span> <span class="ident">d0</span> <span class="op">=</span> <span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">1</span>, <span class="number">1</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">and_hms_milli</span>(<span class="number">0</span>, <span class="number">7</span>, <span class="number">6</span>, <span class="number">500</span>) <span class="op">-</span> <span class="ident">d0</span>.<span class="ident">and_hms</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>),
<span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">189</span> <span class="op">*</span> <span class="number">86_400</span> <span class="op">+</span> <span class="number">7</span> <span class="op">*</span> <span class="number">60</span> <span class="op">+</span> <span class="number">6</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">500</span>));</pre></div>
<p>Leap seconds are handled, but the subtraction assumes that
there were no other leap seconds happened.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">leap</span> <span class="op">=</span> <span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">6</span>, <span class="number">30</span>).<span class="ident">and_hms_milli</span>(<span class="number">23</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">1_500</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">-</span> <span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">6</span>, <span class="number">30</span>).<span class="ident">and_hms</span>(<span class="number">23</span>, <span class="number">0</span>, <span class="number">0</span>),
<span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">3600</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">500</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">7</span>, <span class="number">1</span>).<span class="ident">and_hms</span>(<span class="number">1</span>, <span class="number">0</span>, <span class="number">0</span>) <span class="op">-</span> <span class="ident">leap</span>,
<span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">3600</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">500</span>));</pre></div>
</div><div class="impl-items"><h4 id="associatedtype.Output-2" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#associatedtype.Output" class="type">Output</a> = <a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>-</code> operator.</p>
</div><h4 id="method.sub-2" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#tymethod.sub" class="fnname">sub</a>(self, rhs: <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>) -&gt; <a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#1384-1386" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>-</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#tymethod.sub">Read more</a></p>
</div></div><h3 id="impl-SubAssign%3CDuration%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.SubAssign.html" title="trait core::ops::arith::SubAssign">SubAssign</a>&lt;<a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>&gt; for <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a href="#impl-SubAssign%3CDuration%3E" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#1329-1334" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.sub_assign" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.SubAssign.html#tymethod.sub_assign" class="fnname">sub_assign</a>(&amp;mut self, rhs: <a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a>)</code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#1331-1333" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>-=</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.SubAssign.html#tymethod.sub_assign">Read more</a></p>
</div></div><h3 id="impl-Timelike" class="impl"><code class="in-band">impl <a class="trait" href="../../chrono/trait.Timelike.html" title="trait chrono::Timelike">Timelike</a> for <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a href="#impl-Timelike" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#1020-1186" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.hour" class="method"><code>fn <a href="../../chrono/trait.Timelike.html#tymethod.hour" class="fnname">hour</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#1034-1036" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the hour number from 0 to 23.</p>
<p>See also the <a href="./struct.NaiveTime.html#method.hour"><code>NaiveTime::hour</code></a> method.</p>
<h1 id="example-33" class="section-header"><a href="#example-33">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Timelike</span>};
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">and_hms_milli</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>, <span class="number">789</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">hour</span>(), <span class="number">12</span>);</pre></div>
</div><h4 id="method.minute" class="method"><code>fn <a href="../../chrono/trait.Timelike.html#tymethod.minute" class="fnname">minute</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#1051-1053" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the minute number from 0 to 59.</p>
<p>See also the <a href="./struct.NaiveTime.html#method.minute"><code>NaiveTime::minute</code></a> method.</p>
<h1 id="example-34" class="section-header"><a href="#example-34">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Timelike</span>};
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">and_hms_milli</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>, <span class="number">789</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">minute</span>(), <span class="number">34</span>);</pre></div>
</div><h4 id="method.second" class="method"><code>fn <a href="../../chrono/trait.Timelike.html#tymethod.second" class="fnname">second</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#1068-1070" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the second number from 0 to 59.</p>
<p>See also the <a href="./struct.NaiveTime.html#method.second"><code>NaiveTime::second</code></a> method.</p>
<h1 id="example-35" class="section-header"><a href="#example-35">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Timelike</span>};
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">and_hms_milli</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>, <span class="number">789</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">second</span>(), <span class="number">56</span>);</pre></div>
</div><h4 id="method.nanosecond" class="method"><code>fn <a href="../../chrono/trait.Timelike.html#tymethod.nanosecond" class="fnname">nanosecond</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#1088-1090" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the number of nanoseconds since the whole non-leap second.
The range from 1,000,000,000 to 1,999,999,999 represents
the <a href="./struct.NaiveTime.html#leap-second-handling">leap second</a>.</p>
<p>See also the
<a href="./struct.NaiveTime.html#method.nanosecond"><code>NaiveTime::nanosecond</code></a> method.</p>
<h1 id="example-36" class="section-header"><a href="#example-36">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Timelike</span>};
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">and_hms_milli</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>, <span class="number">789</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">nanosecond</span>(), <span class="number">789_000_000</span>);</pre></div>
</div><h4 id="method.with_hour" class="method"><code>fn <a href="../../chrono/trait.Timelike.html#tymethod.with_hour" class="fnname">with_hour</a>(&amp;self, hour: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#1110-1112" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDateTime</code> with the hour number changed.</p>
<p>Returns <code>None</code> when the resulting <code>NaiveDateTime</code> would be invalid.</p>
<p>See also the
<a href="./struct.NaiveTime.html#method.with_hour"><code>NaiveTime::with_hour</code></a> method.</p>
<h1 id="example-37" class="section-header"><a href="#example-37">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Timelike</span>};
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">and_hms_milli</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>, <span class="number">789</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_hour</span>(<span class="number">7</span>),
<span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">and_hms_milli</span>(<span class="number">7</span>, <span class="number">34</span>, <span class="number">56</span>, <span class="number">789</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_hour</span>(<span class="number">24</span>), <span class="prelude-val">None</span>);</pre></div>
</div><h4 id="method.with_minute" class="method"><code>fn <a href="../../chrono/trait.Timelike.html#tymethod.with_minute" class="fnname">with_minute</a>(&amp;self, min: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#1132-1134" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDateTime</code> with the minute number changed.</p>
<p>Returns <code>None</code> when the resulting <code>NaiveDateTime</code> would be invalid.</p>
<p>See also the
<a href="./struct.NaiveTime.html#method.with_minute"><code>NaiveTime::with_minute</code></a> method.</p>
<h1 id="example-38" class="section-header"><a href="#example-38">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Timelike</span>};
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">and_hms_milli</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>, <span class="number">789</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_minute</span>(<span class="number">45</span>),
<span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">and_hms_milli</span>(<span class="number">12</span>, <span class="number">45</span>, <span class="number">56</span>, <span class="number">789</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_minute</span>(<span class="number">60</span>), <span class="prelude-val">None</span>);</pre></div>
</div><h4 id="method.with_second" class="method"><code>fn <a href="../../chrono/trait.Timelike.html#tymethod.with_second" class="fnname">with_second</a>(&amp;self, sec: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#1156-1158" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDateTime</code> with the second number changed.</p>
<p>Returns <code>None</code> when the resulting <code>NaiveDateTime</code> would be invalid.
As with the <a href="#method.second"><code>second</code></a> method,
the input range is restricted to 0 through 59.</p>
<p>See also the
<a href="./struct.NaiveTime.html#method.with_second"><code>NaiveTime::with_second</code></a> method.</p>
<h1 id="example-39" class="section-header"><a href="#example-39">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Timelike</span>};
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">and_hms_milli</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>, <span class="number">789</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_second</span>(<span class="number">17</span>),
<span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">and_hms_milli</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">17</span>, <span class="number">789</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_second</span>(<span class="number">60</span>), <span class="prelude-val">None</span>);</pre></div>
</div><h4 id="method.with_nanosecond" class="method"><code>fn <a href="../../chrono/trait.Timelike.html#tymethod.with_nanosecond" class="fnname">with_nanosecond</a>(&amp;self, nano: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/datetime.rs.html#1183-1185" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDateTime</code> with nanoseconds since the whole non-leap second changed.</p>
<p>Returns <code>None</code> when the resulting <code>NaiveDateTime</code> would be invalid.
As with the <a href="#method.nanosecond"><code>nanosecond</code></a> method,
the input range can exceed 1,000,000,000 for leap seconds.</p>
<p>See also the
<a href="./struct.NaiveTime.html#method.with_nanosecond"><code>NaiveTime::with_nanosecond</code></a>
method.</p>
<h1 id="example-40" class="section-header"><a href="#example-40">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Timelike</span>};
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">and_hms_milli</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>, <span class="number">789</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_nanosecond</span>(<span class="number">333_333_333</span>),
<span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">and_hms_nano</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>, <span class="number">333_333_333</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_nanosecond</span>(<span class="number">1_333_333_333</span>), <span class="comment">// leap second</span>
<span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">and_hms_nano</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>, <span class="number">1_333_333_333</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_nanosecond</span>(<span class="number">2_000_000_000</span>), <span class="prelude-val">None</span>);</pre></div>
</div><h4 id="method.hour12" class="method hidden"><code>fn <a href="../../chrono/trait.Timelike.html#method.hour12" class="fnname">hour12</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code><a class="srclink" href="../../src/chrono/lib.rs.html#1370-1377" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the hour number from 1 to 12 with a boolean flag,
which is false for AM and true for PM. <a href="../../chrono/trait.Timelike.html#method.hour12">Read more</a></p>
</div><h4 id="method.num_seconds_from_midnight" class="method hidden"><code>fn <a href="../../chrono/trait.Timelike.html#method.num_seconds_from_midnight" class="fnname">num_seconds_from_midnight</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../../src/chrono/lib.rs.html#1416-1418" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the number of non-leap seconds past the last midnight.</p>
</div></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></div><h3 id="impl-Borrow%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211-213" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id="impl-BorrowMut%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id="impl-From%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</code><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-Into%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-Into%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -&gt; U</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-ToOwned" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,&nbsp;</span></code><a href="#impl-ToOwned" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Owned" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
</div><h4 id="method.to_owned" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fnname">to_owned</a>(&amp;self) -&gt; T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
</div><h4 id="method.clone_into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fnname">clone_into</a>(&amp;self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T)</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><details><summary><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
</div></div><h3 id="impl-ToString" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-ToString" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2194-2207" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_string" class="method hidden"><code>pub default fn <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string" class="fnname">to_string</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2200-2206" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
</div></div><h3 id="impl-TryFrom%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id="method.try_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-TryInto%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-TryInto%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#575-584" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error-1" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id="method.try_into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#581-583" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "chrono";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
-779
View File
@@ -1,779 +0,0 @@
<!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 `NaiveTime` struct in crate `chrono`."><meta name="keywords" content="rust, rustlang, rust-lang, NaiveTime"><title>chrono::naive::NaiveTime - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[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">&#9776;</div><a href='../../chrono/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Struct NaiveTime</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.format">format</a><a href="#method.format_with_items">format_with_items</a><a href="#method.from_hms">from_hms</a><a href="#method.from_hms_micro">from_hms_micro</a><a href="#method.from_hms_micro_opt">from_hms_micro_opt</a><a href="#method.from_hms_milli">from_hms_milli</a><a href="#method.from_hms_milli_opt">from_hms_milli_opt</a><a href="#method.from_hms_nano">from_hms_nano</a><a href="#method.from_hms_nano_opt">from_hms_nano_opt</a><a href="#method.from_hms_opt">from_hms_opt</a><a href="#method.from_num_seconds_from_midnight">from_num_seconds_from_midnight</a><a href="#method.from_num_seconds_from_midnight_opt">from_num_seconds_from_midnight_opt</a><a href="#method.overflowing_add_signed">overflowing_add_signed</a><a href="#method.overflowing_sub_signed">overflowing_sub_signed</a><a href="#method.parse_from_str">parse_from_str</a><a href="#method.signed_duration_since">signed_duration_since</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Add%3CDuration%3E">Add&lt;Duration&gt;</a><a href="#impl-Add%3CFixedOffset%3E">Add&lt;FixedOffset&gt;</a><a href="#impl-AddAssign%3CDuration%3E">AddAssign&lt;Duration&gt;</a><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Debug">Debug</a><a href="#impl-Display">Display</a><a href="#impl-Eq">Eq</a><a href="#impl-FromStr">FromStr</a><a href="#impl-Hash">Hash</a><a href="#impl-Ord">Ord</a><a href="#impl-PartialEq%3CNaiveTime%3E">PartialEq&lt;NaiveTime&gt;</a><a href="#impl-PartialOrd%3CNaiveTime%3E">PartialOrd&lt;NaiveTime&gt;</a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a><a href="#impl-Sub%3CDuration%3E">Sub&lt;Duration&gt;</a><a href="#impl-Sub%3CFixedOffset%3E">Sub&lt;FixedOffset&gt;</a><a href="#impl-Sub%3CNaiveTime%3E">Sub&lt;NaiveTime&gt;</a><a href="#impl-SubAssign%3CDuration%3E">SubAssign&lt;Duration&gt;</a><a href="#impl-Timelike">Timelike</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><p class="location"><a href="../index.html">chrono</a>::<wbr><a href="index.html">naive</a></p><script>window.sidebarCurrent = {name: "NaiveTime", ty: "struct", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../../src/chrono/naive/time.rs.html#182-185" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="../index.html">chrono</a>::<wbr><a href="index.html">naive</a>::<wbr><a class="struct" href="">NaiveTime</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct NaiveTime { /* fields omitted */ }</pre></div><div class="docblock"><p>ISO 8601 time without timezone.
Allows for the nanosecond precision and optional leap second representation.</p>
<h1 id="leap-second-handling" class="section-header"><a href="#leap-second-handling">Leap Second Handling</a></h1>
<p>Since 1960s, the manmade atomic clock has been so accurate that
it is much more accurate than Earth's own motion.
It became desirable to define the civil time in terms of the atomic clock,
but that risks the desynchronization of the civil time from Earth.
To account for this, the designers of the Coordinated Universal Time (UTC)
made that the UTC should be kept within 0.9 seconds of the observed Earth-bound time.
When the mean solar day is longer than the ideal (86,400 seconds),
the error slowly accumulates and it is necessary to add a <strong>leap second</strong>
to slow the UTC down a bit.
(We may also remove a second to speed the UTC up a bit, but it never happened.)
The leap second, if any, follows 23:59:59 of June 30 or December 31 in the UTC.</p>
<p>Fast forward to the 21st century,
we have seen 26 leap seconds from January 1972 to December 2015.
Yes, 26 seconds. Probably you can read this paragraph within 26 seconds.
But those 26 seconds, and possibly more in the future, are never predictable,
and whether to add a leap second or not is known only before 6 months.
Internet-based clocks (via NTP) do account for known leap seconds,
but the system API normally doesn't (and often can't, with no network connection)
and there is no reliable way to retrieve leap second information.</p>
<p>Chrono does not try to accurately implement leap seconds; it is impossible.
Rather, <strong>it allows for leap seconds but behaves as if there are <em>no other</em> leap seconds.</strong>
Various operations will ignore any possible leap second(s)
except when any of the operands were actually leap seconds.</p>
<p>If you cannot tolerate this behavior,
you must use a separate <code>TimeZone</code> for the International Atomic Time (TAI).
TAI is like UTC but has no leap seconds, and thus slightly differs from UTC.
Chrono does not yet provide such implementation, but it is planned.</p>
<h2 id="representing-leap-seconds" class="section-header"><a href="#representing-leap-seconds">Representing Leap Seconds</a></h2>
<p>The leap second is indicated via fractional seconds more than 1 second.
This makes possible to treat a leap second as the prior non-leap second
if you don't care about sub-second accuracy.
You should use the proper formatting to get the raw leap second.</p>
<p>All methods accepting fractional seconds will accept such values.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveTime</span>, <span class="ident">Utc</span>, <span class="ident">TimeZone</span>};
<span class="kw">let</span> <span class="ident">t</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms_milli</span>(<span class="number">8</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">1_000</span>);
<span class="kw">let</span> <span class="ident">dt1</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">7</span>, <span class="number">1</span>).<span class="ident">and_hms_micro</span>(<span class="number">8</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">1_000_000</span>);
<span class="kw">let</span> <span class="ident">dt2</span> <span class="op">=</span> <span class="ident">Utc</span>.<span class="ident">ymd</span>(<span class="number">2015</span>, <span class="number">6</span>, <span class="number">30</span>).<span class="ident">and_hms_nano</span>(<span class="number">23</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">1_000_000_000</span>);</pre></div>
<p>Note that the leap second can happen anytime given an appropriate time zone;
2015-07-01 01:23:60 would be a proper leap second if UTC+01:24 had existed.
Practically speaking, though, by the time of the first leap second on 1972-06-30,
every time zone offset around the world has standardized to the 5-minute alignment.</p>
<h2 id="date-and-time-arithmetics" class="section-header"><a href="#date-and-time-arithmetics">Date And Time Arithmetics</a></h2>
<p>As a concrete example, let's assume that <code>03:00:60</code> and <code>04:00:60</code> are leap seconds.
In reality, of course, leap seconds are separated by at least 6 months.
We will also use some intuitive concise notations for the explanation.</p>
<p><code>Time + Duration</code>
(short for <a href="#method.overflowing_add_signed"><code>NaiveTime::overflowing_add_signed</code></a>):</p>
<ul>
<li><code>03:00:00 + 1s = 03:00:01</code>.</li>
<li><code>03:00:59 + 60s = 03:02:00</code>.</li>
<li><code>03:00:59 + 1s = 03:01:00</code>.</li>
<li><code>03:00:60 + 1s = 03:01:00</code>.
Note that the sum is identical to the previous.</li>
<li><code>03:00:60 + 60s = 03:01:59</code>.</li>
<li><code>03:00:60 + 61s = 03:02:00</code>.</li>
<li><code>03:00:60.1 + 0.8s = 03:00:60.9</code>.</li>
</ul>
<p><code>Time - Duration</code>
(short for <a href="#method.overflowing_sub_signed"><code>NaiveTime::overflowing_sub_signed</code></a>):</p>
<ul>
<li><code>03:00:00 - 1s = 02:59:59</code>.</li>
<li><code>03:01:00 - 1s = 03:00:59</code>.</li>
<li><code>03:01:00 - 60s = 03:00:00</code>.</li>
<li><code>03:00:60 - 60s = 03:00:00</code>.
Note that the result is identical to the previous.</li>
<li><code>03:00:60.7 - 0.4s = 03:00:60.3</code>.</li>
<li><code>03:00:60.7 - 0.9s = 03:00:59.8</code>.</li>
</ul>
<p><code>Time - Time</code>
(short for <a href="#method.signed_duration_since"><code>NaiveTime::signed_duration_since</code></a>):</p>
<ul>
<li><code>04:00:00 - 03:00:00 = 3600s</code>.</li>
<li><code>03:01:00 - 03:00:00 = 60s</code>.</li>
<li><code>03:00:60 - 03:00:00 = 60s</code>.
Note that the difference is identical to the previous.</li>
<li><code>03:00:60.6 - 03:00:59.4 = 1.2s</code>.</li>
<li><code>03:01:00 - 03:00:59.8 = 0.2s</code>.</li>
<li><code>03:01:00 - 03:00:60.5 = 0.5s</code>.
Note that the difference is larger than the previous,
even though the leap second clearly follows the previous whole second.</li>
<li><code>04:00:60.9 - 03:00:60.1 = (04:00:60.9 - 04:00:00) + (04:00:00 - 03:01:00) + (03:01:00 - 03:00:60.1) = 60.9s + 3540s + 0.9s = 3601.8s</code>.</li>
</ul>
<p>In general,</p>
<ul>
<li>
<p><code>Time + Duration</code> unconditionally equals to <code>Duration + Time</code>.</p>
</li>
<li>
<p><code>Time - Duration</code> unconditionally equals to <code>Time + (-Duration)</code>.</p>
</li>
<li>
<p><code>Time1 - Time2</code> unconditionally equals to <code>-(Time2 - Time1)</code>.</p>
</li>
<li>
<p>Associativity does not generally hold, because
<code>(Time + Duration1) - Duration2</code> no longer equals to <code>Time + (Duration1 - Duration2)</code>
for two positive durations.</p>
<ul>
<li>
<p>As a special case, <code>(Time + Duration) - Duration</code> also does not equal to <code>Time</code>.</p>
</li>
<li>
<p>If you can assume that all durations have the same sign, however,
then the associativity holds:
<code>(Time + Duration1) + Duration2</code> equals to <code>Time + (Duration1 + Duration2)</code>
for two positive durations.</p>
</li>
</ul>
</li>
</ul>
<h2 id="reading-and-writing-leap-seconds" class="section-header"><a href="#reading-and-writing-leap-seconds">Reading And Writing Leap Seconds</a></h2>
<p>The &quot;typical&quot; leap seconds on the minute boundary are
correctly handled both in the formatting and parsing.
The leap second in the human-readable representation
will be represented as the second part being 60, as required by ISO 8601.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">Utc</span>, <span class="ident">TimeZone</span>};
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">Utc</span>.<span class="ident">ymd</span>(<span class="number">2015</span>, <span class="number">6</span>, <span class="number">30</span>).<span class="ident">and_hms_milli</span>(<span class="number">23</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">1_000</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">dt</span>), <span class="string">&quot;2015-06-30T23:59:60Z&quot;</span>);</pre></div>
<p>There are hypothetical leap seconds not on the minute boundary
nevertheless supported by Chrono.
They are allowed for the sake of completeness and consistency;
there were several &quot;exotic&quot; time zone offsets with fractional minutes prior to UTC after all.
For such cases the human-readable representation is ambiguous
and would be read back to the next non-leap second.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">DateTime</span>, <span class="ident">Utc</span>, <span class="ident">TimeZone</span>};
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">Utc</span>.<span class="ident">ymd</span>(<span class="number">2015</span>, <span class="number">6</span>, <span class="number">30</span>).<span class="ident">and_hms_milli</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">1_000</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">dt</span>), <span class="string">&quot;2015-06-30T23:56:05Z&quot;</span>);
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">Utc</span>.<span class="ident">ymd</span>(<span class="number">2015</span>, <span class="number">6</span>, <span class="number">30</span>).<span class="ident">and_hms</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">5</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">dt</span>), <span class="string">&quot;2015-06-30T23:56:05Z&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">DateTime</span>::<span class="ident">parse_from_rfc3339</span>(<span class="string">&quot;2015-06-30T23:56:05Z&quot;</span>).<span class="ident">unwrap</span>(), <span class="ident">dt</span>);</pre></div>
<p>Since Chrono alone cannot determine any existence of leap seconds,
<strong>there is absolutely no guarantee that the leap second read has actually happened</strong>.</p>
</div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/time.rs.html#187-801" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from_hms" class="method"><code>pub fn <a href="#method.from_hms" class="fnname">from_hms</a>(hour: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, min: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, sec: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a class="srclink" href="../../src/chrono/naive/time.rs.html#207-209" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveTime</code> from hour, minute and second.</p>
<p>No <a href="#leap-second-handling">leap second</a> is allowed here;
use <code>NaiveTime::from_hms_*</code> methods with a subsecond parameter instead.</p>
<p>Panics on invalid hour, minute and/or second.</p>
<h1 id="example" class="section-header"><a href="#example">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveTime</span>, <span class="ident">Timelike</span>};
<span class="kw">let</span> <span class="ident">t</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">t</span>.<span class="ident">hour</span>(), <span class="number">23</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">t</span>.<span class="ident">minute</span>(), <span class="number">56</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">t</span>.<span class="ident">second</span>(), <span class="number">4</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">t</span>.<span class="ident">nanosecond</span>(), <span class="number">0</span>);</pre></div>
</div><h4 id="method.from_hms_opt" class="method"><code>pub fn <a href="#method.from_hms_opt" class="fnname">from_hms_opt</a>(hour: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, min: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, sec: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/time.rs.html#232-234" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveTime</code> from hour, minute and second.</p>
<p>No <a href="#leap-second-handling">leap second</a> is allowed here;
use <code>NaiveTime::from_hms_*_opt</code> methods with a subsecond parameter instead.</p>
<p>Returns <code>None</code> on invalid hour, minute and/or second.</p>
<h1 id="example-1" class="section-header"><a href="#example-1">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveTime</span>;
<span class="kw">let</span> <span class="ident">from_hms_opt</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms_opt</span>;
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_hms_opt</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>).<span class="ident">is_some</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_hms_opt</span>(<span class="number">23</span>, <span class="number">59</span>, <span class="number">59</span>).<span class="ident">is_some</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_hms_opt</span>(<span class="number">24</span>, <span class="number">0</span>, <span class="number">0</span>).<span class="ident">is_none</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_hms_opt</span>(<span class="number">23</span>, <span class="number">60</span>, <span class="number">0</span>).<span class="ident">is_none</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_hms_opt</span>(<span class="number">23</span>, <span class="number">59</span>, <span class="number">60</span>).<span class="ident">is_none</span>());</pre></div>
</div><h4 id="method.from_hms_milli" class="method"><code>pub fn <a href="#method.from_hms_milli" class="fnname">from_hms_milli</a>(hour: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, min: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, sec: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, milli: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a class="srclink" href="../../src/chrono/naive/time.rs.html#255-257" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveTime</code> from hour, minute, second and millisecond.</p>
<p>The millisecond part can exceed 1,000
in order to represent the <a href="#leap-second-handling">leap second</a>.</p>
<p>Panics on invalid hour, minute, second and/or millisecond.</p>
<h1 id="example-2" class="section-header"><a href="#example-2">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveTime</span>, <span class="ident">Timelike</span>};
<span class="kw">let</span> <span class="ident">t</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms_milli</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">12</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">t</span>.<span class="ident">hour</span>(), <span class="number">23</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">t</span>.<span class="ident">minute</span>(), <span class="number">56</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">t</span>.<span class="ident">second</span>(), <span class="number">4</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">t</span>.<span class="ident">nanosecond</span>(), <span class="number">12_000_000</span>);</pre></div>
</div><h4 id="method.from_hms_milli_opt" class="method"><code>pub fn <a href="#method.from_hms_milli_opt" class="fnname">from_hms_milli_opt</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;hour: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;min: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;sec: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;milli: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/time.rs.html#282-286" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveTime</code> from hour, minute, second and millisecond.</p>
<p>The millisecond part can exceed 1,000
in order to represent the <a href="#leap-second-handling">leap second</a>.</p>
<p>Returns <code>None</code> on invalid hour, minute, second and/or millisecond.</p>
<h1 id="example-3" class="section-header"><a href="#example-3">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveTime</span>;
<span class="kw">let</span> <span class="ident">from_hmsm_opt</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms_milli_opt</span>;
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_hmsm_opt</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>).<span class="ident">is_some</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_hmsm_opt</span>(<span class="number">23</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">999</span>).<span class="ident">is_some</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_hmsm_opt</span>(<span class="number">23</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">1_999</span>).<span class="ident">is_some</span>()); <span class="comment">// a leap second after 23:59:59</span>
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_hmsm_opt</span>(<span class="number">24</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>).<span class="ident">is_none</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_hmsm_opt</span>(<span class="number">23</span>, <span class="number">60</span>, <span class="number">0</span>, <span class="number">0</span>).<span class="ident">is_none</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_hmsm_opt</span>(<span class="number">23</span>, <span class="number">59</span>, <span class="number">60</span>, <span class="number">0</span>).<span class="ident">is_none</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_hmsm_opt</span>(<span class="number">23</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">2_000</span>).<span class="ident">is_none</span>());</pre></div>
</div><h4 id="method.from_hms_micro" class="method"><code>pub fn <a href="#method.from_hms_micro" class="fnname">from_hms_micro</a>(hour: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, min: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, sec: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, micro: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a class="srclink" href="../../src/chrono/naive/time.rs.html#307-309" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveTime</code> from hour, minute, second and microsecond.</p>
<p>The microsecond part can exceed 1,000,000
in order to represent the <a href="#leap-second-handling">leap second</a>.</p>
<p>Panics on invalid hour, minute, second and/or microsecond.</p>
<h1 id="example-4" class="section-header"><a href="#example-4">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveTime</span>, <span class="ident">Timelike</span>};
<span class="kw">let</span> <span class="ident">t</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms_micro</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">12_345</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">t</span>.<span class="ident">hour</span>(), <span class="number">23</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">t</span>.<span class="ident">minute</span>(), <span class="number">56</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">t</span>.<span class="ident">second</span>(), <span class="number">4</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">t</span>.<span class="ident">nanosecond</span>(), <span class="number">12_345_000</span>);</pre></div>
</div><h4 id="method.from_hms_micro_opt" class="method"><code>pub fn <a href="#method.from_hms_micro_opt" class="fnname">from_hms_micro_opt</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;hour: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;min: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;sec: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;micro: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/time.rs.html#334-336" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveTime</code> from hour, minute, second and microsecond.</p>
<p>The microsecond part can exceed 1,000,000
in order to represent the <a href="#leap-second-handling">leap second</a>.</p>
<p>Returns <code>None</code> on invalid hour, minute, second and/or microsecond.</p>
<h1 id="example-5" class="section-header"><a href="#example-5">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveTime</span>;
<span class="kw">let</span> <span class="ident">from_hmsu_opt</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms_micro_opt</span>;
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_hmsu_opt</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>).<span class="ident">is_some</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_hmsu_opt</span>(<span class="number">23</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">999_999</span>).<span class="ident">is_some</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_hmsu_opt</span>(<span class="number">23</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">1_999_999</span>).<span class="ident">is_some</span>()); <span class="comment">// a leap second after 23:59:59</span>
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_hmsu_opt</span>(<span class="number">24</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>).<span class="ident">is_none</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_hmsu_opt</span>(<span class="number">23</span>, <span class="number">60</span>, <span class="number">0</span>, <span class="number">0</span>).<span class="ident">is_none</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_hmsu_opt</span>(<span class="number">23</span>, <span class="number">59</span>, <span class="number">60</span>, <span class="number">0</span>).<span class="ident">is_none</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_hmsu_opt</span>(<span class="number">23</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">2_000_000</span>).<span class="ident">is_none</span>());</pre></div>
</div><h4 id="method.from_hms_nano" class="method"><code>pub fn <a href="#method.from_hms_nano" class="fnname">from_hms_nano</a>(hour: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, min: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, sec: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, nano: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a class="srclink" href="../../src/chrono/naive/time.rs.html#357-359" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveTime</code> from hour, minute, second and nanosecond.</p>
<p>The nanosecond part can exceed 1,000,000,000
in order to represent the <a href="#leap-second-handling">leap second</a>.</p>
<p>Panics on invalid hour, minute, second and/or nanosecond.</p>
<h1 id="example-6" class="section-header"><a href="#example-6">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveTime</span>, <span class="ident">Timelike</span>};
<span class="kw">let</span> <span class="ident">t</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">12_345_678</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">t</span>.<span class="ident">hour</span>(), <span class="number">23</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">t</span>.<span class="ident">minute</span>(), <span class="number">56</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">t</span>.<span class="ident">second</span>(), <span class="number">4</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">t</span>.<span class="ident">nanosecond</span>(), <span class="number">12_345_678</span>);</pre></div>
</div><h4 id="method.from_hms_nano_opt" class="method"><code>pub fn <a href="#method.from_hms_nano_opt" class="fnname">from_hms_nano_opt</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;hour: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;min: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;sec: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;nano: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/time.rs.html#384-390" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveTime</code> from hour, minute, second and nanosecond.</p>
<p>The nanosecond part can exceed 1,000,000,000
in order to represent the <a href="#leap-second-handling">leap second</a>.</p>
<p>Returns <code>None</code> on invalid hour, minute, second and/or nanosecond.</p>
<h1 id="example-7" class="section-header"><a href="#example-7">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveTime</span>;
<span class="kw">let</span> <span class="ident">from_hmsn_opt</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano_opt</span>;
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_hmsn_opt</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>).<span class="ident">is_some</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_hmsn_opt</span>(<span class="number">23</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">999_999_999</span>).<span class="ident">is_some</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_hmsn_opt</span>(<span class="number">23</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">1_999_999_999</span>).<span class="ident">is_some</span>()); <span class="comment">// a leap second after 23:59:59</span>
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_hmsn_opt</span>(<span class="number">24</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>).<span class="ident">is_none</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_hmsn_opt</span>(<span class="number">23</span>, <span class="number">60</span>, <span class="number">0</span>, <span class="number">0</span>).<span class="ident">is_none</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_hmsn_opt</span>(<span class="number">23</span>, <span class="number">59</span>, <span class="number">60</span>, <span class="number">0</span>).<span class="ident">is_none</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_hmsn_opt</span>(<span class="number">23</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">2_000_000_000</span>).<span class="ident">is_none</span>());</pre></div>
</div><h4 id="method.from_num_seconds_from_midnight" class="method"><code>pub fn <a href="#method.from_num_seconds_from_midnight" class="fnname">from_num_seconds_from_midnight</a>(secs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, nano: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a class="srclink" href="../../src/chrono/naive/time.rs.html#411-413" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveTime</code> from the number of seconds since midnight and nanosecond.</p>
<p>The nanosecond part can exceed 1,000,000,000
in order to represent the <a href="#leap-second-handling">leap second</a>.</p>
<p>Panics on invalid number of seconds and/or nanosecond.</p>
<h1 id="example-8" class="section-header"><a href="#example-8">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveTime</span>, <span class="ident">Timelike</span>};
<span class="kw">let</span> <span class="ident">t</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_num_seconds_from_midnight</span>(<span class="number">86164</span>, <span class="number">12_345_678</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">t</span>.<span class="ident">hour</span>(), <span class="number">23</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">t</span>.<span class="ident">minute</span>(), <span class="number">56</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">t</span>.<span class="ident">second</span>(), <span class="number">4</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">t</span>.<span class="ident">nanosecond</span>(), <span class="number">12_345_678</span>);</pre></div>
</div><h4 id="method.from_num_seconds_from_midnight_opt" class="method"><code>pub fn <a href="#method.from_num_seconds_from_midnight_opt" class="fnname">from_num_seconds_from_midnight_opt</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;secs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;nano: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/time.rs.html#436-441" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveTime</code> from the number of seconds since midnight and nanosecond.</p>
<p>The nanosecond part can exceed 1,000,000,000
in order to represent the <a href="#leap-second-handling">leap second</a>.</p>
<p>Returns <code>None</code> on invalid number of seconds and/or nanosecond.</p>
<h1 id="example-9" class="section-header"><a href="#example-9">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveTime</span>;
<span class="kw">let</span> <span class="ident">from_nsecs_opt</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_num_seconds_from_midnight_opt</span>;
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_nsecs_opt</span>(<span class="number">0</span>, <span class="number">0</span>).<span class="ident">is_some</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_nsecs_opt</span>(<span class="number">86399</span>, <span class="number">999_999_999</span>).<span class="ident">is_some</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_nsecs_opt</span>(<span class="number">86399</span>, <span class="number">1_999_999_999</span>).<span class="ident">is_some</span>()); <span class="comment">// a leap second after 23:59:59</span>
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_nsecs_opt</span>(<span class="number">86_400</span>, <span class="number">0</span>).<span class="ident">is_none</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">from_nsecs_opt</span>(<span class="number">86399</span>, <span class="number">2_000_000_000</span>).<span class="ident">is_none</span>());</pre></div>
</div><h4 id="method.parse_from_str" class="method"><code>pub fn <a href="#method.parse_from_str" class="fnname">parse_from_str</a>(s: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, fmt: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="type" href="../../chrono/format/type.ParseResult.html" title="type chrono::format::ParseResult">ParseResult</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/time.rs.html#504-508" title="goto source code">[src]</a></h4><div class="docblock"><p>Parses a string with the specified format string and returns a new <code>NaiveTime</code>.
See the <a href="../format/strftime/index.html"><code>format::strftime</code> module</a>
on the supported escape sequences.</p>
<h1 id="example-10" class="section-header"><a href="#example-10">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveTime</span>;
<span class="kw">let</span> <span class="ident">parse_from_str</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">parse_from_str</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parse_from_str</span>(<span class="string">&quot;23:56:04&quot;</span>, <span class="string">&quot;%H:%M:%S&quot;</span>),
<span class="prelude-val">Ok</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parse_from_str</span>(<span class="string">&quot;pm012345.6789&quot;</span>, <span class="string">&quot;%p%I%M%S%.f&quot;</span>),
<span class="prelude-val">Ok</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms_micro</span>(<span class="number">13</span>, <span class="number">23</span>, <span class="number">45</span>, <span class="number">678_900</span>)));</pre></div>
<p>Date and offset is ignored for the purpose of parsing.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parse_from_str</span>(<span class="string">&quot;2014-5-17T12:34:56+09:30&quot;</span>, <span class="string">&quot;%Y-%m-%dT%H:%M:%S%z&quot;</span>),
<span class="prelude-val">Ok</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>)));</pre></div>
<p><a href="#leap-second-handling">Leap seconds</a> are correctly handled by
treating any time of the form <code>hh:mm:60</code> as a leap second.
(This equally applies to the formatting, so the round trip is possible.)</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parse_from_str</span>(<span class="string">&quot;08:59:60.123&quot;</span>, <span class="string">&quot;%H:%M:%S%.f&quot;</span>),
<span class="prelude-val">Ok</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms_milli</span>(<span class="number">8</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">1_123</span>)));</pre></div>
<p>Missing seconds are assumed to be zero,
but out-of-bound times or insufficient fields are errors otherwise.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parse_from_str</span>(<span class="string">&quot;7:15&quot;</span>, <span class="string">&quot;%H:%M&quot;</span>),
<span class="prelude-val">Ok</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms</span>(<span class="number">7</span>, <span class="number">15</span>, <span class="number">0</span>)));
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">parse_from_str</span>(<span class="string">&quot;04m33s&quot;</span>, <span class="string">&quot;%Mm%Ss&quot;</span>).<span class="ident">is_err</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">parse_from_str</span>(<span class="string">&quot;12&quot;</span>, <span class="string">&quot;%H&quot;</span>).<span class="ident">is_err</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">parse_from_str</span>(<span class="string">&quot;17:60&quot;</span>, <span class="string">&quot;%H:%M&quot;</span>).<span class="ident">is_err</span>());
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">parse_from_str</span>(<span class="string">&quot;24:00:00&quot;</span>, <span class="string">&quot;%H:%M:%S&quot;</span>).<span class="ident">is_err</span>());</pre></div>
<p>All parsed fields should be consistent to each other, otherwise it's an error.
Here <code>%H</code> is for 24-hour clocks, unlike <code>%I</code>,
and thus can be independently determined without AM/PM.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">parse_from_str</span>(<span class="string">&quot;13:07 AM&quot;</span>, <span class="string">&quot;%H:%M %p&quot;</span>).<span class="ident">is_err</span>());</pre></div>
</div><h4 id="method.overflowing_add_signed" class="method"><code>pub fn <a href="#method.overflowing_add_signed" class="fnname">overflowing_add_signed</a>(&amp;self, rhs: <a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code><a class="srclink" href="../../src/chrono/naive/time.rs.html#532-593" title="goto source code">[src]</a></h4><div class="docblock"><p>Adds given <code>Duration</code> to the current time,
and also returns the number of <em>seconds</em>
in the integral number of days ignored from the addition.
(We cannot return <code>Duration</code> because it is subject to overflow or underflow.)</p>
<h1 id="example-11" class="section-header"><a href="#example-11">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">Duration</span>, <span class="ident">NaiveTime</span>};
<span class="kw">let</span> <span class="ident">from_hms</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hms</span>(<span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>).<span class="ident">overflowing_add_signed</span>(<span class="ident">Duration</span>::<span class="ident">hours</span>(<span class="number">11</span>)),
(<span class="ident">from_hms</span>(<span class="number">14</span>, <span class="number">4</span>, <span class="number">5</span>), <span class="number">0</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hms</span>(<span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>).<span class="ident">overflowing_add_signed</span>(<span class="ident">Duration</span>::<span class="ident">hours</span>(<span class="number">23</span>)),
(<span class="ident">from_hms</span>(<span class="number">2</span>, <span class="number">4</span>, <span class="number">5</span>), <span class="number">86_400</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hms</span>(<span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>).<span class="ident">overflowing_add_signed</span>(<span class="ident">Duration</span>::<span class="ident">hours</span>(<span class="op">-</span><span class="number">7</span>)),
(<span class="ident">from_hms</span>(<span class="number">20</span>, <span class="number">4</span>, <span class="number">5</span>), <span class="op">-</span><span class="number">86_400</span>));</pre></div>
</div><h4 id="method.overflowing_sub_signed" class="method"><code>pub fn <a href="#method.overflowing_sub_signed" class="fnname">overflowing_sub_signed</a>(&amp;self, rhs: <a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code><a class="srclink" href="../../src/chrono/naive/time.rs.html#617-620" title="goto source code">[src]</a></h4><div class="docblock"><p>Subtracts given <code>Duration</code> from the current time,
and also returns the number of <em>seconds</em>
in the integral number of days ignored from the subtraction.
(We cannot return <code>Duration</code> because it is subject to overflow or underflow.)</p>
<h1 id="example-12" class="section-header"><a href="#example-12">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">Duration</span>, <span class="ident">NaiveTime</span>};
<span class="kw">let</span> <span class="ident">from_hms</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hms</span>(<span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>).<span class="ident">overflowing_sub_signed</span>(<span class="ident">Duration</span>::<span class="ident">hours</span>(<span class="number">2</span>)),
(<span class="ident">from_hms</span>(<span class="number">1</span>, <span class="number">4</span>, <span class="number">5</span>), <span class="number">0</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hms</span>(<span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>).<span class="ident">overflowing_sub_signed</span>(<span class="ident">Duration</span>::<span class="ident">hours</span>(<span class="number">17</span>)),
(<span class="ident">from_hms</span>(<span class="number">10</span>, <span class="number">4</span>, <span class="number">5</span>), <span class="number">86_400</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hms</span>(<span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>).<span class="ident">overflowing_sub_signed</span>(<span class="ident">Duration</span>::<span class="ident">hours</span>(<span class="op">-</span><span class="number">22</span>)),
(<span class="ident">from_hms</span>(<span class="number">1</span>, <span class="number">4</span>, <span class="number">5</span>), <span class="op">-</span><span class="number">86_400</span>));</pre></div>
</div><h4 id="method.signed_duration_since" class="method"><code>pub fn <a href="#method.signed_duration_since" class="fnname">signed_duration_since</a>(self, rhs: <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>) -&gt; <a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a></code><a class="srclink" href="../../src/chrono/naive/time.rs.html#680-716" title="goto source code">[src]</a></h4><div class="docblock"><p>Subtracts another <code>NaiveTime</code> from the current time.
Returns a <code>Duration</code> within +/- 1 day.
This does not overflow or underflow at all.</p>
<p>As a part of Chrono's <a href="#leap-second-handling">leap second handling</a>,
the subtraction assumes that <strong>there is no leap second ever</strong>,
except when any of the <code>NaiveTime</code>s themselves represents a leap second
in which case the assumption becomes that
<strong>there are exactly one (or two) leap second(s) ever</strong>.</p>
<h1 id="example-13" class="section-header"><a href="#example-13">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">Duration</span>, <span class="ident">NaiveTime</span>};
<span class="kw">let</span> <span class="ident">from_hmsm</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms_milli</span>;
<span class="kw">let</span> <span class="ident">since</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">signed_duration_since</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">since</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">900</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">900</span>)),
<span class="ident">Duration</span>::<span class="ident">zero</span>());
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">since</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">900</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">875</span>)),
<span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">25</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">since</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">900</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">6</span>, <span class="number">925</span>)),
<span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">975</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">since</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">900</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">0</span>, <span class="number">900</span>)),
<span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">7</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">since</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">900</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">0</span>, <span class="number">7</span>, <span class="number">900</span>)),
<span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">5</span> <span class="op">*</span> <span class="number">60</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">since</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">900</span>), <span class="ident">from_hmsm</span>(<span class="number">0</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">900</span>)),
<span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">3</span> <span class="op">*</span> <span class="number">3600</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">since</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">900</span>), <span class="ident">from_hmsm</span>(<span class="number">4</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">900</span>)),
<span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="op">-</span><span class="number">3600</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">since</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">900</span>), <span class="ident">from_hmsm</span>(<span class="number">2</span>, <span class="number">4</span>, <span class="number">6</span>, <span class="number">800</span>)),
<span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">3600</span> <span class="op">+</span> <span class="number">60</span> <span class="op">+</span> <span class="number">1</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">100</span>));</pre></div>
<p>Leap seconds are handled, but the subtraction assumes that
there were no other leap seconds happened.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">since</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">0</span>, <span class="number">59</span>, <span class="number">1_000</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">0</span>, <span class="number">59</span>, <span class="number">0</span>)),
<span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">1</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">since</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">0</span>, <span class="number">59</span>, <span class="number">1_500</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">0</span>, <span class="number">59</span>, <span class="number">0</span>)),
<span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">1500</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">since</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">0</span>, <span class="number">59</span>, <span class="number">1_000</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>)),
<span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">60</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">since</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>), <span class="ident">from_hmsm</span>(<span class="number">2</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">1_000</span>)),
<span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">1</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">since</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">0</span>, <span class="number">59</span>, <span class="number">1_000</span>), <span class="ident">from_hmsm</span>(<span class="number">2</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">1_000</span>)),
<span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">61</span>));</pre></div>
</div><h4 id="method.format_with_items" class="method"><code>pub fn <a href="#method.format_with_items" class="fnname">format_with_items</a>&lt;'a, I, B&gt;(&amp;self, items: I) -&gt; <a class="struct" href="../../chrono/format/struct.DelayedFormat.html" title="struct chrono::format::DelayedFormat">DelayedFormat</a>&lt;I&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a>&lt;Item = B&gt; + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;<a class="enum" href="../../chrono/format/enum.Item.html" title="enum chrono::format::Item">Item</a>&lt;'a&gt;&gt;,&nbsp;</span></code><a class="srclink" href="../../src/chrono/naive/time.rs.html#747-753" title="goto source code">[src]</a></h4><div class="docblock"><p>Formats the time with the specified formatting items.
Otherwise it is the same as the ordinary <a href="#method.format"><code>format</code></a> method.</p>
<p>The <code>Iterator</code> of items should be <code>Clone</code>able,
since the resulting <code>DelayedFormat</code> value may be formatted multiple times.</p>
<h1 id="example-14" class="section-header"><a href="#example-14">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveTime</span>;
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">format</span>::<span class="ident">strftime</span>::<span class="ident">StrftimeItems</span>;
<span class="kw">let</span> <span class="ident">fmt</span> <span class="op">=</span> <span class="ident">StrftimeItems</span>::<span class="ident">new</span>(<span class="string">&quot;%H:%M:%S&quot;</span>);
<span class="kw">let</span> <span class="ident">t</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">t</span>.<span class="ident">format_with_items</span>(<span class="ident">fmt</span>.<span class="ident">clone</span>()).<span class="ident">to_string</span>(), <span class="string">&quot;23:56:04&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">t</span>.<span class="ident">format</span>(<span class="string">&quot;%H:%M:%S&quot;</span>).<span class="ident">to_string</span>(), <span class="string">&quot;23:56:04&quot;</span>);</pre></div>
<p>The resulting <code>DelayedFormat</code> can be formatted directly via the <code>Display</code> trait.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">t</span>.<span class="ident">format_with_items</span>(<span class="ident">fmt</span>)), <span class="string">&quot;23:56:04&quot;</span>);</pre></div>
</div><h4 id="method.format" class="method"><code>pub fn <a href="#method.format" class="fnname">format</a>&lt;'a&gt;(&amp;self, fmt: &amp;'a <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="struct" href="../../chrono/format/struct.DelayedFormat.html" title="struct chrono::format::DelayedFormat">DelayedFormat</a>&lt;<a class="struct" href="../../chrono/format/strftime/struct.StrftimeItems.html" title="struct chrono::format::strftime::StrftimeItems">StrftimeItems</a>&lt;'a&gt;&gt;</code><a class="srclink" href="../../src/chrono/naive/time.rs.html#791-793" title="goto source code">[src]</a></h4><div class="docblock"><p>Formats the time with the specified format string.
See the <a href="../format/strftime/index.html"><code>format::strftime</code> module</a>
on the supported escape sequences.</p>
<p>This returns a <code>DelayedFormat</code>,
which gets converted to a string only when actual formatting happens.
You may use the <code>to_string</code> method to get a <code>String</code>,
or just feed it into <code>print!</code> and other formatting macros.
(In this way it avoids the redundant memory allocation.)</p>
<p>A wrong format string does <em>not</em> issue an error immediately.
Rather, converting or formatting the <code>DelayedFormat</code> fails.
You are recommended to immediately use <code>DelayedFormat</code> for this reason.</p>
<h1 id="example-15" class="section-header"><a href="#example-15">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveTime</span>;
<span class="kw">let</span> <span class="ident">t</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">12_345_678</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">t</span>.<span class="ident">format</span>(<span class="string">&quot;%H:%M:%S&quot;</span>).<span class="ident">to_string</span>(), <span class="string">&quot;23:56:04&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">t</span>.<span class="ident">format</span>(<span class="string">&quot;%H:%M:%S%.6f&quot;</span>).<span class="ident">to_string</span>(), <span class="string">&quot;23:56:04.012345&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">t</span>.<span class="ident">format</span>(<span class="string">&quot;%-I:%M %p&quot;</span>).<span class="ident">to_string</span>(), <span class="string">&quot;11:56 PM&quot;</span>);</pre></div>
<p>The resulting <code>DelayedFormat</code> can be formatted directly via the <code>Display</code> trait.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">t</span>.<span class="ident">format</span>(<span class="string">&quot;%H:%M:%S&quot;</span>)), <span class="string">&quot;23:56:04&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">t</span>.<span class="ident">format</span>(<span class="string">&quot;%H:%M:%S%.6f&quot;</span>)), <span class="string">&quot;23:56:04.012345&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">t</span>.<span class="ident">format</span>(<span class="string">&quot;%-I:%M %p&quot;</span>)), <span class="string">&quot;11:56 PM&quot;</span>);</pre></div>
</div></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Add%3CDuration%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html" title="trait core::ops::arith::Add">Add</a>&lt;<a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>&gt; for <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a href="#impl-Add%3CDuration%3E" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/time.rs.html#1078-1085" title="goto source code">[src]</a></h3><div class="docblock"><p>An addition of <code>Duration</code> to <code>NaiveTime</code> wraps around and never overflows or underflows.
In particular the addition ignores integral number of days.</p>
<p>As a part of Chrono's <a href="#leap-second-handling">leap second handling</a>,
the addition assumes that <strong>there is no leap second ever</strong>,
except when the <code>NaiveTime</code> itself represents a leap second
in which case the assumption becomes that <strong>there is exactly a single leap second ever</strong>.</p>
<h1 id="example-29" class="section-header"><a href="#example-29">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">Duration</span>, <span class="ident">NaiveTime</span>};
<span class="kw">let</span> <span class="ident">from_hmsm</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms_milli</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">zero</span>(), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">1</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">8</span>, <span class="number">0</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="op">-</span><span class="number">1</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">6</span>, <span class="number">0</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">60</span> <span class="op">+</span> <span class="number">4</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">6</span>, <span class="number">11</span>, <span class="number">0</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">7</span><span class="kw-2">*</span><span class="number">60</span><span class="kw-2">*</span><span class="number">60</span> <span class="op">-</span> <span class="number">6</span><span class="kw-2">*</span><span class="number">60</span>), <span class="ident">from_hmsm</span>(<span class="number">9</span>, <span class="number">59</span>, <span class="number">7</span>, <span class="number">0</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">80</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">80</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">950</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">280</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">8</span>, <span class="number">230</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">950</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="op">-</span><span class="number">980</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">6</span>, <span class="number">970</span>));</pre></div>
<p>The addition wraps around.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">22</span><span class="kw-2">*</span><span class="number">60</span><span class="kw-2">*</span><span class="number">60</span>), <span class="ident">from_hmsm</span>(<span class="number">1</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="op">-</span><span class="number">8</span><span class="kw-2">*</span><span class="number">60</span><span class="kw-2">*</span><span class="number">60</span>), <span class="ident">from_hmsm</span>(<span class="number">19</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">800</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>));</pre></div>
<p>Leap seconds are handled, but the addition assumes that it is the only leap second happened.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">leap</span> <span class="op">=</span> <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">1_300</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">zero</span>(), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">1_300</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="op">-</span><span class="number">500</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">800</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">500</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">1_800</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">800</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">6</span>, <span class="number">0</span>, <span class="number">100</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">10</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">6</span>, <span class="number">9</span>, <span class="number">300</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="op">-</span><span class="number">10</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">50</span>, <span class="number">300</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">1</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">300</span>));</pre></div>
</div><div class="impl-items"><h4 id="associatedtype.Output-4" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#associatedtype.Output" class="type">Output</a> = <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>+</code> operator.</p>
</div><h4 id="method.add-1" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add" class="fnname">add</a>(self, rhs: <a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a>) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a class="srclink" href="../../src/chrono/naive/time.rs.html#1082-1084" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>+</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add">Read more</a></p>
</div></div><h3 id="impl-Add%3CFixedOffset%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html" title="trait core::ops::arith::Add">Add</a>&lt;<a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>&gt; for <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a href="#impl-Add%3CFixedOffset%3E" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#164-171" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Output-3" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#associatedtype.Output" class="type">Output</a> = <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>+</code> operator.</p>
</div><h4 id="method.add" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add" class="fnname">add</a>(self, rhs: <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#168-170" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>+</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add">Read more</a></p>
</div></div><h3 id="impl-AddAssign%3CDuration%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.AddAssign.html" title="trait core::ops::arith::AddAssign">AddAssign</a>&lt;<a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>&gt; for <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a href="#impl-AddAssign%3CDuration%3E" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/time.rs.html#1087-1092" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.add_assign" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.AddAssign.html#tymethod.add_assign" class="fnname">add_assign</a>(&amp;mut self, rhs: <a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a>)</code><a class="srclink" href="../../src/chrono/naive/time.rs.html#1089-1091" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>+=</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.AddAssign.html#tymethod.add_assign">Read more</a></p>
</div></div><h3 id="impl-Clone" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a href="#impl-Clone" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/time.rs.html#181" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&amp;self) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a class="srclink" href="../../src/chrono/naive/time.rs.html#181" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id="method.clone_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&amp;mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self)</code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#128-130" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3 id="impl-Copy" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a href="#impl-Copy" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/time.rs.html#181" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Debug" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/time.rs.html#1247-1267" title="goto source code">[src]</a></h3><div class="docblock"><p>The <code>Debug</code> output of the naive time <code>t</code> is the same as
<a href="../format/strftime/index.html"><code>t.format(&quot;%H:%M:%S%.f&quot;)</code></a>.</p>
<p>The string printed can be readily parsed via the <code>parse</code> method on <code>str</code>.</p>
<p>It should be noted that, for leap seconds not on the minute boundary,
it may print a representation not distinguishable from non-leap seconds.
This doesn't matter in practice, since such leap seconds never happened.
(By the time of the first leap second on 1972-06-30,
every time zone offset around the world has standardized to the 5-minute alignment.)</p>
<h1 id="example-25" class="section-header"><a href="#example-25">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveTime</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">NaiveTime</span>::<span class="ident">from_hms</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>)), <span class="string">&quot;23:56:04&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">NaiveTime</span>::<span class="ident">from_hms_milli</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">12</span>)), <span class="string">&quot;23:56:04.012&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">NaiveTime</span>::<span class="ident">from_hms_micro</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">1234</span>)), <span class="string">&quot;23:56:04.001234&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">123456</span>)), <span class="string">&quot;23:56:04.000123456&quot;</span>);</pre></div>
<p>Leap seconds may also be used.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">NaiveTime</span>::<span class="ident">from_hms_milli</span>(<span class="number">6</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">1_500</span>)), <span class="string">&quot;06:59:60.500&quot;</span>);</pre></div>
</div><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class="srclink" href="../../src/chrono/naive/time.rs.html#1248-1266" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id="impl-Display" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a href="#impl-Display" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/time.rs.html#1297-1301" title="goto source code">[src]</a></h3><div class="docblock"><p>The <code>Display</code> output of the naive time <code>t</code> is the same as
<a href="../format/strftime/index.html"><code>t.format(&quot;%H:%M:%S%.f&quot;)</code></a>.</p>
<p>The string printed can be readily parsed via the <code>parse</code> method on <code>str</code>.</p>
<p>It should be noted that, for leap seconds not on the minute boundary,
it may print a representation not distinguishable from non-leap seconds.
This doesn't matter in practice, since such leap seconds never happened.
(By the time of the first leap second on 1972-06-30,
every time zone offset around the world has standardized to the 5-minute alignment.)</p>
<h1 id="example-26" class="section-header"><a href="#example-26">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveTime</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">NaiveTime</span>::<span class="ident">from_hms</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>)), <span class="string">&quot;23:56:04&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">NaiveTime</span>::<span class="ident">from_hms_milli</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">12</span>)), <span class="string">&quot;23:56:04.012&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">NaiveTime</span>::<span class="ident">from_hms_micro</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">1234</span>)), <span class="string">&quot;23:56:04.001234&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">123456</span>)), <span class="string">&quot;23:56:04.000123456&quot;</span>);</pre></div>
<p>Leap seconds may also be used.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">NaiveTime</span>::<span class="ident">from_hms_milli</span>(<span class="number">6</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">1_500</span>)), <span class="string">&quot;06:59:60.500&quot;</span>);</pre></div>
</div><div class="impl-items"><h4 id="method.fmt-1" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class="srclink" href="../../src/chrono/naive/time.rs.html#1298-1300" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id="impl-Eq" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a href="#impl-Eq" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/time.rs.html#181" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-FromStr" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html" title="trait core::str::traits::FromStr">FromStr</a> for <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a href="#impl-FromStr" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/time.rs.html#1322-1342" title="goto source code">[src]</a></h3><div class="docblock"><p>Parsing a <code>str</code> into a <code>NaiveTime</code> uses the same format,
<a href="../format/strftime/index.html"><code>%H:%M:%S%.f</code></a>, as in <code>Debug</code> and <code>Display</code>.</p>
<h1 id="example-30" class="section-header"><a href="#example-30">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::<span class="ident">NaiveTime</span>;
<span class="kw">let</span> <span class="ident">t</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">&quot;23:56:04&quot;</span>.<span class="ident">parse</span>::<span class="op">&lt;</span><span class="ident">NaiveTime</span><span class="op">&gt;</span>(), <span class="prelude-val">Ok</span>(<span class="ident">t</span>));
<span class="kw">let</span> <span class="ident">t</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">12_345_678</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">&quot;23:56:4.012345678&quot;</span>.<span class="ident">parse</span>::<span class="op">&lt;</span><span class="ident">NaiveTime</span><span class="op">&gt;</span>(), <span class="prelude-val">Ok</span>(<span class="ident">t</span>));
<span class="kw">let</span> <span class="ident">t</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano</span>(<span class="number">23</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">1_234_567_890</span>); <span class="comment">// leap second</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">&quot;23:59:60.23456789&quot;</span>.<span class="ident">parse</span>::<span class="op">&lt;</span><span class="ident">NaiveTime</span><span class="op">&gt;</span>(), <span class="prelude-val">Ok</span>(<span class="ident">t</span>));
<span class="macro">assert</span><span class="macro">!</span>(<span class="string">&quot;foo&quot;</span>.<span class="ident">parse</span>::<span class="op">&lt;</span><span class="ident">NaiveTime</span><span class="op">&gt;</span>().<span class="ident">is_err</span>());</pre></div>
</div><div class="impl-items"><h4 id="associatedtype.Err" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#associatedtype.Err" class="type">Err</a> = <a class="struct" href="../../chrono/format/struct.ParseError.html" title="struct chrono::format::ParseError">ParseError</a></code></h4><div class='docblock'><p>The associated error which can be returned from parsing.</p>
</div><h4 id="method.from_str" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#tymethod.from_str" class="fnname">from_str</a>(s: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="type" href="../../chrono/format/type.ParseResult.html" title="type chrono::format::ParseResult">ParseResult</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/time.rs.html#1325-1341" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Parses a string <code>s</code> to return a value of this type. <a href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#tymethod.from_str">Read more</a></p>
</div></div><h3 id="impl-Hash" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> for <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a href="#impl-Hash" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/time.rs.html#1016-1021" title="goto source code">[src]</a></h3><div class="docblock"><p><code>NaiveTime</code> can be used as a key to the hash maps (in principle).</p>
<p>Practically this also takes account of fractional seconds, so it is not recommended.
(For the obvious reason this also distinguishes leap seconds from non-leap seconds.)</p>
</div><div class="impl-items"><h4 id="method.hash" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash" class="fnname">hash</a>&lt;H:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>&gt;(&amp;self, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>H)</code><a class="srclink" href="../../src/chrono/naive/time.rs.html#1017-1020" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Feeds this value into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash">Read more</a></p>
</div><h4 id="method.hash_slice" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice" class="fnname">hash_slice</a>&lt;H&gt;(data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[Self]</a>, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>H) <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.3.0">1.3.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#184-191" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice">Read more</a></p>
</div></div><h3 id="impl-Ord" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a href="#impl-Ord" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/time.rs.html#181" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.cmp" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp" class="fnname">cmp</a>(&amp;self, other: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></code><a class="srclink" href="../../src/chrono/naive/time.rs.html#181" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method returns an <a href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="Ordering"><code>Ordering</code></a> between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></p>
</div><h4 id="method.max" class="method hidden"><code><span class="docblock attributes">#[must_use]</span>pub fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max" class="fnname">max</a>(self, other: Self) -&gt; Self</code><span class="since" title="Stable since Rust version 1.21.0">1.21.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#719-724" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Compares and returns the maximum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max">Read more</a></p>
</div><h4 id="method.min" class="method hidden"><code><span class="docblock attributes">#[must_use]</span>pub fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min" class="fnname">min</a>(self, other: Self) -&gt; Self</code><span class="since" title="Stable since Rust version 1.21.0">1.21.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#739-744" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Compares and returns the minimum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min">Read more</a></p>
</div><h4 id="method.clamp" class="method hidden"><code><span class="docblock attributes">#[must_use]</span>pub fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp" class="fnname">clamp</a>(self, min: Self, max: Self) -&gt; Self</code><span class="since" title="Stable since Rust version 1.50.0">1.50.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#764-776" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Restrict a value to a certain interval. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp">Read more</a></p>
</div></div><h3 id="impl-PartialEq%3CNaiveTime%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>&gt; for <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a href="#impl-PartialEq%3CNaiveTime%3E" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/time.rs.html#181" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.eq" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq" class="fnname">eq</a>(&amp;self, other: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/chrono/naive/time.rs.html#181" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id="method.ne" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne" class="fnname">ne</a>(&amp;self, other: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/chrono/naive/time.rs.html#181" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 id="impl-PartialOrd%3CNaiveTime%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>&gt; for <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a href="#impl-PartialOrd%3CNaiveTime%3E" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/time.rs.html#181" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.partial_cmp" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp" class="fnname">partial_cmp</a>(&amp;self, other: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/time.rs.html#181" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
</div><h4 id="method.lt" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt" class="fnname">lt</a>(&amp;self, other: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/chrono/naive/time.rs.html#181" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
</div><h4 id="method.le" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le" class="fnname">le</a>(&amp;self, other: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/chrono/naive/time.rs.html#181" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;=</code>
operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
</div><h4 id="method.gt" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt" class="fnname">gt</a>(&amp;self, other: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/chrono/naive/time.rs.html#181" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
</div><h4 id="method.ge" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge" class="fnname">ge</a>(&amp;self, other: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/chrono/naive/time.rs.html#181" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;=</code>
operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
</div></div><h3 id="impl-StructuralEq" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a href="#impl-StructuralEq" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/time.rs.html#181" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-StructuralPartialEq" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a href="#impl-StructuralPartialEq" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/time.rs.html#181" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sub%3CDuration%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html" title="trait core::ops::arith::Sub">Sub</a>&lt;<a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>&gt; for <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a href="#impl-Sub%3CDuration%3E" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/time.rs.html#1145-1152" title="goto source code">[src]</a></h3><div class="docblock"><p>A subtraction of <code>Duration</code> from <code>NaiveTime</code> wraps around and never overflows or underflows.
In particular the addition ignores integral number of days.
It is the same as the addition with a negated <code>Duration</code>.</p>
<p>As a part of Chrono's <a href="#leap-second-handling">leap second handling</a>,
the addition assumes that <strong>there is no leap second ever</strong>,
except when the <code>NaiveTime</code> itself represents a leap second
in which case the assumption becomes that <strong>there is exactly a single leap second ever</strong>.</p>
<h1 id="example-27" class="section-header"><a href="#example-27">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">Duration</span>, <span class="ident">NaiveTime</span>};
<span class="kw">let</span> <span class="ident">from_hmsm</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms_milli</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">zero</span>(), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">1</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">6</span>, <span class="number">0</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">60</span> <span class="op">+</span> <span class="number">5</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">4</span>, <span class="number">2</span>, <span class="number">0</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">2</span><span class="kw-2">*</span><span class="number">60</span><span class="kw-2">*</span><span class="number">60</span> <span class="op">+</span> <span class="number">6</span><span class="kw-2">*</span><span class="number">60</span>), <span class="ident">from_hmsm</span>(<span class="number">0</span>, <span class="number">59</span>, <span class="number">7</span>, <span class="number">0</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">80</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">6</span>, <span class="number">920</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">950</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">280</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">670</span>));</pre></div>
<p>The subtraction wraps around.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">8</span><span class="kw-2">*</span><span class="number">60</span><span class="kw-2">*</span><span class="number">60</span>), <span class="ident">from_hmsm</span>(<span class="number">19</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">800</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>));</pre></div>
<p>Leap seconds are handled, but the subtraction assumes that it is the only leap second happened.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">leap</span> <span class="op">=</span> <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">1_300</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">zero</span>(), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">1_300</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">200</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">1_100</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">500</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">800</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">60</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">0</span>, <span class="number">300</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">1</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">6</span>, <span class="number">0</span>, <span class="number">300</span>));</pre></div>
</div><div class="impl-items"><h4 id="associatedtype.Output-1" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#associatedtype.Output" class="type">Output</a> = <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>-</code> operator.</p>
</div><h4 id="method.sub-1" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#tymethod.sub" class="fnname">sub</a>(self, rhs: <a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a>) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a class="srclink" href="../../src/chrono/naive/time.rs.html#1149-1151" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>-</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#tymethod.sub">Read more</a></p>
</div></div><h3 id="impl-Sub%3CFixedOffset%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html" title="trait core::ops::arith::Sub">Sub</a>&lt;<a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>&gt; for <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a href="#impl-Sub%3CFixedOffset%3E" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#173-180" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#associatedtype.Output" class="type">Output</a> = <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>-</code> operator.</p>
</div><h4 id="method.sub" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#tymethod.sub" class="fnname">sub</a>(self, rhs: <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#177-179" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>-</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#tymethod.sub">Read more</a></p>
</div></div><h3 id="impl-Sub%3CNaiveTime%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html" title="trait core::ops::arith::Sub">Sub</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>&gt; for <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a href="#impl-Sub%3CNaiveTime%3E" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/time.rs.html#1210-1217" title="goto source code">[src]</a></h3><div class="docblock"><p>Subtracts another <code>NaiveTime</code> from the current time.
Returns a <code>Duration</code> within +/- 1 day.
This does not overflow or underflow at all.</p>
<p>As a part of Chrono's <a href="#leap-second-handling">leap second handling</a>,
the subtraction assumes that <strong>there is no leap second ever</strong>,
except when any of the <code>NaiveTime</code>s themselves represents a leap second
in which case the assumption becomes that
<strong>there are exactly one (or two) leap second(s) ever</strong>.</p>
<p>The implementation is a wrapper around
<a href="#method.signed_duration_since"><code>NaiveTime::signed_duration_since</code></a>.</p>
<h1 id="example-28" class="section-header"><a href="#example-28">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">Duration</span>, <span class="ident">NaiveTime</span>};
<span class="kw">let</span> <span class="ident">from_hmsm</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms_milli</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">900</span>) <span class="op">-</span> <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">900</span>), <span class="ident">Duration</span>::<span class="ident">zero</span>());
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">900</span>) <span class="op">-</span> <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">875</span>), <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">25</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">900</span>) <span class="op">-</span> <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">6</span>, <span class="number">925</span>), <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">975</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">900</span>) <span class="op">-</span> <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">0</span>, <span class="number">900</span>), <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">7</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">900</span>) <span class="op">-</span> <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">0</span>, <span class="number">7</span>, <span class="number">900</span>), <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">5</span> <span class="op">*</span> <span class="number">60</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">900</span>) <span class="op">-</span> <span class="ident">from_hmsm</span>(<span class="number">0</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">900</span>), <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">3</span> <span class="op">*</span> <span class="number">3600</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">900</span>) <span class="op">-</span> <span class="ident">from_hmsm</span>(<span class="number">4</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">900</span>), <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="op">-</span><span class="number">3600</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">900</span>) <span class="op">-</span> <span class="ident">from_hmsm</span>(<span class="number">2</span>, <span class="number">4</span>, <span class="number">6</span>, <span class="number">800</span>),
<span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">3600</span> <span class="op">+</span> <span class="number">60</span> <span class="op">+</span> <span class="number">1</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">100</span>));</pre></div>
<p>Leap seconds are handled, but the subtraction assumes that
there were no other leap seconds happened.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">0</span>, <span class="number">59</span>, <span class="number">1_000</span>) <span class="op">-</span> <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">0</span>, <span class="number">59</span>, <span class="number">0</span>), <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">1</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">0</span>, <span class="number">59</span>, <span class="number">1_500</span>) <span class="op">-</span> <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">0</span>, <span class="number">59</span>, <span class="number">0</span>),
<span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">1500</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">0</span>, <span class="number">59</span>, <span class="number">1_000</span>) <span class="op">-</span> <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>), <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">60</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>) <span class="op">-</span> <span class="ident">from_hmsm</span>(<span class="number">2</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">1_000</span>), <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">1</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">0</span>, <span class="number">59</span>, <span class="number">1_000</span>) <span class="op">-</span> <span class="ident">from_hmsm</span>(<span class="number">2</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">1_000</span>),
<span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">61</span>));</pre></div>
</div><div class="impl-items"><h4 id="associatedtype.Output-2" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#associatedtype.Output" class="type">Output</a> = <a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>-</code> operator.</p>
</div><h4 id="method.sub-2" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#tymethod.sub" class="fnname">sub</a>(self, rhs: <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>) -&gt; <a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a></code><a class="srclink" href="../../src/chrono/naive/time.rs.html#1214-1216" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>-</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#tymethod.sub">Read more</a></p>
</div></div><h3 id="impl-SubAssign%3CDuration%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.SubAssign.html" title="trait core::ops::arith::SubAssign">SubAssign</a>&lt;<a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>&gt; for <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a href="#impl-SubAssign%3CDuration%3E" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/time.rs.html#1154-1159" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.sub_assign" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.SubAssign.html#tymethod.sub_assign" class="fnname">sub_assign</a>(&amp;mut self, rhs: <a class="struct" href="../../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a>)</code><a class="srclink" href="../../src/chrono/naive/time.rs.html#1156-1158" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>-=</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.SubAssign.html#tymethod.sub_assign">Read more</a></p>
</div></div><h3 id="impl-Timelike" class="impl"><code class="in-band">impl <a class="trait" href="../../chrono/trait.Timelike.html" title="trait chrono::Timelike">Timelike</a> for <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a href="#impl-Timelike" class="anchor"></a><a class="srclink" href="../../src/chrono/naive/time.rs.html#803-1010" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.hour" class="method"><code>fn <a href="../../chrono/trait.Timelike.html#tymethod.hour" class="fnname">hour</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../../src/chrono/naive/time.rs.html#815-817" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the hour number from 0 to 23.</p>
<h1 id="example-16" class="section-header"><a href="#example-16">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveTime</span>, <span class="ident">Timelike</span>};
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>).<span class="ident">hour</span>(), <span class="number">0</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">12_345_678</span>).<span class="ident">hour</span>(), <span class="number">23</span>);</pre></div>
</div><h4 id="method.minute" class="method"><code>fn <a href="../../chrono/trait.Timelike.html#tymethod.minute" class="fnname">minute</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../../src/chrono/naive/time.rs.html#830-832" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the minute number from 0 to 59.</p>
<h1 id="example-17" class="section-header"><a href="#example-17">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveTime</span>, <span class="ident">Timelike</span>};
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>).<span class="ident">minute</span>(), <span class="number">0</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">12_345_678</span>).<span class="ident">minute</span>(), <span class="number">56</span>);</pre></div>
</div><h4 id="method.second" class="method"><code>fn <a href="../../chrono/trait.Timelike.html#tymethod.second" class="fnname">second</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../../src/chrono/naive/time.rs.html#856-858" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the second number from 0 to 59.</p>
<h1 id="example-18" class="section-header"><a href="#example-18">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveTime</span>, <span class="ident">Timelike</span>};
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>).<span class="ident">second</span>(), <span class="number">0</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">12_345_678</span>).<span class="ident">second</span>(), <span class="number">4</span>);</pre></div>
<p>This method never returns 60 even when it is a leap second.
(<a href="#leap-second-handling">Why?</a>)
Use the proper <a href="#method.format">formatting method</a> to get a human-readable representation.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">leap</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms_milli</span>(<span class="number">23</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">1_000</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span>.<span class="ident">second</span>(), <span class="number">59</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span>.<span class="ident">format</span>(<span class="string">&quot;%H:%M:%S&quot;</span>).<span class="ident">to_string</span>(), <span class="string">&quot;23:59:60&quot;</span>);</pre></div>
</div><h4 id="method.nanosecond" class="method"><code>fn <a href="../../chrono/trait.Timelike.html#tymethod.nanosecond" class="fnname">nanosecond</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../../src/chrono/naive/time.rs.html#884-886" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the number of nanoseconds since the whole non-leap second.
The range from 1,000,000,000 to 1,999,999,999 represents
the <a href="#leap-second-handling">leap second</a>.</p>
<h1 id="example-19" class="section-header"><a href="#example-19">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveTime</span>, <span class="ident">Timelike</span>};
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>).<span class="ident">nanosecond</span>(), <span class="number">0</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">12_345_678</span>).<span class="ident">nanosecond</span>(), <span class="number">12_345_678</span>);</pre></div>
<p>Leap seconds may have seemingly out-of-range return values.
You can reduce the range with <code>time.nanosecond() % 1_000_000_000</code>, or
use the proper <a href="#method.format">formatting method</a> to get a human-readable representation.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">leap</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms_milli</span>(<span class="number">23</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">1_000</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span>.<span class="ident">nanosecond</span>(), <span class="number">1_000_000_000</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span>.<span class="ident">format</span>(<span class="string">&quot;%H:%M:%S%.9f&quot;</span>).<span class="ident">to_string</span>(), <span class="string">&quot;23:59:60.000000000&quot;</span>);</pre></div>
</div><h4 id="method.with_hour" class="method"><code>fn <a href="../../chrono/trait.Timelike.html#tymethod.with_hour" class="fnname">with_hour</a>(&amp;self, hour: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/time.rs.html#902-908" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveTime</code> with the hour number changed.</p>
<p>Returns <code>None</code> when the resulting <code>NaiveTime</code> would be invalid.</p>
<h1 id="example-20" class="section-header"><a href="#example-20">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveTime</span>, <span class="ident">Timelike</span>};
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">12_345_678</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_hour</span>(<span class="number">7</span>), <span class="prelude-val">Some</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano</span>(<span class="number">7</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">12_345_678</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_hour</span>(<span class="number">24</span>), <span class="prelude-val">None</span>);</pre></div>
</div><h4 id="method.with_minute" class="method"><code>fn <a href="../../chrono/trait.Timelike.html#tymethod.with_minute" class="fnname">with_minute</a>(&amp;self, min: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/time.rs.html#924-930" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveTime</code> with the minute number changed.</p>
<p>Returns <code>None</code> when the resulting <code>NaiveTime</code> would be invalid.</p>
<h1 id="example-21" class="section-header"><a href="#example-21">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveTime</span>, <span class="ident">Timelike</span>};
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">12_345_678</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_minute</span>(<span class="number">45</span>), <span class="prelude-val">Some</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano</span>(<span class="number">23</span>, <span class="number">45</span>, <span class="number">4</span>, <span class="number">12_345_678</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_minute</span>(<span class="number">60</span>), <span class="prelude-val">None</span>);</pre></div>
</div><h4 id="method.with_second" class="method"><code>fn <a href="../../chrono/trait.Timelike.html#tymethod.with_second" class="fnname">with_second</a>(&amp;self, sec: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/time.rs.html#948-954" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveTime</code> with the second number changed.</p>
<p>Returns <code>None</code> when the resulting <code>NaiveTime</code> would be invalid.
As with the <a href="#method.second"><code>second</code></a> method,
the input range is restricted to 0 through 59.</p>
<h1 id="example-22" class="section-header"><a href="#example-22">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveTime</span>, <span class="ident">Timelike</span>};
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">12_345_678</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_second</span>(<span class="number">17</span>), <span class="prelude-val">Some</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">17</span>, <span class="number">12_345_678</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_second</span>(<span class="number">60</span>), <span class="prelude-val">None</span>);</pre></div>
</div><h4 id="method.with_nanosecond" class="method"><code>fn <a href="../../chrono/trait.Timelike.html#tymethod.with_nanosecond" class="fnname">with_nanosecond</a>(&amp;self, nano: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>&gt;</code><a class="srclink" href="../../src/chrono/naive/time.rs.html#985-990" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveTime</code> with nanoseconds since the whole non-leap second changed.</p>
<p>Returns <code>None</code> when the resulting <code>NaiveTime</code> would be invalid.
As with the <a href="#method.nanosecond"><code>nanosecond</code></a> method,
the input range can exceed 1,000,000,000 for leap seconds.</p>
<h1 id="example-23" class="section-header"><a href="#example-23">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveTime</span>, <span class="ident">Timelike</span>};
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">12_345_678</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_nanosecond</span>(<span class="number">333_333_333</span>),
<span class="prelude-val">Some</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">333_333_333</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_nanosecond</span>(<span class="number">2_000_000_000</span>), <span class="prelude-val">None</span>);</pre></div>
<p>Leap seconds can theoretically follow <em>any</em> whole second.
The following would be a proper leap second at the time zone offset of UTC-00:03:57
(there are several historical examples comparable to this &quot;non-sense&quot; offset),
and therefore is allowed.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_nanosecond</span>(<span class="number">1_333_333_333</span>),
<span class="prelude-val">Some</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">1_333_333_333</span>)));</pre></div>
</div><h4 id="method.num_seconds_from_midnight" class="method"><code>fn <a href="../../chrono/trait.Timelike.html#method.num_seconds_from_midnight" class="fnname">num_seconds_from_midnight</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../../src/chrono/naive/time.rs.html#1007-1009" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the number of non-leap seconds past the last midnight.</p>
<h1 id="example-24" class="section-header"><a href="#example-24">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveTime</span>, <span class="ident">Timelike</span>};
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms</span>(<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>).<span class="ident">num_seconds_from_midnight</span>(),
<span class="number">3723</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">12_345_678</span>).<span class="ident">num_seconds_from_midnight</span>(),
<span class="number">86164</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms_milli</span>(<span class="number">23</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">1_000</span>).<span class="ident">num_seconds_from_midnight</span>(),
<span class="number">86399</span>);</pre></div>
</div><h4 id="method.hour12" class="method hidden"><code>fn <a href="../../chrono/trait.Timelike.html#method.hour12" class="fnname">hour12</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code><a class="srclink" href="../../src/chrono/lib.rs.html#1370-1377" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the hour number from 1 to 12 with a boolean flag,
which is false for AM and true for PM. <a href="../../chrono/trait.Timelike.html#method.hour12">Read more</a></p>
</div></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></div><h3 id="impl-Borrow%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211-213" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id="impl-BorrowMut%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id="impl-From%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</code><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-Into%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-Into%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -&gt; U</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-ToOwned" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,&nbsp;</span></code><a href="#impl-ToOwned" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Owned" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
</div><h4 id="method.to_owned" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fnname">to_owned</a>(&amp;self) -&gt; T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
</div><h4 id="method.clone_into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fnname">clone_into</a>(&amp;self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T)</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><details><summary><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
</div></div><h3 id="impl-ToString" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-ToString" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2194-2207" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_string" class="method hidden"><code>pub default fn <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string" class="fnname">to_string</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2200-2206" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
</div></div><h3 id="impl-TryFrom%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id="method.try_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-TryInto%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-TryInto%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#575-584" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error-1" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id="method.try_into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#581-583" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "chrono";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
@@ -1,10 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../chrono/naive/struct.NaiveTime.html">
</head>
<body>
<p>Redirecting to <a href="../../../chrono/naive/struct.NaiveTime.html">../../../chrono/naive/struct.NaiveTime.html</a>...</p>
<script>location.replace("../../../chrono/naive/struct.NaiveTime.html" + location.search + location.hash);</script>
</body>
</html>
File diff suppressed because one or more lines are too long
@@ -1,10 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../chrono/offset/struct.FixedOffset.html">
</head>
<body>
<p>Redirecting to <a href="../../../chrono/offset/struct.FixedOffset.html">../../../chrono/offset/struct.FixedOffset.html</a>...</p>
<script>location.replace("../../../chrono/offset/struct.FixedOffset.html" + location.search + location.hash);</script>
</body>
</html>
-29
View File
@@ -1,29 +0,0 @@
<!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 `offset` mod in crate `chrono`."><meta name="keywords" content="rust, rustlang, rust-lang, offset"><title>chrono::offset - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[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">&#9776;</div><a href='../../chrono/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Module offset</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li></ul></div><p class="location"><a href="../index.html">chrono</a></p><script>window.sidebarCurrent = {name: "offset", ty: "mod", relpath: "../"};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../../src/chrono/offset/mod.rs.html#4-531" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../index.html">chrono</a>::<wbr><a class="mod" href="">offset</a></span></h1><div class="docblock"><p>The time zone, which calculates offsets from the local time to UTC.</p>
<p>There are four operations provided by the <code>TimeZone</code> trait:</p>
<ol>
<li>Converting the local <code>NaiveDateTime</code> to <code>DateTime&lt;Tz&gt;</code></li>
<li>Converting the UTC <code>NaiveDateTime</code> to <code>DateTime&lt;Tz&gt;</code></li>
<li>Converting <code>DateTime&lt;Tz&gt;</code> to the local <code>NaiveDateTime</code></li>
<li>Constructing <code>DateTime&lt;Tz&gt;</code> objects from various offsets</li>
</ol>
<p>1 is used for constructors. 2 is used for the <code>with_timezone</code> method of date and time types.
3 is used for other methods, e.g. <code>year()</code> or <code>format()</code>, and provided by an associated type
which implements <code>Offset</code> (which then passed to <code>TimeZone</code> for actual implementations).
Technically speaking <code>TimeZone</code> has a total knowledge about given timescale,
but <code>Offset</code> is used as a cache to avoid the repeated conversion
and provides implementations for 1 and 3.
An <code>TimeZone</code> instance can be reconstructed from the corresponding <code>Offset</code> instance.</p>
</div><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
<table><tr class="module-item"><td><a class="struct" href="struct.FixedOffset.html" title="chrono::offset::FixedOffset struct">FixedOffset</a></td><td class="docblock-short"><p>The time zone with fixed offset, from UTC-23:59:59 to UTC+23:59:59.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.Local.html" title="chrono::offset::Local struct">Local</a></td><td class="docblock-short"><p>The local timescale. This is implemented via the standard <code>time</code> crate.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.Utc.html" title="chrono::offset::Utc struct">Utc</a></td><td class="docblock-short"><p>The UTC time zone. This is the most efficient time zone when you don't need the local time.
It is also used as an offset (which is also a dummy type).</p>
</td></tr></table><h2 id="enums" class="section-header"><a href="#enums">Enums</a></h2>
<table><tr class="module-item"><td><a class="enum" href="enum.LocalResult.html" title="chrono::offset::LocalResult enum">LocalResult</a></td><td class="docblock-short"><p>The conversion result from the local time to the timezone-aware datetime types.</p>
</td></tr></table><h2 id="traits" class="section-header"><a href="#traits">Traits</a></h2>
<table><tr class="module-item"><td><a class="trait" href="trait.Offset.html" title="chrono::offset::Offset trait">Offset</a></td><td class="docblock-short"><p>The offset from the local time to UTC.</p>
</td></tr><tr class="module-item"><td><a class="trait" href="trait.TimeZone.html" title="chrono::offset::TimeZone trait">TimeZone</a></td><td class="docblock-short"><p>The time zone.</p>
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "chrono";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
@@ -1,10 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../chrono/offset/struct.Local.html">
</head>
<body>
<p>Redirecting to <a href="../../../chrono/offset/struct.Local.html">../../../chrono/offset/struct.Local.html</a>...</p>
<script>location.replace("../../../chrono/offset/struct.Local.html" + location.search + location.hash);</script>
</body>
</html>
-1
View File
@@ -1 +0,0 @@
initSidebarItems({"enum":[["LocalResult","The conversion result from the local time to the timezone-aware datetime types."]],"struct":[["FixedOffset","The time zone with fixed offset, from UTC-23:59:59 to UTC+23:59:59."],["Local","The local timescale. This is implemented via the standard `time` crate."],["Utc","The UTC time zone. This is the most efficient time zone when you don't need the local time. It is also used as an offset (which is also a dummy type)."]],"trait":[["Offset","The offset from the local time to UTC."],["TimeZone","The time zone."]]});
-119
View File
@@ -1,119 +0,0 @@
<!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 `FixedOffset` struct in crate `chrono`."><meta name="keywords" content="rust, rustlang, rust-lang, FixedOffset"><title>chrono::offset::FixedOffset - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[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">&#9776;</div><a href='../../chrono/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Struct FixedOffset</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.east">east</a><a href="#method.east_opt">east_opt</a><a href="#method.local_minus_utc">local_minus_utc</a><a href="#method.utc_minus_local">utc_minus_local</a><a href="#method.west">west</a><a href="#method.west_opt">west_opt</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Add%3CFixedOffset%3E">Add&lt;FixedOffset&gt;</a><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Debug">Debug</a><a href="#impl-Display">Display</a><a href="#impl-Eq">Eq</a><a href="#impl-Hash">Hash</a><a href="#impl-Offset">Offset</a><a href="#impl-PartialEq%3CFixedOffset%3E">PartialEq&lt;FixedOffset&gt;</a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a><a href="#impl-Sub%3CFixedOffset%3E">Sub&lt;FixedOffset&gt;</a><a href="#impl-TimeZone">TimeZone</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><p class="location"><a href="../index.html">chrono</a>::<wbr><a href="index.html">offset</a></p><script>window.sidebarCurrent = {name: "FixedOffset", ty: "struct", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#23-25" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="../index.html">chrono</a>::<wbr><a href="index.html">offset</a>::<wbr><a class="struct" href="">FixedOffset</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct FixedOffset { /* fields omitted */ }</pre></div><div class="docblock"><p>The time zone with fixed offset, from UTC-23:59:59 to UTC+23:59:59.</p>
<p>Using the <a href="./trait.TimeZone.html"><code>TimeZone</code></a> methods
on a <code>FixedOffset</code> struct is the preferred way to construct
<code>DateTime&lt;FixedOffset&gt;</code> instances. See the <a href="#method.east"><code>east</code></a> and
<a href="#method.west"><code>west</code></a> methods for examples.</p>
</div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#27-99" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.east" class="method"><code>pub fn <a href="#method.east" class="fnname">east</a>(secs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>) -&gt; <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></code><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#42-44" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>FixedOffset</code> for the Eastern Hemisphere with given timezone difference.
The negative <code>secs</code> means the Western Hemisphere.</p>
<p>Panics on the out-of-bound <code>secs</code>.</p>
<h1 id="example" class="section-header"><a href="#example">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">FixedOffset</span>, <span class="ident">TimeZone</span>};
<span class="kw">let</span> <span class="ident">hour</span> <span class="op">=</span> <span class="number">3600</span>;
<span class="kw">let</span> <span class="ident">datetime</span> <span class="op">=</span> <span class="ident">FixedOffset</span>::<span class="ident">east</span>(<span class="number">5</span> <span class="op">*</span> <span class="ident">hour</span>).<span class="ident">ymd</span>(<span class="number">2016</span>, <span class="number">11</span>, <span class="number">08</span>)
.<span class="ident">and_hms</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">&amp;</span><span class="ident">datetime</span>.<span class="ident">to_rfc3339</span>(), <span class="string">&quot;2016-11-08T00:00:00+05:00&quot;</span>)</pre></div>
</div><h4 id="method.east_opt" class="method"><code>pub fn <a href="#method.east_opt" class="fnname">east_opt</a>(secs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>&gt;</code><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#50-56" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>FixedOffset</code> for the Eastern Hemisphere with given timezone difference.
The negative <code>secs</code> means the Western Hemisphere.</p>
<p>Returns <code>None</code> on the out-of-bound <code>secs</code>.</p>
</div><h4 id="method.west" class="method"><code>pub fn <a href="#method.west" class="fnname">west</a>(secs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>) -&gt; <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></code><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#72-74" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>FixedOffset</code> for the Western Hemisphere with given timezone difference.
The negative <code>secs</code> means the Eastern Hemisphere.</p>
<p>Panics on the out-of-bound <code>secs</code>.</p>
<h1 id="example-1" class="section-header"><a href="#example-1">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">FixedOffset</span>, <span class="ident">TimeZone</span>};
<span class="kw">let</span> <span class="ident">hour</span> <span class="op">=</span> <span class="number">3600</span>;
<span class="kw">let</span> <span class="ident">datetime</span> <span class="op">=</span> <span class="ident">FixedOffset</span>::<span class="ident">west</span>(<span class="number">5</span> <span class="op">*</span> <span class="ident">hour</span>).<span class="ident">ymd</span>(<span class="number">2016</span>, <span class="number">11</span>, <span class="number">08</span>)
.<span class="ident">and_hms</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">&amp;</span><span class="ident">datetime</span>.<span class="ident">to_rfc3339</span>(), <span class="string">&quot;2016-11-08T00:00:00-05:00&quot;</span>)</pre></div>
</div><h4 id="method.west_opt" class="method"><code>pub fn <a href="#method.west_opt" class="fnname">west_opt</a>(secs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>&gt;</code><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#80-86" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>FixedOffset</code> for the Western Hemisphere with given timezone difference.
The negative <code>secs</code> means the Eastern Hemisphere.</p>
<p>Returns <code>None</code> on the out-of-bound <code>secs</code>.</p>
</div><h4 id="method.local_minus_utc" class="method"><code>pub fn <a href="#method.local_minus_utc" class="fnname">local_minus_utc</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a></code><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#90-92" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the number of seconds to add to convert from UTC to the local time.</p>
</div><h4 id="method.utc_minus_local" class="method"><code>pub fn <a href="#method.utc_minus_local" class="fnname">utc_minus_local</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a></code><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#96-98" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the number of seconds to add to convert from the local time to UTC.</p>
</div></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Add%3CFixedOffset%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html" title="trait core::ops::arith::Add">Add</a>&lt;<a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>&gt; for <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a href="#impl-Add%3CFixedOffset%3E" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#164-171" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Output-3" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#associatedtype.Output" class="type">Output</a> = <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>+</code> operator.</p>
</div><h4 id="method.add" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add" class="fnname">add</a>(self, rhs: <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#168-170" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>+</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add">Read more</a></p>
</div></div><h3 id="impl-Add%3CFixedOffset%3E-1" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html" title="trait core::ops::arith::Add">Add</a>&lt;<a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>&gt; for <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a href="#impl-Add%3CFixedOffset%3E-1" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#182-189" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Output-4" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#associatedtype.Output" class="type">Output</a> = <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>+</code> operator.</p>
</div><h4 id="method.add-1" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add" class="fnname">add</a>(self, rhs: <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#186-188" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>+</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add">Read more</a></p>
</div></div><h3 id="impl-Add%3CFixedOffset%3E-2" class="impl"><code class="in-band">impl&lt;Tz:&nbsp;<a class="trait" href="../../chrono/offset/trait.TimeZone.html" title="trait chrono::offset::TimeZone">TimeZone</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html" title="trait core::ops::arith::Add">Add</a>&lt;<a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>&gt; for <a class="struct" href="../../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Tz&gt;</code><a href="#impl-Add%3CFixedOffset%3E-2" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#200-207" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Output-5" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#associatedtype.Output" class="type">Output</a> = <a class="struct" href="../../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Tz&gt;</code></h4><div class='docblock'><p>The resulting type after applying the <code>+</code> operator.</p>
</div><h4 id="method.add-2" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add" class="fnname">add</a>(self, rhs: <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>) -&gt; <a class="struct" href="../../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Tz&gt;</code><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#204-206" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>+</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add">Read more</a></p>
</div></div><h3 id="impl-Clone" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></code><a href="#impl-Clone" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#22" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&amp;self) -&gt; <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></code><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#22" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id="method.clone_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&amp;mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self)</code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#128-130" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3 id="impl-Copy" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></code><a href="#impl-Copy" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#22" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Debug" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#129-141" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#130-140" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id="impl-Display" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></code><a href="#impl-Display" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#143-147" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt-1" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#144-146" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id="impl-Eq" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></code><a href="#impl-Eq" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#22" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Hash" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> for <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></code><a href="#impl-Hash" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#22" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.hash" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash" class="fnname">hash</a>&lt;__H:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>&gt;(&amp;self, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>__H)</code><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#22" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Feeds this value into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash">Read more</a></p>
</div><h4 id="method.hash_slice" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice" class="fnname">hash_slice</a>&lt;H&gt;(data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[Self]</a>, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>H) <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.3.0">1.3.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#184-191" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice">Read more</a></p>
</div></div><h3 id="impl-Offset" class="impl"><code class="in-band">impl <a class="trait" href="../../chrono/offset/trait.Offset.html" title="trait chrono::offset::Offset">Offset</a> for <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></code><a href="#impl-Offset" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#123-127" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fix" class="method hidden"><code>fn <a href="../../chrono/offset/trait.Offset.html#tymethod.fix" class="fnname">fix</a>(&amp;self) -&gt; <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></code><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#124-126" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the fixed offset from UTC to the local time stored.</p>
</div></div><h3 id="impl-PartialEq%3CFixedOffset%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>&lt;<a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>&gt; for <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></code><a href="#impl-PartialEq%3CFixedOffset%3E" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#22" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.eq" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq" class="fnname">eq</a>(&amp;self, other: &amp;<a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#22" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id="method.ne" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne" class="fnname">ne</a>(&amp;self, other: &amp;<a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#22" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 id="impl-StructuralEq" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></code><a href="#impl-StructuralEq" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#22" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-StructuralPartialEq" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></code><a href="#impl-StructuralPartialEq" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#22" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sub%3CFixedOffset%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html" title="trait core::ops::arith::Sub">Sub</a>&lt;<a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>&gt; for <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a href="#impl-Sub%3CFixedOffset%3E" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#173-180" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#associatedtype.Output" class="type">Output</a> = <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>-</code> operator.</p>
</div><h4 id="method.sub" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#tymethod.sub" class="fnname">sub</a>(self, rhs: <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#177-179" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>-</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#tymethod.sub">Read more</a></p>
</div></div><h3 id="impl-Sub%3CFixedOffset%3E-1" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html" title="trait core::ops::arith::Sub">Sub</a>&lt;<a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>&gt; for <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a href="#impl-Sub%3CFixedOffset%3E-1" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#191-198" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Output-1" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#associatedtype.Output" class="type">Output</a> = <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>-</code> operator.</p>
</div><h4 id="method.sub-1" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#tymethod.sub" class="fnname">sub</a>(self, rhs: <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>) -&gt; <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#195-197" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>-</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#tymethod.sub">Read more</a></p>
</div></div><h3 id="impl-Sub%3CFixedOffset%3E-2" class="impl"><code class="in-band">impl&lt;Tz:&nbsp;<a class="trait" href="../../chrono/offset/trait.TimeZone.html" title="trait chrono::offset::TimeZone">TimeZone</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html" title="trait core::ops::arith::Sub">Sub</a>&lt;<a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>&gt; for <a class="struct" href="../../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Tz&gt;</code><a href="#impl-Sub%3CFixedOffset%3E-2" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#209-216" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Output-2" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#associatedtype.Output" class="type">Output</a> = <a class="struct" href="../../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Tz&gt;</code></h4><div class='docblock'><p>The resulting type after applying the <code>-</code> operator.</p>
</div><h4 id="method.sub-2" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#tymethod.sub" class="fnname">sub</a>(self, rhs: <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>) -&gt; <a class="struct" href="../../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Tz&gt;</code><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#213-215" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>-</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#tymethod.sub">Read more</a></p>
</div></div><h3 id="impl-TimeZone" class="impl"><code class="in-band">impl <a class="trait" href="../../chrono/offset/trait.TimeZone.html" title="trait chrono::offset::TimeZone">TimeZone</a> for <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></code><a href="#impl-TimeZone" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#101-121" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Offset" class="type"><code>type <a href="../../chrono/offset/trait.TimeZone.html#associatedtype.Offset" class="type">Offset</a> = <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></code></h4><div class='docblock'><p>An associated offset type.
This type is used to store the actual offset in date and time types.
The original <code>TimeZone</code> value can be recovered via <code>TimeZone::from_offset</code>. <a href="../../chrono/offset/trait.TimeZone.html#associatedtype.Offset">Read more</a></p>
</div><h4 id="method.from_offset" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#tymethod.from_offset" class="fnname">from_offset</a>(offset: &amp;<a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>) -&gt; <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></code><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#104-106" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Reconstructs the time zone from the offset.</p>
</div><h4 id="method.offset_from_local_date" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#tymethod.offset_from_local_date" class="fnname">offset_from_local_date</a>(&amp;self, _local: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>) -&gt; <a class="enum" href="../../chrono/offset/enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>&gt;</code><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#108-110" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates the offset(s) for given local <code>NaiveDate</code> if possible.</p>
</div><h4 id="method.offset_from_local_datetime" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#tymethod.offset_from_local_datetime" class="fnname">offset_from_local_datetime</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;_local: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a><br>) -&gt; <a class="enum" href="../../chrono/offset/enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>&gt;</code><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#111-113" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates the offset(s) for given local <code>NaiveDateTime</code> if possible.</p>
</div><h4 id="method.offset_from_utc_date" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#tymethod.offset_from_utc_date" class="fnname">offset_from_utc_date</a>(&amp;self, _utc: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>) -&gt; <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></code><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#115-117" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates the offset for given UTC <code>NaiveDate</code>. This cannot fail.</p>
</div><h4 id="method.offset_from_utc_datetime" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#tymethod.offset_from_utc_datetime" class="fnname">offset_from_utc_datetime</a>(&amp;self, _utc: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>) -&gt; <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></code><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#118-120" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates the offset for given UTC <code>NaiveDateTime</code>. This cannot fail.</p>
</div><h4 id="method.ymd" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.ymd" class="fnname">ymd</a>(&amp;self, year: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, month: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, day: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="struct" href="../../chrono/struct.Date.html" title="struct chrono::Date">Date</a>&lt;Self&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#213-215" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Makes a new <code>Date</code> from year, month, day and the current time zone.
This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. <a href="../../chrono/offset/trait.TimeZone.html#method.ymd">Read more</a></p>
</div><h4 id="method.ymd_opt" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.ymd_opt" class="fnname">ymd_opt</a>(&amp;self, year: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, month: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, day: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="../../chrono/offset/enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../../chrono/struct.Date.html" title="struct chrono::Date">Date</a>&lt;Self&gt;&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#233-238" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Makes a new <code>Date</code> from year, month, day and the current time zone.
This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. <a href="../../chrono/offset/trait.TimeZone.html#method.ymd_opt">Read more</a></p>
</div><h4 id="method.yo" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.yo" class="fnname">yo</a>(&amp;self, year: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, ordinal: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="struct" href="../../chrono/struct.Date.html" title="struct chrono::Date">Date</a>&lt;Self&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#255-257" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Makes a new <code>Date</code> from year, day of year (DOY or &quot;ordinal&quot;) and the current time zone.
This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. <a href="../../chrono/offset/trait.TimeZone.html#method.yo">Read more</a></p>
</div><h4 id="method.yo_opt" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.yo_opt" class="fnname">yo_opt</a>(&amp;self, year: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, ordinal: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="../../chrono/offset/enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../../chrono/struct.Date.html" title="struct chrono::Date">Date</a>&lt;Self&gt;&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#266-271" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Makes a new <code>Date</code> from year, day of year (DOY or &quot;ordinal&quot;) and the current time zone.
This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. <a href="../../chrono/offset/trait.TimeZone.html#method.yo_opt">Read more</a></p>
</div><h4 id="method.isoywd" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.isoywd" class="fnname">isoywd</a>(&amp;self, year: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, week: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, weekday: <a class="enum" href="../../chrono/enum.Weekday.html" title="enum chrono::Weekday">Weekday</a>) -&gt; <a class="struct" href="../../chrono/struct.Date.html" title="struct chrono::Date">Date</a>&lt;Self&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#290-292" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Makes a new <code>Date</code> from ISO week date (year and week number), day of the week (DOW) and
the current time zone.
This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE.
The resulting <code>Date</code> may have a different year from the input year. <a href="../../chrono/offset/trait.TimeZone.html#method.isoywd">Read more</a></p>
</div><h4 id="method.isoywd_opt" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.isoywd_opt" class="fnname">isoywd_opt</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;year: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;week: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;weekday: <a class="enum" href="../../chrono/enum.Weekday.html" title="enum chrono::Weekday">Weekday</a><br>) -&gt; <a class="enum" href="../../chrono/offset/enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../../chrono/struct.Date.html" title="struct chrono::Date">Date</a>&lt;Self&gt;&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#303-308" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Makes a new <code>Date</code> from ISO week date (year and week number), day of the week (DOW) and
the current time zone.
This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE.
The resulting <code>Date</code> may have a different year from the input year. <a href="../../chrono/offset/trait.TimeZone.html#method.isoywd_opt">Read more</a></p>
</div><h4 id="method.timestamp" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.timestamp" class="fnname">timestamp</a>(&amp;self, secs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>, nsecs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="struct" href="../../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Self&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#324-326" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Makes a new <code>DateTime</code> from the number of non-leap seconds
since January 1, 1970 0:00:00 UTC (aka &quot;UNIX timestamp&quot;)
and the number of nanoseconds since the last whole non-leap second. <a href="../../chrono/offset/trait.TimeZone.html#method.timestamp">Read more</a></p>
</div><h4 id="method.timestamp_opt" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.timestamp_opt" class="fnname">timestamp_opt</a>(&amp;self, secs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>, nsecs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="../../chrono/offset/enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Self&gt;&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#334-339" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Makes a new <code>DateTime</code> from the number of non-leap seconds
since January 1, 1970 0:00:00 UTC (aka &quot;UNIX timestamp&quot;)
and the number of nanoseconds since the last whole non-leap second. <a href="../../chrono/offset/trait.TimeZone.html#method.timestamp_opt">Read more</a></p>
</div><h4 id="method.timestamp_millis" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.timestamp_millis" class="fnname">timestamp_millis</a>(&amp;self, millis: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>) -&gt; <a class="struct" href="../../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Self&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#354-356" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Makes a new <code>DateTime</code> from the number of non-leap milliseconds
since January 1, 1970 0:00:00 UTC (aka &quot;UNIX timestamp&quot;). <a href="../../chrono/offset/trait.TimeZone.html#method.timestamp_millis">Read more</a></p>
</div><h4 id="method.timestamp_millis_opt" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.timestamp_millis_opt" class="fnname">timestamp_millis_opt</a>(&amp;self, millis: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>) -&gt; <a class="enum" href="../../chrono/offset/enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Self&gt;&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#375-382" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Makes a new <code>DateTime</code> from the number of non-leap milliseconds
since January 1, 1970 0:00:00 UTC (aka &quot;UNIX timestamp&quot;). <a href="../../chrono/offset/trait.TimeZone.html#method.timestamp_millis_opt">Read more</a></p>
</div><h4 id="method.timestamp_nanos" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.timestamp_nanos" class="fnname">timestamp_nanos</a>(&amp;self, nanos: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>) -&gt; <a class="struct" href="../../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Self&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#397-404" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Makes a new <code>DateTime</code> from the number of non-leap nanoseconds
since January 1, 1970 0:00:00 UTC (aka &quot;UNIX timestamp&quot;). <a href="../../chrono/offset/trait.TimeZone.html#method.timestamp_nanos">Read more</a></p>
</div><h4 id="method.datetime_from_str" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.datetime_from_str" class="fnname">datetime_from_str</a>(&amp;self, s: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, fmt: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="type" href="../../chrono/format/type.ParseResult.html" title="type chrono::format::ParseResult">ParseResult</a>&lt;<a class="struct" href="../../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Self&gt;&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#416-420" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Parses a string with the specified format string and
returns a <code>DateTime</code> with the current offset.
See the <a href="../format/strftime/index.html"><code>format::strftime</code> module</a>
on the supported escape sequences. <a href="../../chrono/offset/trait.TimeZone.html#method.datetime_from_str">Read more</a></p>
</div><h4 id="method.from_local_date" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.from_local_date" class="fnname">from_local_date</a>(&amp;self, local: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>) -&gt; <a class="enum" href="../../chrono/offset/enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../../chrono/struct.Date.html" title="struct chrono::Date">Date</a>&lt;Self&gt;&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#432-437" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Converts the local <code>NaiveDate</code> to the timezone-aware <code>Date</code> if possible.</p>
</div><h4 id="method.from_local_datetime" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.from_local_datetime" class="fnname">from_local_datetime</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;local: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a><br>) -&gt; <a class="enum" href="../../chrono/offset/enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Self&gt;&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#440-443" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Converts the local <code>NaiveDateTime</code> to the timezone-aware <code>DateTime</code> if possible.</p>
</div><h4 id="method.from_utc_date" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.from_utc_date" class="fnname">from_utc_date</a>(&amp;self, utc: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>) -&gt; <a class="struct" href="../../chrono/struct.Date.html" title="struct chrono::Date">Date</a>&lt;Self&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#453-455" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Converts the UTC <code>NaiveDate</code> to the local time.
The UTC is continuous and thus this cannot fail (but can give the duplicate local time). <a href="../../chrono/offset/trait.TimeZone.html#method.from_utc_date">Read more</a></p>
</div><h4 id="method.from_utc_datetime" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.from_utc_datetime" class="fnname">from_utc_datetime</a>(&amp;self, utc: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>) -&gt; <a class="struct" href="../../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Self&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#459-461" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Converts the UTC <code>NaiveDateTime</code> to the local time.
The UTC is continuous and thus this cannot fail (but can give the duplicate local time). <a href="../../chrono/offset/trait.TimeZone.html#method.from_utc_datetime">Read more</a></p>
</div></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></div><h3 id="impl-Borrow%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211-213" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id="impl-BorrowMut%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id="impl-From%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</code><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-Into%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-Into%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -&gt; U</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-ToOwned" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,&nbsp;</span></code><a href="#impl-ToOwned" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Owned" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
</div><h4 id="method.to_owned" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fnname">to_owned</a>(&amp;self) -&gt; T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
</div><h4 id="method.clone_into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fnname">clone_into</a>(&amp;self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T)</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><details><summary><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
</div></div><h3 id="impl-ToString" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-ToString" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2194-2207" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_string" class="method hidden"><code>pub default fn <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string" class="fnname">to_string</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2200-2206" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
</div></div><h3 id="impl-TryFrom%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id="method.try_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-TryInto%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-TryInto%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#575-584" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error-1" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id="method.try_into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#581-583" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "chrono";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
-78
View File
@@ -1,78 +0,0 @@
<!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 `Local` struct in crate `chrono`."><meta name="keywords" content="rust, rustlang, rust-lang, Local"><title>chrono::offset::Local - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[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">&#9776;</div><a href='../../chrono/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Struct Local</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.now">now</a><a href="#method.today">today</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Debug">Debug</a><a href="#impl-TimeZone">TimeZone</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><p class="location"><a href="../index.html">chrono</a>::<wbr><a href="index.html">offset</a></p><script>window.sidebarCurrent = {name: "Local", ty: "struct", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../../src/chrono/offset/local.rs.html#91" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="../index.html">chrono</a>::<wbr><a href="index.html">offset</a>::<wbr><a class="struct" href="">Local</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct Local;</pre></div><div class="docblock"><p>The local timescale. This is implemented via the standard <code>time</code> crate.</p>
<p>Using the <a href="./trait.TimeZone.html"><code>TimeZone</code></a> methods
on the Local struct is the preferred way to construct <code>DateTime&lt;Local&gt;</code>
instances.</p>
<h1 id="example" class="section-header"><a href="#example">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">Local</span>, <span class="ident">DateTime</span>, <span class="ident">TimeZone</span>};
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">DateTime</span><span class="op">&lt;</span><span class="ident">Local</span><span class="op">&gt;</span> <span class="op">=</span> <span class="ident">Local</span>::<span class="ident">now</span>();
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">DateTime</span><span class="op">&lt;</span><span class="ident">Local</span><span class="op">&gt;</span> <span class="op">=</span> <span class="ident">Local</span>.<span class="ident">timestamp</span>(<span class="number">0</span>, <span class="number">0</span>);</pre></div>
</div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl <a class="struct" href="../../chrono/offset/struct.Local.html" title="struct chrono::offset::Local">Local</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/local.rs.html#93-115" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.today" class="method"><code>pub fn <a href="#method.today" class="fnname">today</a>() -&gt; <a class="struct" href="../../chrono/struct.Date.html" title="struct chrono::Date">Date</a>&lt;<a class="struct" href="../../chrono/offset/struct.Local.html" title="struct chrono::offset::Local">Local</a>&gt;</code><a class="srclink" href="../../src/chrono/offset/local.rs.html#95-97" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns a <code>Date</code> which corresponds to the current date.</p>
</div><h4 id="method.now" class="method"><code>pub fn <a href="#method.now" class="fnname">now</a>() -&gt; <a class="struct" href="../../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;<a class="struct" href="../../chrono/offset/struct.Local.html" title="struct chrono::offset::Local">Local</a>&gt;</code><a class="srclink" href="../../src/chrono/offset/local.rs.html#101-103" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns a <code>DateTime</code> which corresponds to the current date.</p>
</div></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Clone" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../chrono/offset/struct.Local.html" title="struct chrono::offset::Local">Local</a></code><a href="#impl-Clone" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/local.rs.html#90" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&amp;self) -&gt; <a class="struct" href="../../chrono/offset/struct.Local.html" title="struct chrono::offset::Local">Local</a></code><a class="srclink" href="../../src/chrono/offset/local.rs.html#90" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id="method.clone_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&amp;mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self)</code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#128-130" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3 id="impl-Copy" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="struct" href="../../chrono/offset/struct.Local.html" title="struct chrono::offset::Local">Local</a></code><a href="#impl-Copy" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/local.rs.html#90" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Debug" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../chrono/offset/struct.Local.html" title="struct chrono::offset::Local">Local</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/local.rs.html#90" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class="srclink" href="../../src/chrono/offset/local.rs.html#90" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id="impl-TimeZone" class="impl"><code class="in-band">impl <a class="trait" href="../../chrono/offset/trait.TimeZone.html" title="trait chrono::offset::TimeZone">TimeZone</a> for <a class="struct" href="../../chrono/offset/struct.Local.html" title="struct chrono::offset::Local">Local</a></code><a href="#impl-TimeZone" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/local.rs.html#117-194" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Offset" class="type"><code>type <a href="../../chrono/offset/trait.TimeZone.html#associatedtype.Offset" class="type">Offset</a> = <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></code></h4><div class='docblock'><p>An associated offset type.
This type is used to store the actual offset in date and time types.
The original <code>TimeZone</code> value can be recovered via <code>TimeZone::from_offset</code>. <a href="../../chrono/offset/trait.TimeZone.html#associatedtype.Offset">Read more</a></p>
</div><h4 id="method.from_offset" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#tymethod.from_offset" class="fnname">from_offset</a>(_offset: &amp;<a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>) -&gt; <a class="struct" href="../../chrono/offset/struct.Local.html" title="struct chrono::offset::Local">Local</a></code><a class="srclink" href="../../src/chrono/offset/local.rs.html#120-122" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Reconstructs the time zone from the offset.</p>
</div><h4 id="method.offset_from_local_date" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#tymethod.offset_from_local_date" class="fnname">offset_from_local_date</a>(&amp;self, local: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>) -&gt; <a class="enum" href="../../chrono/offset/enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>&gt;</code><a class="srclink" href="../../src/chrono/offset/local.rs.html#125-127" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates the offset(s) for given local <code>NaiveDate</code> if possible.</p>
</div><h4 id="method.offset_from_local_datetime" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#tymethod.offset_from_local_datetime" class="fnname">offset_from_local_datetime</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;local: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a><br>) -&gt; <a class="enum" href="../../chrono/offset/enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>&gt;</code><a class="srclink" href="../../src/chrono/offset/local.rs.html#129-131" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates the offset(s) for given local <code>NaiveDateTime</code> if possible.</p>
</div><h4 id="method.offset_from_utc_date" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#tymethod.offset_from_utc_date" class="fnname">offset_from_utc_date</a>(&amp;self, utc: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>) -&gt; <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></code><a class="srclink" href="../../src/chrono/offset/local.rs.html#133-135" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates the offset for given UTC <code>NaiveDate</code>. This cannot fail.</p>
</div><h4 id="method.offset_from_utc_datetime" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#tymethod.offset_from_utc_datetime" class="fnname">offset_from_utc_datetime</a>(&amp;self, utc: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>) -&gt; <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></code><a class="srclink" href="../../src/chrono/offset/local.rs.html#137-139" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates the offset for given UTC <code>NaiveDateTime</code>. This cannot fail.</p>
</div><h4 id="method.from_local_date" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.from_local_date" class="fnname">from_local_date</a>(&amp;self, local: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>) -&gt; <a class="enum" href="../../chrono/offset/enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../../chrono/struct.Date.html" title="struct chrono::Date">Date</a>&lt;<a class="struct" href="../../chrono/offset/struct.Local.html" title="struct chrono::offset::Local">Local</a>&gt;&gt;</code><a class="srclink" href="../../src/chrono/offset/local.rs.html#142-148" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Converts the local <code>NaiveDate</code> to the timezone-aware <code>Date</code> if possible.</p>
</div><h4 id="method.from_local_datetime" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.from_local_datetime" class="fnname">from_local_datetime</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;local: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a><br>) -&gt; <a class="enum" href="../../chrono/offset/enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;<a class="struct" href="../../chrono/offset/struct.Local.html" title="struct chrono::offset::Local">Local</a>&gt;&gt;</code><a class="srclink" href="../../src/chrono/offset/local.rs.html#160-169" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Converts the local <code>NaiveDateTime</code> to the timezone-aware <code>DateTime</code> if possible.</p>
</div><h4 id="method.from_utc_date" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.from_utc_date" class="fnname">from_utc_date</a>(&amp;self, utc: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>) -&gt; <a class="struct" href="../../chrono/struct.Date.html" title="struct chrono::Date">Date</a>&lt;<a class="struct" href="../../chrono/offset/struct.Local.html" title="struct chrono::offset::Local">Local</a>&gt;</code><a class="srclink" href="../../src/chrono/offset/local.rs.html#171-174" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Converts the UTC <code>NaiveDate</code> to the local time.
The UTC is continuous and thus this cannot fail (but can give the duplicate local time). <a href="../../chrono/offset/trait.TimeZone.html#method.from_utc_date">Read more</a></p>
</div><h4 id="method.from_utc_datetime" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.from_utc_datetime" class="fnname">from_utc_datetime</a>(&amp;self, utc: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>) -&gt; <a class="struct" href="../../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;<a class="struct" href="../../chrono/offset/struct.Local.html" title="struct chrono::offset::Local">Local</a>&gt;</code><a class="srclink" href="../../src/chrono/offset/local.rs.html#184-193" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Converts the UTC <code>NaiveDateTime</code> to the local time.
The UTC is continuous and thus this cannot fail (but can give the duplicate local time). <a href="../../chrono/offset/trait.TimeZone.html#method.from_utc_datetime">Read more</a></p>
</div><h4 id="method.ymd" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.ymd" class="fnname">ymd</a>(&amp;self, year: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, month: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, day: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="struct" href="../../chrono/struct.Date.html" title="struct chrono::Date">Date</a>&lt;Self&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#213-215" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Makes a new <code>Date</code> from year, month, day and the current time zone.
This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. <a href="../../chrono/offset/trait.TimeZone.html#method.ymd">Read more</a></p>
</div><h4 id="method.ymd_opt" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.ymd_opt" class="fnname">ymd_opt</a>(&amp;self, year: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, month: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, day: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="../../chrono/offset/enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../../chrono/struct.Date.html" title="struct chrono::Date">Date</a>&lt;Self&gt;&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#233-238" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Makes a new <code>Date</code> from year, month, day and the current time zone.
This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. <a href="../../chrono/offset/trait.TimeZone.html#method.ymd_opt">Read more</a></p>
</div><h4 id="method.yo" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.yo" class="fnname">yo</a>(&amp;self, year: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, ordinal: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="struct" href="../../chrono/struct.Date.html" title="struct chrono::Date">Date</a>&lt;Self&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#255-257" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Makes a new <code>Date</code> from year, day of year (DOY or &quot;ordinal&quot;) and the current time zone.
This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. <a href="../../chrono/offset/trait.TimeZone.html#method.yo">Read more</a></p>
</div><h4 id="method.yo_opt" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.yo_opt" class="fnname">yo_opt</a>(&amp;self, year: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, ordinal: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="../../chrono/offset/enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../../chrono/struct.Date.html" title="struct chrono::Date">Date</a>&lt;Self&gt;&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#266-271" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Makes a new <code>Date</code> from year, day of year (DOY or &quot;ordinal&quot;) and the current time zone.
This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. <a href="../../chrono/offset/trait.TimeZone.html#method.yo_opt">Read more</a></p>
</div><h4 id="method.isoywd" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.isoywd" class="fnname">isoywd</a>(&amp;self, year: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, week: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, weekday: <a class="enum" href="../../chrono/enum.Weekday.html" title="enum chrono::Weekday">Weekday</a>) -&gt; <a class="struct" href="../../chrono/struct.Date.html" title="struct chrono::Date">Date</a>&lt;Self&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#290-292" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Makes a new <code>Date</code> from ISO week date (year and week number), day of the week (DOW) and
the current time zone.
This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE.
The resulting <code>Date</code> may have a different year from the input year. <a href="../../chrono/offset/trait.TimeZone.html#method.isoywd">Read more</a></p>
</div><h4 id="method.isoywd_opt" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.isoywd_opt" class="fnname">isoywd_opt</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;year: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;week: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;weekday: <a class="enum" href="../../chrono/enum.Weekday.html" title="enum chrono::Weekday">Weekday</a><br>) -&gt; <a class="enum" href="../../chrono/offset/enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../../chrono/struct.Date.html" title="struct chrono::Date">Date</a>&lt;Self&gt;&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#303-308" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Makes a new <code>Date</code> from ISO week date (year and week number), day of the week (DOW) and
the current time zone.
This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE.
The resulting <code>Date</code> may have a different year from the input year. <a href="../../chrono/offset/trait.TimeZone.html#method.isoywd_opt">Read more</a></p>
</div><h4 id="method.timestamp" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.timestamp" class="fnname">timestamp</a>(&amp;self, secs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>, nsecs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="struct" href="../../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Self&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#324-326" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Makes a new <code>DateTime</code> from the number of non-leap seconds
since January 1, 1970 0:00:00 UTC (aka &quot;UNIX timestamp&quot;)
and the number of nanoseconds since the last whole non-leap second. <a href="../../chrono/offset/trait.TimeZone.html#method.timestamp">Read more</a></p>
</div><h4 id="method.timestamp_opt" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.timestamp_opt" class="fnname">timestamp_opt</a>(&amp;self, secs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>, nsecs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="../../chrono/offset/enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Self&gt;&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#334-339" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Makes a new <code>DateTime</code> from the number of non-leap seconds
since January 1, 1970 0:00:00 UTC (aka &quot;UNIX timestamp&quot;)
and the number of nanoseconds since the last whole non-leap second. <a href="../../chrono/offset/trait.TimeZone.html#method.timestamp_opt">Read more</a></p>
</div><h4 id="method.timestamp_millis" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.timestamp_millis" class="fnname">timestamp_millis</a>(&amp;self, millis: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>) -&gt; <a class="struct" href="../../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Self&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#354-356" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Makes a new <code>DateTime</code> from the number of non-leap milliseconds
since January 1, 1970 0:00:00 UTC (aka &quot;UNIX timestamp&quot;). <a href="../../chrono/offset/trait.TimeZone.html#method.timestamp_millis">Read more</a></p>
</div><h4 id="method.timestamp_millis_opt" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.timestamp_millis_opt" class="fnname">timestamp_millis_opt</a>(&amp;self, millis: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>) -&gt; <a class="enum" href="../../chrono/offset/enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Self&gt;&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#375-382" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Makes a new <code>DateTime</code> from the number of non-leap milliseconds
since January 1, 1970 0:00:00 UTC (aka &quot;UNIX timestamp&quot;). <a href="../../chrono/offset/trait.TimeZone.html#method.timestamp_millis_opt">Read more</a></p>
</div><h4 id="method.timestamp_nanos" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.timestamp_nanos" class="fnname">timestamp_nanos</a>(&amp;self, nanos: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>) -&gt; <a class="struct" href="../../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Self&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#397-404" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Makes a new <code>DateTime</code> from the number of non-leap nanoseconds
since January 1, 1970 0:00:00 UTC (aka &quot;UNIX timestamp&quot;). <a href="../../chrono/offset/trait.TimeZone.html#method.timestamp_nanos">Read more</a></p>
</div><h4 id="method.datetime_from_str" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.datetime_from_str" class="fnname">datetime_from_str</a>(&amp;self, s: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, fmt: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="type" href="../../chrono/format/type.ParseResult.html" title="type chrono::format::ParseResult">ParseResult</a>&lt;<a class="struct" href="../../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Self&gt;&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#416-420" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Parses a string with the specified format string and
returns a <code>DateTime</code> with the current offset.
See the <a href="../format/strftime/index.html"><code>format::strftime</code> module</a>
on the supported escape sequences. <a href="../../chrono/offset/trait.TimeZone.html#method.datetime_from_str">Read more</a></p>
</div></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../chrono/offset/struct.Local.html" title="struct chrono::offset::Local">Local</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../chrono/offset/struct.Local.html" title="struct chrono::offset::Local">Local</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../chrono/offset/struct.Local.html" title="struct chrono::offset::Local">Local</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../chrono/offset/struct.Local.html" title="struct chrono::offset::Local">Local</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../chrono/offset/struct.Local.html" title="struct chrono::offset::Local">Local</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></div><h3 id="impl-Borrow%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211-213" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id="impl-BorrowMut%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id="impl-From%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</code><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-Into%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-Into%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -&gt; U</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-ToOwned" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,&nbsp;</span></code><a href="#impl-ToOwned" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Owned" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
</div><h4 id="method.to_owned" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fnname">to_owned</a>(&amp;self) -&gt; T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
</div><h4 id="method.clone_into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fnname">clone_into</a>(&amp;self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T)</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><details><summary><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
</div></div><h3 id="impl-TryFrom%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id="method.try_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-TryInto%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-TryInto%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#575-584" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error-1" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id="method.try_into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#581-583" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "chrono";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
-87
View File
@@ -1,87 +0,0 @@
<!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 `Utc` struct in crate `chrono`."><meta name="keywords" content="rust, rustlang, rust-lang, Utc"><title>chrono::offset::Utc - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[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">&#9776;</div><a href='../../chrono/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Struct Utc</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.now">now</a><a href="#method.today">today</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Debug">Debug</a><a href="#impl-Display">Display</a><a href="#impl-Eq">Eq</a><a href="#impl-Offset">Offset</a><a href="#impl-PartialEq%3CUtc%3E">PartialEq&lt;Utc&gt;</a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a><a href="#impl-TimeZone">TimeZone</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><p class="location"><a href="../index.html">chrono</a>::<wbr><a href="index.html">offset</a></p><script>window.sidebarCurrent = {name: "Utc", ty: "struct", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../../src/chrono/offset/utc.rs.html#36" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="../index.html">chrono</a>::<wbr><a href="index.html">offset</a>::<wbr><a class="struct" href="">Utc</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct Utc;</pre></div><div class="docblock"><p>The UTC time zone. This is the most efficient time zone when you don't need the local time.
It is also used as an offset (which is also a dummy type).</p>
<p>Using the <a href="./trait.TimeZone.html"><code>TimeZone</code></a> methods
on the UTC struct is the preferred way to construct <code>DateTime&lt;Utc&gt;</code>
instances.</p>
<h1 id="example" class="section-header"><a href="#example">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">DateTime</span>, <span class="ident">TimeZone</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Utc</span>};
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">DateTime</span>::<span class="op">&lt;</span><span class="ident">Utc</span><span class="op">&gt;</span>::<span class="ident">from_utc</span>(<span class="ident">NaiveDateTime</span>::<span class="ident">from_timestamp</span>(<span class="number">61</span>, <span class="number">0</span>), <span class="ident">Utc</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Utc</span>.<span class="ident">timestamp</span>(<span class="number">61</span>, <span class="number">0</span>), <span class="ident">dt</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Utc</span>.<span class="ident">ymd</span>(<span class="number">1970</span>, <span class="number">1</span>, <span class="number">1</span>).<span class="ident">and_hms</span>(<span class="number">0</span>, <span class="number">1</span>, <span class="number">1</span>), <span class="ident">dt</span>);</pre></div>
</div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl <a class="struct" href="../../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/utc.rs.html#39-60" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.today" class="method"><code>pub fn <a href="#method.today" class="fnname">today</a>() -&gt; <a class="struct" href="../../chrono/struct.Date.html" title="struct chrono::Date">Date</a>&lt;<a class="struct" href="../../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a>&gt;</code><a class="srclink" href="../../src/chrono/offset/utc.rs.html#41-43" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns a <code>Date</code> which corresponds to the current date.</p>
</div><h4 id="method.now" class="method"><code>pub fn <a href="#method.now" class="fnname">now</a>() -&gt; <a class="struct" href="../../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;<a class="struct" href="../../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a>&gt;</code><a class="srclink" href="../../src/chrono/offset/utc.rs.html#47-52" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns a <code>DateTime</code> which corresponds to the current date.</p>
</div></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Clone" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a></code><a href="#impl-Clone" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/utc.rs.html#35" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&amp;self) -&gt; <a class="struct" href="../../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a></code><a class="srclink" href="../../src/chrono/offset/utc.rs.html#35" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id="method.clone_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&amp;mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self)</code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#128-130" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3 id="impl-Copy" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="struct" href="../../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a></code><a href="#impl-Copy" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/utc.rs.html#35" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Debug" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/utc.rs.html#90-94" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class="srclink" href="../../src/chrono/offset/utc.rs.html#91-93" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id="impl-Display" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="../../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a></code><a href="#impl-Display" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/utc.rs.html#96-100" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt-1" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class="srclink" href="../../src/chrono/offset/utc.rs.html#97-99" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id="impl-Eq" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="../../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a></code><a href="#impl-Eq" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/utc.rs.html#35" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Offset" class="impl"><code class="in-band">impl <a class="trait" href="../../chrono/offset/trait.Offset.html" title="trait chrono::offset::Offset">Offset</a> for <a class="struct" href="../../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a></code><a href="#impl-Offset" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/utc.rs.html#84-88" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fix" class="method hidden"><code>fn <a href="../../chrono/offset/trait.Offset.html#tymethod.fix" class="fnname">fix</a>(&amp;self) -&gt; <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></code><a class="srclink" href="../../src/chrono/offset/utc.rs.html#85-87" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the fixed offset from UTC to the local time stored.</p>
</div></div><h3 id="impl-PartialEq%3CUtc%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>&lt;<a class="struct" href="../../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a>&gt; for <a class="struct" href="../../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a></code><a href="#impl-PartialEq%3CUtc%3E" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/utc.rs.html#35" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.eq" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq" class="fnname">eq</a>(&amp;self, other: &amp;<a class="struct" href="../../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/chrono/offset/utc.rs.html#35" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id="method.ne" class="method hidden"><code><span class="docblock attributes">#[must_use]</span>pub fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne" class="fnname">ne</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#209-211" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 id="impl-StructuralEq" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="struct" href="../../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a></code><a href="#impl-StructuralEq" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/utc.rs.html#35" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-StructuralPartialEq" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="struct" href="../../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a></code><a href="#impl-StructuralPartialEq" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/utc.rs.html#35" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-TimeZone" class="impl"><code class="in-band">impl <a class="trait" href="../../chrono/offset/trait.TimeZone.html" title="trait chrono::offset::TimeZone">TimeZone</a> for <a class="struct" href="../../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a></code><a href="#impl-TimeZone" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/utc.rs.html#62-82" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Offset" class="type"><code>type <a href="../../chrono/offset/trait.TimeZone.html#associatedtype.Offset" class="type">Offset</a> = <a class="struct" href="../../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a></code></h4><div class='docblock'><p>An associated offset type.
This type is used to store the actual offset in date and time types.
The original <code>TimeZone</code> value can be recovered via <code>TimeZone::from_offset</code>. <a href="../../chrono/offset/trait.TimeZone.html#associatedtype.Offset">Read more</a></p>
</div><h4 id="method.from_offset" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#tymethod.from_offset" class="fnname">from_offset</a>(_state: &amp;<a class="struct" href="../../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a>) -&gt; <a class="struct" href="../../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a></code><a class="srclink" href="../../src/chrono/offset/utc.rs.html#65-67" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Reconstructs the time zone from the offset.</p>
</div><h4 id="method.offset_from_local_date" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#tymethod.offset_from_local_date" class="fnname">offset_from_local_date</a>(&amp;self, _local: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>) -&gt; <a class="enum" href="../../chrono/offset/enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a>&gt;</code><a class="srclink" href="../../src/chrono/offset/utc.rs.html#69-71" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates the offset(s) for given local <code>NaiveDate</code> if possible.</p>
</div><h4 id="method.offset_from_local_datetime" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#tymethod.offset_from_local_datetime" class="fnname">offset_from_local_datetime</a>(&amp;self, _local: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>) -&gt; <a class="enum" href="../../chrono/offset/enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a>&gt;</code><a class="srclink" href="../../src/chrono/offset/utc.rs.html#72-74" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates the offset(s) for given local <code>NaiveDateTime</code> if possible.</p>
</div><h4 id="method.offset_from_utc_date" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#tymethod.offset_from_utc_date" class="fnname">offset_from_utc_date</a>(&amp;self, _utc: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>) -&gt; <a class="struct" href="../../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a></code><a class="srclink" href="../../src/chrono/offset/utc.rs.html#76-78" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates the offset for given UTC <code>NaiveDate</code>. This cannot fail.</p>
</div><h4 id="method.offset_from_utc_datetime" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#tymethod.offset_from_utc_datetime" class="fnname">offset_from_utc_datetime</a>(&amp;self, _utc: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>) -&gt; <a class="struct" href="../../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a></code><a class="srclink" href="../../src/chrono/offset/utc.rs.html#79-81" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates the offset for given UTC <code>NaiveDateTime</code>. This cannot fail.</p>
</div><h4 id="method.ymd" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.ymd" class="fnname">ymd</a>(&amp;self, year: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, month: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, day: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="struct" href="../../chrono/struct.Date.html" title="struct chrono::Date">Date</a>&lt;Self&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#213-215" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Makes a new <code>Date</code> from year, month, day and the current time zone.
This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. <a href="../../chrono/offset/trait.TimeZone.html#method.ymd">Read more</a></p>
</div><h4 id="method.ymd_opt" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.ymd_opt" class="fnname">ymd_opt</a>(&amp;self, year: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, month: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, day: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="../../chrono/offset/enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../../chrono/struct.Date.html" title="struct chrono::Date">Date</a>&lt;Self&gt;&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#233-238" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Makes a new <code>Date</code> from year, month, day and the current time zone.
This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. <a href="../../chrono/offset/trait.TimeZone.html#method.ymd_opt">Read more</a></p>
</div><h4 id="method.yo" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.yo" class="fnname">yo</a>(&amp;self, year: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, ordinal: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="struct" href="../../chrono/struct.Date.html" title="struct chrono::Date">Date</a>&lt;Self&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#255-257" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Makes a new <code>Date</code> from year, day of year (DOY or &quot;ordinal&quot;) and the current time zone.
This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. <a href="../../chrono/offset/trait.TimeZone.html#method.yo">Read more</a></p>
</div><h4 id="method.yo_opt" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.yo_opt" class="fnname">yo_opt</a>(&amp;self, year: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, ordinal: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="../../chrono/offset/enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../../chrono/struct.Date.html" title="struct chrono::Date">Date</a>&lt;Self&gt;&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#266-271" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Makes a new <code>Date</code> from year, day of year (DOY or &quot;ordinal&quot;) and the current time zone.
This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. <a href="../../chrono/offset/trait.TimeZone.html#method.yo_opt">Read more</a></p>
</div><h4 id="method.isoywd" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.isoywd" class="fnname">isoywd</a>(&amp;self, year: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, week: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, weekday: <a class="enum" href="../../chrono/enum.Weekday.html" title="enum chrono::Weekday">Weekday</a>) -&gt; <a class="struct" href="../../chrono/struct.Date.html" title="struct chrono::Date">Date</a>&lt;Self&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#290-292" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Makes a new <code>Date</code> from ISO week date (year and week number), day of the week (DOW) and
the current time zone.
This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE.
The resulting <code>Date</code> may have a different year from the input year. <a href="../../chrono/offset/trait.TimeZone.html#method.isoywd">Read more</a></p>
</div><h4 id="method.isoywd_opt" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.isoywd_opt" class="fnname">isoywd_opt</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;year: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;week: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;weekday: <a class="enum" href="../../chrono/enum.Weekday.html" title="enum chrono::Weekday">Weekday</a><br>) -&gt; <a class="enum" href="../../chrono/offset/enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../../chrono/struct.Date.html" title="struct chrono::Date">Date</a>&lt;Self&gt;&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#303-308" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Makes a new <code>Date</code> from ISO week date (year and week number), day of the week (DOW) and
the current time zone.
This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE.
The resulting <code>Date</code> may have a different year from the input year. <a href="../../chrono/offset/trait.TimeZone.html#method.isoywd_opt">Read more</a></p>
</div><h4 id="method.timestamp" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.timestamp" class="fnname">timestamp</a>(&amp;self, secs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>, nsecs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="struct" href="../../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Self&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#324-326" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Makes a new <code>DateTime</code> from the number of non-leap seconds
since January 1, 1970 0:00:00 UTC (aka &quot;UNIX timestamp&quot;)
and the number of nanoseconds since the last whole non-leap second. <a href="../../chrono/offset/trait.TimeZone.html#method.timestamp">Read more</a></p>
</div><h4 id="method.timestamp_opt" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.timestamp_opt" class="fnname">timestamp_opt</a>(&amp;self, secs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>, nsecs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="../../chrono/offset/enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Self&gt;&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#334-339" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Makes a new <code>DateTime</code> from the number of non-leap seconds
since January 1, 1970 0:00:00 UTC (aka &quot;UNIX timestamp&quot;)
and the number of nanoseconds since the last whole non-leap second. <a href="../../chrono/offset/trait.TimeZone.html#method.timestamp_opt">Read more</a></p>
</div><h4 id="method.timestamp_millis" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.timestamp_millis" class="fnname">timestamp_millis</a>(&amp;self, millis: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>) -&gt; <a class="struct" href="../../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Self&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#354-356" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Makes a new <code>DateTime</code> from the number of non-leap milliseconds
since January 1, 1970 0:00:00 UTC (aka &quot;UNIX timestamp&quot;). <a href="../../chrono/offset/trait.TimeZone.html#method.timestamp_millis">Read more</a></p>
</div><h4 id="method.timestamp_millis_opt" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.timestamp_millis_opt" class="fnname">timestamp_millis_opt</a>(&amp;self, millis: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>) -&gt; <a class="enum" href="../../chrono/offset/enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Self&gt;&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#375-382" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Makes a new <code>DateTime</code> from the number of non-leap milliseconds
since January 1, 1970 0:00:00 UTC (aka &quot;UNIX timestamp&quot;). <a href="../../chrono/offset/trait.TimeZone.html#method.timestamp_millis_opt">Read more</a></p>
</div><h4 id="method.timestamp_nanos" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.timestamp_nanos" class="fnname">timestamp_nanos</a>(&amp;self, nanos: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>) -&gt; <a class="struct" href="../../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Self&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#397-404" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Makes a new <code>DateTime</code> from the number of non-leap nanoseconds
since January 1, 1970 0:00:00 UTC (aka &quot;UNIX timestamp&quot;). <a href="../../chrono/offset/trait.TimeZone.html#method.timestamp_nanos">Read more</a></p>
</div><h4 id="method.datetime_from_str" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.datetime_from_str" class="fnname">datetime_from_str</a>(&amp;self, s: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, fmt: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="type" href="../../chrono/format/type.ParseResult.html" title="type chrono::format::ParseResult">ParseResult</a>&lt;<a class="struct" href="../../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Self&gt;&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#416-420" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Parses a string with the specified format string and
returns a <code>DateTime</code> with the current offset.
See the <a href="../format/strftime/index.html"><code>format::strftime</code> module</a>
on the supported escape sequences. <a href="../../chrono/offset/trait.TimeZone.html#method.datetime_from_str">Read more</a></p>
</div><h4 id="method.from_local_date" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.from_local_date" class="fnname">from_local_date</a>(&amp;self, local: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>) -&gt; <a class="enum" href="../../chrono/offset/enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../../chrono/struct.Date.html" title="struct chrono::Date">Date</a>&lt;Self&gt;&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#432-437" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Converts the local <code>NaiveDate</code> to the timezone-aware <code>Date</code> if possible.</p>
</div><h4 id="method.from_local_datetime" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.from_local_datetime" class="fnname">from_local_datetime</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;local: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a><br>) -&gt; <a class="enum" href="../../chrono/offset/enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Self&gt;&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#440-443" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Converts the local <code>NaiveDateTime</code> to the timezone-aware <code>DateTime</code> if possible.</p>
</div><h4 id="method.from_utc_date" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.from_utc_date" class="fnname">from_utc_date</a>(&amp;self, utc: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>) -&gt; <a class="struct" href="../../chrono/struct.Date.html" title="struct chrono::Date">Date</a>&lt;Self&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#453-455" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Converts the UTC <code>NaiveDate</code> to the local time.
The UTC is continuous and thus this cannot fail (but can give the duplicate local time). <a href="../../chrono/offset/trait.TimeZone.html#method.from_utc_date">Read more</a></p>
</div><h4 id="method.from_utc_datetime" class="method hidden"><code>fn <a href="../../chrono/offset/trait.TimeZone.html#method.from_utc_datetime" class="fnname">from_utc_datetime</a>(&amp;self, utc: &amp;<a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>) -&gt; <a class="struct" href="../../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Self&gt;</code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#459-461" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Converts the UTC <code>NaiveDateTime</code> to the local time.
The UTC is continuous and thus this cannot fail (but can give the duplicate local time). <a href="../../chrono/offset/trait.TimeZone.html#method.from_utc_datetime">Read more</a></p>
</div></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></div><h3 id="impl-Borrow%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211-213" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id="impl-BorrowMut%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id="impl-From%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</code><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-Into%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-Into%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -&gt; U</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-ToOwned" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,&nbsp;</span></code><a href="#impl-ToOwned" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Owned" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
</div><h4 id="method.to_owned" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fnname">to_owned</a>(&amp;self) -&gt; T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
</div><h4 id="method.clone_into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fnname">clone_into</a>(&amp;self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T)</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><details><summary><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
</div></div><h3 id="impl-ToString" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-ToString" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2194-2207" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_string" class="method hidden"><code>pub default fn <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string" class="fnname">to_string</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2200-2206" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
</div></div><h3 id="impl-TryFrom%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id="method.try_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-TryInto%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-TryInto%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#575-584" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error-1" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id="method.try_into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#581-583" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "chrono";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
-8
View File
@@ -1,8 +0,0 @@
<!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 `Offset` trait in crate `chrono`."><meta name="keywords" content="rust, rustlang, rust-lang, Offset"><title>chrono::offset::Offset - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></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">&#9776;</div><a href='../../chrono/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Trait Offset</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.fix">fix</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class="location"><a href="../index.html">chrono</a>::<wbr><a href="index.html">offset</a></p><script>window.sidebarCurrent = {name: "Offset", 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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../../src/chrono/offset/mod.rs.html#183-186" title="goto source code">[src]</a></span><span class="in-band">Trait <a href="../index.html">chrono</a>::<wbr><a href="index.html">offset</a>::<wbr><a class="trait" href="">Offset</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust trait">pub trait Offset: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> {
fn <a href="#tymethod.fix" class="fnname">fix</a>(&amp;self) -&gt; <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>;
}</pre></div><div class="docblock"><p>The offset from the local time to UTC.</p>
</div><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><h3 id="tymethod.fix" class="method"><code>fn <a href="#tymethod.fix" class="fnname">fix</a>(&amp;self) -&gt; <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></code><a class="srclink" href="../../src/chrono/offset/mod.rs.html#185" title="goto source code">[src]</a></h3><div class="docblock"><p>Returns the fixed offset from UTC to the local time stored.</p>
</div></div><span class="loading-content">Loading content...</span><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"><h3 id="impl-Offset" class="impl"><code class="in-band">impl Offset for <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></code><a href="#impl-Offset" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#123-127" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fix" class="method hidden"><code>fn <a href="#method.fix" class="fnname">fix</a>(&amp;self) -&gt; <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></code><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#124-126" title="goto source code">[src]</a></h4></div><h3 id="impl-Offset-1" class="impl"><code class="in-band">impl Offset for <a class="struct" href="../../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a></code><a href="#impl-Offset-1" class="anchor"></a><a class="srclink" href="../../src/chrono/offset/utc.rs.html#84-88" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fix-1" class="method hidden"><code>fn <a href="#method.fix-1" class="fnname">fix</a>(&amp;self) -&gt; <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></code><a class="srclink" href="../../src/chrono/offset/utc.rs.html#85-87" title="goto source code">[src]</a></h4></div></div><span class="loading-content">Loading content...</span><script type="text/javascript" src="../../implementors/chrono/offset/trait.Offset.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "chrono";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
File diff suppressed because one or more lines are too long
-10
View File
@@ -1,10 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../chrono/offset/struct.Utc.html">
</head>
<body>
<p>Redirecting to <a href="../../../chrono/offset/struct.Utc.html">../../../chrono/offset/struct.Utc.html</a>...</p>
<script>location.replace("../../../chrono/offset/struct.Utc.html" + location.search + location.hash);</script>
</body>
</html>
-6
View File
@@ -1,6 +0,0 @@
<!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 `prelude` mod in crate `chrono`."><meta name="keywords" content="rust, rustlang, rust-lang, prelude"><title>chrono::prelude - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[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">&#9776;</div><a href='../../chrono/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Module prelude</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#reexports">Re-exports</a></li></ul></div><p class="location"><a href="../index.html">chrono</a></p><script>window.sidebarCurrent = {name: "prelude", ty: "mod", relpath: "../"};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../../src/chrono/lib.rs.html#506-527" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../index.html">chrono</a>::<wbr><a class="mod" href="">prelude</a></span></h1><div class="docblock"><p>A convenience module appropriate for glob imports (<code>use chrono::prelude::*;</code>).</p>
</div><h2 id="reexports" class="section-header"><a href="#reexports">Re-exports</a></h2>
<table><tr><td><code>pub use <a class="struct" href="../../chrono/struct.Date.html" title="struct chrono::Date">Date</a>;</code></td></tr><tr><td><code>pub use <a class="struct" href="../../chrono/offset/struct.Local.html" title="struct chrono::offset::Local">Local</a>;</code></td></tr><tr><td><code>pub use <a class="trait" href="../../chrono/trait.SubsecRound.html" title="trait chrono::SubsecRound">SubsecRound</a>;</code></td></tr><tr><td><code>pub use <a class="struct" href="../../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>;</code></td></tr><tr><td><code>pub use <a class="enum" href="../../chrono/enum.SecondsFormat.html" title="enum chrono::SecondsFormat">SecondsFormat</a>;</code></td></tr><tr><td><code>pub use <a class="trait" href="../../chrono/trait.Datelike.html" title="trait chrono::Datelike">Datelike</a>;</code></td></tr><tr><td><code>pub use <a class="enum" href="../../chrono/enum.Month.html" title="enum chrono::Month">Month</a>;</code></td></tr><tr><td><code>pub use <a class="trait" href="../../chrono/trait.Timelike.html" title="trait chrono::Timelike">Timelike</a>;</code></td></tr><tr><td><code>pub use <a class="enum" href="../../chrono/enum.Weekday.html" title="enum chrono::Weekday">Weekday</a>;</code></td></tr><tr><td><code>pub use <a class="struct" href="../../chrono/offset/struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>;</code></td></tr><tr><td><code>pub use <a class="struct" href="../../chrono/offset/struct.Utc.html" title="struct chrono::offset::Utc">Utc</a>;</code></td></tr><tr><td><code>pub use <a class="struct" href="../../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>;</code></td></tr><tr><td><code>pub use <a class="struct" href="../../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>;</code></td></tr><tr><td><code>pub use <a class="struct" href="../../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>;</code></td></tr><tr><td><code>pub use <a class="trait" href="../../chrono/offset/trait.Offset.html" title="trait chrono::offset::Offset">Offset</a>;</code></td></tr><tr><td><code>pub use <a class="trait" href="../../chrono/offset/trait.TimeZone.html" title="trait chrono::offset::TimeZone">TimeZone</a>;</code></td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "chrono";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
-1
View File
@@ -1 +0,0 @@
initSidebarItems({});
-10
View File
@@ -1,10 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../chrono/enum.RoundingError.html">
</head>
<body>
<p>Redirecting to <a href="../../chrono/enum.RoundingError.html">../../chrono/enum.RoundingError.html</a>...</p>
<script>location.replace("../../chrono/enum.RoundingError.html" + location.search + location.hash);</script>
</body>
</html>
@@ -1,10 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../chrono/trait.DurationRound.html">
</head>
<body>
<p>Redirecting to <a href="../../chrono/trait.DurationRound.html">../../chrono/trait.DurationRound.html</a>...</p>
<script>location.replace("../../chrono/trait.DurationRound.html" + location.search + location.hash);</script>
</body>
</html>
-10
View File
@@ -1,10 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../chrono/trait.SubsecRound.html">
</head>
<body>
<p>Redirecting to <a href="../../chrono/trait.SubsecRound.html">../../chrono/trait.SubsecRound.html</a>...</p>
<script>location.replace("../../chrono/trait.SubsecRound.html" + location.search + location.hash);</script>
</body>
</html>
-1
View File
@@ -1 +0,0 @@
initSidebarItems({"constant":[["MAX_DATE","The maximum possible `Date`."],["MAX_DATETIME","The maximum possible `DateTime<Utc>`."],["MIN_DATE","The minimum possible `Date`."],["MIN_DATETIME","The minimum possible `DateTime<Utc>`."]],"enum":[["Month","The month of the year."],["RoundingError","An error from rounding by `Duration`"],["SecondsFormat","Specific formatting options for seconds. This may be extended in the future, so exhaustive matching in external code is not recommended."],["Weekday","The day of week."]],"mod":[["format","Formatting (and parsing) utilities for date and time."],["naive","Date and time types unconcerned with timezones."],["offset","The time zone, which calculates offsets from the local time to UTC."],["prelude","A convenience module appropriate for glob imports (`use chrono::prelude::*;`)."]],"struct":[["Date","ISO 8601 calendar date with time zone."],["DateTime","ISO 8601 combined date and time with time zone."],["Duration","ISO 8601 time duration with nanosecond precision. This also allows for the negative duration; see individual methods for details."],["ParseMonthError","An error resulting from reading `<Month>` value with `FromStr`."],["ParseWeekdayError","An error resulting from reading `Weekday` value with `FromStr`."]],"trait":[["Datelike","The common set of methods for date component."],["DurationRound","Extension trait for rounding or truncating a DateTime by a Duration."],["SubsecRound","Extension trait for subsecond rounding or truncation to a maximum number of digits. Rounding can be used to decrease the error variance when serializing/persisting to lower precision. Truncation is the default behavior in Chrono display formatting. Either can be used to guarantee equality (e.g. for testing) when round-tripping through a lower precision format."],["Timelike","The common set of methods for time component."]]});
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-302
View File
@@ -1,302 +0,0 @@
<!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 `Duration` struct in crate `chrono`."><meta name="keywords" content="rust, rustlang, rust-lang, Duration"><title>chrono::Duration - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[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">&#9776;</div><a href='../chrono/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Struct Duration</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.checked_add">checked_add</a><a href="#method.checked_sub">checked_sub</a><a href="#method.days">days</a><a href="#method.from_std">from_std</a><a href="#method.hours">hours</a><a href="#method.is_zero">is_zero</a><a href="#method.max_value">max_value</a><a href="#method.microseconds">microseconds</a><a href="#method.milliseconds">milliseconds</a><a href="#method.min_value">min_value</a><a href="#method.minutes">minutes</a><a href="#method.nanoseconds">nanoseconds</a><a href="#method.num_days">num_days</a><a href="#method.num_hours">num_hours</a><a href="#method.num_microseconds">num_microseconds</a><a href="#method.num_milliseconds">num_milliseconds</a><a href="#method.num_minutes">num_minutes</a><a href="#method.num_nanoseconds">num_nanoseconds</a><a href="#method.num_seconds">num_seconds</a><a href="#method.num_weeks">num_weeks</a><a href="#method.seconds">seconds</a><a href="#method.span">span</a><a href="#method.to_std">to_std</a><a href="#method.weeks">weeks</a><a href="#method.zero">zero</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Add%3CDuration%3E">Add&lt;Duration&gt;</a><a href="#impl-AddAssign%3CDuration%3E">AddAssign&lt;Duration&gt;</a><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Debug">Debug</a><a href="#impl-Display">Display</a><a href="#impl-Div%3Ci32%3E">Div&lt;i32&gt;</a><a href="#impl-Eq">Eq</a><a href="#impl-Hash">Hash</a><a href="#impl-Mul%3Ci32%3E">Mul&lt;i32&gt;</a><a href="#impl-Neg">Neg</a><a href="#impl-Ord">Ord</a><a href="#impl-PartialEq%3CDuration%3E">PartialEq&lt;Duration&gt;</a><a href="#impl-PartialOrd%3CDuration%3E">PartialOrd&lt;Duration&gt;</a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a><a href="#impl-Sub%3CDuration%3E">Sub&lt;Duration&gt;</a><a href="#impl-SubAssign%3CDuration%3E">SubAssign&lt;Duration&gt;</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><p class="location"><a href="index.html">chrono</a></p><script>window.sidebarCurrent = {name: "Duration", ty: "struct", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../src/time/duration.rs.html#45-48" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="index.html">chrono</a>::<wbr><a class="struct" href="">Duration</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct Duration { /* fields omitted */ }</pre></div><div class="docblock"><p>ISO 8601 time duration with nanosecond precision.
This also allows for the negative duration; see individual methods for details.</p>
</div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../src/time/duration.rs.html#62-294" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.weeks" class="method"><code>pub fn <a href="#method.weeks" class="fnname">weeks</a>(weeks: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>) -&gt; <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a class="srclink" href="../src/time/duration.rs.html#67-70" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>Duration</code> with given number of weeks.
Equivalent to <code>Duration::seconds(weeks * 7 * 24 * 60 * 60)</code> with overflow checks.
Panics when the duration is out of bounds.</p>
</div><h4 id="method.days" class="method"><code>pub fn <a href="#method.days" class="fnname">days</a>(days: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>) -&gt; <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a class="srclink" href="../src/time/duration.rs.html#76-79" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>Duration</code> with given number of days.
Equivalent to <code>Duration::seconds(days * 24 * 60 * 60)</code> with overflow checks.
Panics when the duration is out of bounds.</p>
</div><h4 id="method.hours" class="method"><code>pub fn <a href="#method.hours" class="fnname">hours</a>(hours: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>) -&gt; <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a class="srclink" href="../src/time/duration.rs.html#85-88" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>Duration</code> with given number of hours.
Equivalent to <code>Duration::seconds(hours * 60 * 60)</code> with overflow checks.
Panics when the duration is out of bounds.</p>
</div><h4 id="method.minutes" class="method"><code>pub fn <a href="#method.minutes" class="fnname">minutes</a>(minutes: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>) -&gt; <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a class="srclink" href="../src/time/duration.rs.html#94-97" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>Duration</code> with given number of minutes.
Equivalent to <code>Duration::seconds(minutes * 60)</code> with overflow checks.
Panics when the duration is out of bounds.</p>
</div><h4 id="method.seconds" class="method"><code>pub fn <a href="#method.seconds" class="fnname">seconds</a>(seconds: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>) -&gt; <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a class="srclink" href="../src/time/duration.rs.html#103-109" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>Duration</code> with given number of seconds.
Panics when the duration is more than <code>i64::MAX</code> milliseconds
or less than <code>i64::MIN</code> milliseconds.</p>
</div><h4 id="method.milliseconds" class="method"><code>pub fn <a href="#method.milliseconds" class="fnname">milliseconds</a>(milliseconds: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>) -&gt; <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a class="srclink" href="../src/time/duration.rs.html#113-117" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>Duration</code> with given number of milliseconds.</p>
</div><h4 id="method.microseconds" class="method"><code>pub fn <a href="#method.microseconds" class="fnname">microseconds</a>(microseconds: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>) -&gt; <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a class="srclink" href="../src/time/duration.rs.html#121-125" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>Duration</code> with given number of microseconds.</p>
</div><h4 id="method.nanoseconds" class="method"><code>pub fn <a href="#method.nanoseconds" class="fnname">nanoseconds</a>(nanos: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>) -&gt; <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a class="srclink" href="../src/time/duration.rs.html#129-132" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>Duration</code> with given number of nanoseconds.</p>
</div><h4 id="method.span" class="method"><code>pub fn <a href="#method.span" class="fnname">span</a>&lt;F&gt;(f: F) -&gt; <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(),&nbsp;</span></code><a class="srclink" href="../src/time/duration.rs.html#136-140" title="goto source code">[src]</a></h4><div class="docblock"><p>Runs a closure, returning the duration of time it took to run the
closure.</p>
</div><h4 id="method.num_weeks" class="method"><code>pub fn <a href="#method.num_weeks" class="fnname">num_weeks</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a></code><a class="srclink" href="../src/time/duration.rs.html#144-146" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the total number of whole weeks in the duration.</p>
</div><h4 id="method.num_days" class="method"><code>pub fn <a href="#method.num_days" class="fnname">num_days</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a></code><a class="srclink" href="../src/time/duration.rs.html#149-151" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the total number of whole days in the duration.</p>
</div><h4 id="method.num_hours" class="method"><code>pub fn <a href="#method.num_hours" class="fnname">num_hours</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a></code><a class="srclink" href="../src/time/duration.rs.html#155-157" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the total number of whole hours in the duration.</p>
</div><h4 id="method.num_minutes" class="method"><code>pub fn <a href="#method.num_minutes" class="fnname">num_minutes</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a></code><a class="srclink" href="../src/time/duration.rs.html#161-163" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the total number of whole minutes in the duration.</p>
</div><h4 id="method.num_seconds" class="method"><code>pub fn <a href="#method.num_seconds" class="fnname">num_seconds</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a></code><a class="srclink" href="../src/time/duration.rs.html#166-173" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the total number of whole seconds in the duration.</p>
</div><h4 id="method.num_milliseconds" class="method"><code>pub fn <a href="#method.num_milliseconds" class="fnname">num_milliseconds</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a></code><a class="srclink" href="../src/time/duration.rs.html#187-193" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the total number of whole milliseconds in the duration,</p>
</div><h4 id="method.num_microseconds" class="method"><code>pub fn <a href="#method.num_microseconds" class="fnname">num_microseconds</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>&gt;</code><a class="srclink" href="../src/time/duration.rs.html#197-201" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the total number of whole microseconds in the duration,
or <code>None</code> on overflow (exceeding 2<sup>63</sup> microseconds in either direction).</p>
</div><h4 id="method.num_nanoseconds" class="method"><code>pub fn <a href="#method.num_nanoseconds" class="fnname">num_nanoseconds</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>&gt;</code><a class="srclink" href="../src/time/duration.rs.html#205-209" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the total number of whole nanoseconds in the duration,
or <code>None</code> on overflow (exceeding 2<sup>63</sup> nanoseconds in either direction).</p>
</div><h4 id="method.checked_add" class="method"><code>pub fn <a href="#method.checked_add" class="fnname">checked_add</a>(&amp;self, rhs: &amp;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>&gt;</code><a class="srclink" href="../src/time/duration.rs.html#212-223" title="goto source code">[src]</a></h4><div class="docblock"><p>Add two durations, returning <code>None</code> if overflow occurred.</p>
</div><h4 id="method.checked_sub" class="method"><code>pub fn <a href="#method.checked_sub" class="fnname">checked_sub</a>(&amp;self, rhs: &amp;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>&gt;</code><a class="srclink" href="../src/time/duration.rs.html#226-237" title="goto source code">[src]</a></h4><div class="docblock"><p>Subtract two durations, returning <code>None</code> if overflow occurred.</p>
</div><h4 id="method.min_value" class="method"><code>pub fn <a href="#method.min_value" class="fnname">min_value</a>() -&gt; <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a class="srclink" href="../src/time/duration.rs.html#241" title="goto source code">[src]</a></h4><div class="docblock"><p>The minimum possible <code>Duration</code>: <code>i64::MIN</code> milliseconds.</p>
</div><h4 id="method.max_value" class="method"><code>pub fn <a href="#method.max_value" class="fnname">max_value</a>() -&gt; <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a class="srclink" href="../src/time/duration.rs.html#245" title="goto source code">[src]</a></h4><div class="docblock"><p>The maximum possible <code>Duration</code>: <code>i64::MAX</code> milliseconds.</p>
</div><h4 id="method.zero" class="method"><code>pub fn <a href="#method.zero" class="fnname">zero</a>() -&gt; <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a class="srclink" href="../src/time/duration.rs.html#249-251" title="goto source code">[src]</a></h4><div class="docblock"><p>A duration where the stored seconds and nanoseconds are equal to zero.</p>
</div><h4 id="method.is_zero" class="method"><code>pub fn <a href="#method.is_zero" class="fnname">is_zero</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../src/time/duration.rs.html#255-257" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns <code>true</code> if the duration equals <code>Duration::zero()</code>.</p>
</div><h4 id="method.from_std" class="method"><code>pub fn <a href="#method.from_std" class="fnname">from_std</a>(duration: <a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>, <a class="struct" href="../time/duration/struct.OutOfRangeError.html" title="struct time::duration::OutOfRangeError">OutOfRangeError</a>&gt;</code><a class="srclink" href="../src/time/duration.rs.html#263-276" title="goto source code">[src]</a></h4><div class="docblock"><p>Creates a <code>time::Duration</code> object from <code>std::time::Duration</code></p>
<p>This function errors when original duration is larger than the maximum
value supported for this type.</p>
</div><h4 id="method.to_std" class="method"><code>pub fn <a href="#method.to_std" class="fnname">to_std</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>, <a class="struct" href="../time/duration/struct.OutOfRangeError.html" title="struct time::duration::OutOfRangeError">OutOfRangeError</a>&gt;</code><a class="srclink" href="../src/time/duration.rs.html#282-287" title="goto source code">[src]</a></h4><div class="docblock"><p>Creates a <code>std::time::Duration</code> object from <code>time::Duration</code></p>
<p>This function errors when duration is less than zero. As standard
library implementation is limited to non-negative values.</p>
</div></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Add%3CDuration%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html" title="trait core::ops::arith::Add">Add</a>&lt;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>&gt; for <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a href="#impl-Add%3CDuration%3E" class="anchor"></a><a class="srclink" href="../src/time/duration.rs.html#309-321" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Output-3" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#associatedtype.Output" class="type">Output</a> = <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>+</code> operator.</p>
</div><h4 id="method.add" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add" class="fnname">add</a>(self, rhs: <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>) -&gt; <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a class="srclink" href="../src/time/duration.rs.html#312-320" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>+</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add">Read more</a></p>
</div></div><h3 id="impl-Add%3CDuration%3E-1" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html" title="trait core::ops::arith::Add">Add</a>&lt;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>&gt; for <a class="struct" href="../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a href="#impl-Add%3CDuration%3E-1" class="anchor"></a><a class="srclink" href="../src/chrono/naive/date.rs.html#1468-1475" title="goto source code">[src]</a></h3><div class="docblock"><p>An addition of <code>Duration</code> to <code>NaiveDate</code> discards the fractional days,
rounding to the closest integral number of days towards <code>Duration::zero()</code>.</p>
<p>Panics on underflow or overflow.
Use <a href="#method.checked_add_signed"><code>NaiveDate::checked_add_signed</code></a> to detect that.</p>
<h1 id="example-3" class="section-header"><a href="#example-3">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">Duration</span>, <span class="ident">NaiveDate</span>};
<span class="kw">let</span> <span class="ident">from_ymd</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">zero</span>(), <span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">86399</span>), <span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="op">-</span><span class="number">86399</span>), <span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">1</span>), <span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">2</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="op">-</span><span class="number">1</span>), <span class="ident">from_ymd</span>(<span class="number">2013</span>, <span class="number">12</span>, <span class="number">31</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">364</span>), <span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">12</span>, <span class="number">31</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">365</span><span class="kw-2">*</span><span class="number">4</span> <span class="op">+</span> <span class="number">1</span>), <span class="ident">from_ymd</span>(<span class="number">2018</span>, <span class="number">1</span>, <span class="number">1</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">365</span><span class="kw-2">*</span><span class="number">400</span> <span class="op">+</span> <span class="number">97</span>), <span class="ident">from_ymd</span>(<span class="number">2414</span>, <span class="number">1</span>, <span class="number">1</span>));</pre></div>
</div><div class="impl-items"><h4 id="associatedtype.Output-10" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#associatedtype.Output" class="type">Output</a> = <a class="struct" href="../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>+</code> operator.</p>
</div><h4 id="method.add-1" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add" class="fnname">add</a>(self, rhs: <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a>) -&gt; <a class="struct" href="../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a class="srclink" href="../src/chrono/naive/date.rs.html#1472-1474" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>+</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add">Read more</a></p>
</div></div><h3 id="impl-Add%3CDuration%3E-2" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html" title="trait core::ops::arith::Add">Add</a>&lt;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>&gt; for <a class="struct" href="../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a href="#impl-Add%3CDuration%3E-2" class="anchor"></a><a class="srclink" href="../src/chrono/naive/datetime.rs.html#1252-1259" title="goto source code">[src]</a></h3><div class="docblock"><p>An addition of <code>Duration</code> to <code>NaiveDateTime</code> yields another <code>NaiveDateTime</code>.</p>
<p>As a part of Chrono's <a href="./struct.NaiveTime.html#leap-second-handling">leap second handling</a>,
the addition assumes that <strong>there is no leap second ever</strong>,
except when the <code>NaiveDateTime</code> itself represents a leap second
in which case the assumption becomes that <strong>there is exactly a single leap second ever</strong>.</p>
<p>Panics on underflow or overflow.
Use <a href="#method.checked_add_signed"><code>NaiveDateTime::checked_add_signed</code></a> to detect that.</p>
<h1 id="example-4" class="section-header"><a href="#example-4">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">Duration</span>, <span class="ident">NaiveDate</span>};
<span class="kw">let</span> <span class="ident">from_ymd</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>;
<span class="kw">let</span> <span class="ident">d</span> <span class="op">=</span> <span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">7</span>, <span class="number">8</span>);
<span class="kw">let</span> <span class="ident">hms</span> <span class="op">=</span> <span class="op">|</span><span class="ident">h</span>, <span class="ident">m</span>, <span class="ident">s</span><span class="op">|</span> <span class="ident">d</span>.<span class="ident">and_hms</span>(<span class="ident">h</span>, <span class="ident">m</span>, <span class="ident">s</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">zero</span>(), <span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">1</span>), <span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">8</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="op">-</span><span class="number">1</span>), <span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">6</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">3600</span> <span class="op">+</span> <span class="number">60</span>), <span class="ident">hms</span>(<span class="number">4</span>, <span class="number">6</span>, <span class="number">7</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">86_400</span>),
<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">7</span>, <span class="number">9</span>).<span class="ident">and_hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">365</span>),
<span class="ident">from_ymd</span>(<span class="number">2017</span>, <span class="number">7</span>, <span class="number">8</span>).<span class="ident">and_hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>));
<span class="kw">let</span> <span class="ident">hmsm</span> <span class="op">=</span> <span class="op">|</span><span class="ident">h</span>, <span class="ident">m</span>, <span class="ident">s</span>, <span class="ident">milli</span><span class="op">|</span> <span class="ident">d</span>.<span class="ident">and_hms_milli</span>(<span class="ident">h</span>, <span class="ident">m</span>, <span class="ident">s</span>, <span class="ident">milli</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">980</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">450</span>), <span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">8</span>, <span class="number">430</span>));</pre></div>
<p>Leap seconds are handled,
but the addition assumes that it is the only leap second happened.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">leap</span> <span class="op">=</span> <span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">1_300</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">zero</span>(), <span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">1_300</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="op">-</span><span class="number">500</span>), <span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">800</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">500</span>), <span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">1_800</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">800</span>), <span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">6</span>, <span class="number">0</span>, <span class="number">100</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">10</span>), <span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">6</span>, <span class="number">9</span>, <span class="number">300</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="op">-</span><span class="number">10</span>), <span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">50</span>, <span class="number">300</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">1</span>),
<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">7</span>, <span class="number">9</span>).<span class="ident">and_hms_milli</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">300</span>));</pre></div>
</div><div class="impl-items"><h4 id="associatedtype.Output-11" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#associatedtype.Output" class="type">Output</a> = <a class="struct" href="../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>+</code> operator.</p>
</div><h4 id="method.add-2" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add" class="fnname">add</a>(self, rhs: <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a>) -&gt; <a class="struct" href="../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a class="srclink" href="../src/chrono/naive/datetime.rs.html#1256-1258" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>+</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add">Read more</a></p>
</div></div><h3 id="impl-Add%3CDuration%3E-3" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html" title="trait core::ops::arith::Add">Add</a>&lt;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>&gt; for <a class="struct" href="../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a href="#impl-Add%3CDuration%3E-3" class="anchor"></a><a class="srclink" href="../src/chrono/naive/time.rs.html#1078-1085" title="goto source code">[src]</a></h3><div class="docblock"><p>An addition of <code>Duration</code> to <code>NaiveTime</code> wraps around and never overflows or underflows.
In particular the addition ignores integral number of days.</p>
<p>As a part of Chrono's <a href="#leap-second-handling">leap second handling</a>,
the addition assumes that <strong>there is no leap second ever</strong>,
except when the <code>NaiveTime</code> itself represents a leap second
in which case the assumption becomes that <strong>there is exactly a single leap second ever</strong>.</p>
<h1 id="example-5" class="section-header"><a href="#example-5">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">Duration</span>, <span class="ident">NaiveTime</span>};
<span class="kw">let</span> <span class="ident">from_hmsm</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms_milli</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">zero</span>(), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">1</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">8</span>, <span class="number">0</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="op">-</span><span class="number">1</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">6</span>, <span class="number">0</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">60</span> <span class="op">+</span> <span class="number">4</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">6</span>, <span class="number">11</span>, <span class="number">0</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">7</span><span class="kw-2">*</span><span class="number">60</span><span class="kw-2">*</span><span class="number">60</span> <span class="op">-</span> <span class="number">6</span><span class="kw-2">*</span><span class="number">60</span>), <span class="ident">from_hmsm</span>(<span class="number">9</span>, <span class="number">59</span>, <span class="number">7</span>, <span class="number">0</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">80</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">80</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">950</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">280</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">8</span>, <span class="number">230</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">950</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="op">-</span><span class="number">980</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">6</span>, <span class="number">970</span>));</pre></div>
<p>The addition wraps around.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">22</span><span class="kw-2">*</span><span class="number">60</span><span class="kw-2">*</span><span class="number">60</span>), <span class="ident">from_hmsm</span>(<span class="number">1</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="op">-</span><span class="number">8</span><span class="kw-2">*</span><span class="number">60</span><span class="kw-2">*</span><span class="number">60</span>), <span class="ident">from_hmsm</span>(<span class="number">19</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>) <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">800</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>));</pre></div>
<p>Leap seconds are handled, but the addition assumes that it is the only leap second happened.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">leap</span> <span class="op">=</span> <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">1_300</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">zero</span>(), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">1_300</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="op">-</span><span class="number">500</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">800</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">500</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">1_800</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">800</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">6</span>, <span class="number">0</span>, <span class="number">100</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">10</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">6</span>, <span class="number">9</span>, <span class="number">300</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="op">-</span><span class="number">10</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">50</span>, <span class="number">300</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">+</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">1</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">300</span>));</pre></div>
</div><div class="impl-items"><h4 id="associatedtype.Output-12" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#associatedtype.Output" class="type">Output</a> = <a class="struct" href="../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>+</code> operator.</p>
</div><h4 id="method.add-3" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add" class="fnname">add</a>(self, rhs: <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a>) -&gt; <a class="struct" href="../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a class="srclink" href="../src/chrono/naive/time.rs.html#1082-1084" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>+</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add">Read more</a></p>
</div></div><h3 id="impl-Add%3CDuration%3E-4" class="impl"><code class="in-band">impl&lt;Tz:&nbsp;<a class="trait" href="../chrono/offset/trait.TimeZone.html" title="trait chrono::offset::TimeZone">TimeZone</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html" title="trait core::ops::arith::Add">Add</a>&lt;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>&gt; for <a class="struct" href="../chrono/struct.Date.html" title="struct chrono::Date">Date</a>&lt;Tz&gt;</code><a href="#impl-Add%3CDuration%3E-4" class="anchor"></a><a class="srclink" href="../src/chrono/date.rs.html#440-447" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Output-13" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#associatedtype.Output" class="type">Output</a> = <a class="struct" href="../chrono/struct.Date.html" title="struct chrono::Date">Date</a>&lt;Tz&gt;</code></h4><div class='docblock'><p>The resulting type after applying the <code>+</code> operator.</p>
</div><h4 id="method.add-4" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add" class="fnname">add</a>(self, rhs: <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a>) -&gt; <a class="struct" href="../chrono/struct.Date.html" title="struct chrono::Date">Date</a>&lt;Tz&gt;</code><a class="srclink" href="../src/chrono/date.rs.html#444-446" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>+</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add">Read more</a></p>
</div></div><h3 id="impl-Add%3CDuration%3E-5" class="impl"><code class="in-band">impl&lt;Tz:&nbsp;<a class="trait" href="../chrono/offset/trait.TimeZone.html" title="trait chrono::offset::TimeZone">TimeZone</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html" title="trait core::ops::arith::Add">Add</a>&lt;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>&gt; for <a class="struct" href="../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Tz&gt;</code><a href="#impl-Add%3CDuration%3E-5" class="anchor"></a><a class="srclink" href="../src/chrono/datetime.rs.html#693-700" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Output-14" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#associatedtype.Output" class="type">Output</a> = <a class="struct" href="../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Tz&gt;</code></h4><div class='docblock'><p>The resulting type after applying the <code>+</code> operator.</p>
</div><h4 id="method.add-5" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add" class="fnname">add</a>(self, rhs: <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a>) -&gt; <a class="struct" href="../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Tz&gt;</code><a class="srclink" href="../src/chrono/datetime.rs.html#697-699" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>+</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html#tymethod.add">Read more</a></p>
</div></div><h3 id="impl-AddAssign%3CDuration%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.AddAssign.html" title="trait core::ops::arith::AddAssign">AddAssign</a>&lt;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>&gt; for <a class="struct" href="../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a href="#impl-AddAssign%3CDuration%3E" class="anchor"></a><a class="srclink" href="../src/chrono/naive/date.rs.html#1477-1482" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.add_assign" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.AddAssign.html#tymethod.add_assign" class="fnname">add_assign</a>(&amp;mut self, rhs: <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a>)</code><a class="srclink" href="../src/chrono/naive/date.rs.html#1479-1481" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>+=</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.AddAssign.html#tymethod.add_assign">Read more</a></p>
</div></div><h3 id="impl-AddAssign%3CDuration%3E-1" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.AddAssign.html" title="trait core::ops::arith::AddAssign">AddAssign</a>&lt;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>&gt; for <a class="struct" href="../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a href="#impl-AddAssign%3CDuration%3E-1" class="anchor"></a><a class="srclink" href="../src/chrono/naive/datetime.rs.html#1261-1266" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.add_assign-1" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.AddAssign.html#tymethod.add_assign" class="fnname">add_assign</a>(&amp;mut self, rhs: <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a>)</code><a class="srclink" href="../src/chrono/naive/datetime.rs.html#1263-1265" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>+=</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.AddAssign.html#tymethod.add_assign">Read more</a></p>
</div></div><h3 id="impl-AddAssign%3CDuration%3E-2" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.AddAssign.html" title="trait core::ops::arith::AddAssign">AddAssign</a>&lt;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>&gt; for <a class="struct" href="../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a href="#impl-AddAssign%3CDuration%3E-2" class="anchor"></a><a class="srclink" href="../src/chrono/naive/time.rs.html#1087-1092" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.add_assign-2" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.AddAssign.html#tymethod.add_assign" class="fnname">add_assign</a>(&amp;mut self, rhs: <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a>)</code><a class="srclink" href="../src/chrono/naive/time.rs.html#1089-1091" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>+=</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.AddAssign.html#tymethod.add_assign">Read more</a></p>
</div></div><h3 id="impl-Clone" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a href="#impl-Clone" class="anchor"></a><a class="srclink" href="../src/time/duration.rs.html#44" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&amp;self) -&gt; <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a class="srclink" href="../src/time/duration.rs.html#44" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id="method.clone_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&amp;mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self)</code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#128-130" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3 id="impl-Copy" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a href="#impl-Copy" class="anchor"></a><a class="srclink" href="../src/time/duration.rs.html#44" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Debug" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../src/time/duration.rs.html#44" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt-1" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Error.html" title="struct core::fmt::Error">Error</a>&gt;</code><a class="srclink" href="../src/time/duration.rs.html#44" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id="impl-Display" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a href="#impl-Display" class="anchor"></a><a class="srclink" href="../src/time/duration.rs.html#369-398" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Error.html" title="struct core::fmt::Error">Error</a>&gt;</code><a class="srclink" href="../src/time/duration.rs.html#370-397" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id="impl-Div%3Ci32%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Div.html" title="trait core::ops::arith::Div">Div</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>&gt; for <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a href="#impl-Div%3Ci32%3E" class="anchor"></a><a class="srclink" href="../src/time/duration.rs.html#349-367" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Output-1" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Div.html#associatedtype.Output" class="type">Output</a> = <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>/</code> operator.</p>
</div><h4 id="method.div" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Div.html#tymethod.div" class="fnname">div</a>(self, rhs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>) -&gt; <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a class="srclink" href="../src/time/duration.rs.html#352-366" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>/</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Div.html#tymethod.div">Read more</a></p>
</div></div><h3 id="impl-Eq" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a href="#impl-Eq" class="anchor"></a><a class="srclink" href="../src/time/duration.rs.html#44" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Hash" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> for <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a href="#impl-Hash" class="anchor"></a><a class="srclink" href="../src/time/duration.rs.html#44" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.hash" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash" class="fnname">hash</a>&lt;__H&gt;(&amp;self, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>__H) <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;__H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>,&nbsp;</span></code><a class="srclink" href="../src/time/duration.rs.html#44" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Feeds this value into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash">Read more</a></p>
</div><h4 id="method.hash_slice" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice" class="fnname">hash_slice</a>&lt;H&gt;(data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[Self]</a>, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>H) <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.3.0">1.3.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#184-191" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice">Read more</a></p>
</div></div><h3 id="impl-Mul%3Ci32%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Mul.html" title="trait core::ops::arith::Mul">Mul</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>&gt; for <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a href="#impl-Mul%3Ci32%3E" class="anchor"></a><a class="srclink" href="../src/time/duration.rs.html#337-347" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Output" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Mul.html#associatedtype.Output" class="type">Output</a> = <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>*</code> operator.</p>
</div><h4 id="method.mul" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Mul.html#tymethod.mul" class="fnname">mul</a>(self, rhs: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>) -&gt; <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a class="srclink" href="../src/time/duration.rs.html#340-346" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>*</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Mul.html#tymethod.mul">Read more</a></p>
</div></div><h3 id="impl-Neg" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Neg.html" title="trait core::ops::arith::Neg">Neg</a> for <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a href="#impl-Neg" class="anchor"></a><a class="srclink" href="../src/time/duration.rs.html#296-307" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Output-2" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Neg.html#associatedtype.Output" class="type">Output</a> = <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>-</code> operator.</p>
</div><h4 id="method.neg" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Neg.html#tymethod.neg" class="fnname">neg</a>(self) -&gt; <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a class="srclink" href="../src/time/duration.rs.html#300-306" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the unary <code>-</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Neg.html#tymethod.neg">Read more</a></p>
</div></div><h3 id="impl-Ord" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a href="#impl-Ord" class="anchor"></a><a class="srclink" href="../src/time/duration.rs.html#44" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.cmp" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp" class="fnname">cmp</a>(&amp;self, other: &amp;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></code><a class="srclink" href="../src/time/duration.rs.html#44" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method returns an <a href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="Ordering"><code>Ordering</code></a> between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></p>
</div><h4 id="method.max" class="method hidden"><code><span class="docblock attributes">#[must_use]</span>pub fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max" class="fnname">max</a>(self, other: Self) -&gt; Self</code><span class="since" title="Stable since Rust version 1.21.0">1.21.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#719-724" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Compares and returns the maximum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max">Read more</a></p>
</div><h4 id="method.min" class="method hidden"><code><span class="docblock attributes">#[must_use]</span>pub fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min" class="fnname">min</a>(self, other: Self) -&gt; Self</code><span class="since" title="Stable since Rust version 1.21.0">1.21.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#739-744" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Compares and returns the minimum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min">Read more</a></p>
</div><h4 id="method.clamp" class="method hidden"><code><span class="docblock attributes">#[must_use]</span>pub fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp" class="fnname">clamp</a>(self, min: Self, max: Self) -&gt; Self</code><span class="since" title="Stable since Rust version 1.50.0">1.50.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#764-776" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Restrict a value to a certain interval. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp">Read more</a></p>
</div></div><h3 id="impl-PartialEq%3CDuration%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>&lt;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>&gt; for <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a href="#impl-PartialEq%3CDuration%3E" class="anchor"></a><a class="srclink" href="../src/time/duration.rs.html#44" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.eq" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq" class="fnname">eq</a>(&amp;self, other: &amp;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../src/time/duration.rs.html#44" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id="method.ne" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne" class="fnname">ne</a>(&amp;self, other: &amp;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../src/time/duration.rs.html#44" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 id="impl-PartialOrd%3CDuration%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>&lt;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>&gt; for <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a href="#impl-PartialOrd%3CDuration%3E" class="anchor"></a><a class="srclink" href="../src/time/duration.rs.html#44" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.partial_cmp" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp" class="fnname">partial_cmp</a>(&amp;self, other: &amp;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>&gt;</code><a class="srclink" href="../src/time/duration.rs.html#44" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
</div><h4 id="method.lt" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt" class="fnname">lt</a>(&amp;self, other: &amp;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../src/time/duration.rs.html#44" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
</div><h4 id="method.le" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le" class="fnname">le</a>(&amp;self, other: &amp;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../src/time/duration.rs.html#44" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;=</code>
operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
</div><h4 id="method.gt" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt" class="fnname">gt</a>(&amp;self, other: &amp;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../src/time/duration.rs.html#44" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
</div><h4 id="method.ge" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge" class="fnname">ge</a>(&amp;self, other: &amp;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../src/time/duration.rs.html#44" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;=</code>
operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
</div></div><h3 id="impl-StructuralEq" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a href="#impl-StructuralEq" class="anchor"></a><a class="srclink" href="../src/time/duration.rs.html#44" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-StructuralPartialEq" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a href="#impl-StructuralPartialEq" class="anchor"></a><a class="srclink" href="../src/time/duration.rs.html#44" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sub%3CDuration%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html" title="trait core::ops::arith::Sub">Sub</a>&lt;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>&gt; for <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a href="#impl-Sub%3CDuration%3E" class="anchor"></a><a class="srclink" href="../src/time/duration.rs.html#323-335" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Output-4" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#associatedtype.Output" class="type">Output</a> = <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>-</code> operator.</p>
</div><h4 id="method.sub" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#tymethod.sub" class="fnname">sub</a>(self, rhs: <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>) -&gt; <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a class="srclink" href="../src/time/duration.rs.html#326-334" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>-</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#tymethod.sub">Read more</a></p>
</div></div><h3 id="impl-Sub%3CDuration%3E-1" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html" title="trait core::ops::arith::Sub">Sub</a>&lt;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>&gt; for <a class="struct" href="../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a href="#impl-Sub%3CDuration%3E-1" class="anchor"></a><a class="srclink" href="../src/chrono/naive/date.rs.html#1509-1516" title="goto source code">[src]</a></h3><div class="docblock"><p>A subtraction of <code>Duration</code> from <code>NaiveDate</code> discards the fractional days,
rounding to the closest integral number of days towards <code>Duration::zero()</code>.
It is the same as the addition with a negated <code>Duration</code>.</p>
<p>Panics on underflow or overflow.
Use <a href="#method.checked_sub_signed"><code>NaiveDate::checked_sub_signed</code></a> to detect that.</p>
<h1 id="example" class="section-header"><a href="#example">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">Duration</span>, <span class="ident">NaiveDate</span>};
<span class="kw">let</span> <span class="ident">from_ymd</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">zero</span>(), <span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">86399</span>), <span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="op">-</span><span class="number">86399</span>), <span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">1</span>), <span class="ident">from_ymd</span>(<span class="number">2013</span>, <span class="number">12</span>, <span class="number">31</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="op">-</span><span class="number">1</span>), <span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">2</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">364</span>), <span class="ident">from_ymd</span>(<span class="number">2013</span>, <span class="number">1</span>, <span class="number">2</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">365</span><span class="kw-2">*</span><span class="number">4</span> <span class="op">+</span> <span class="number">1</span>), <span class="ident">from_ymd</span>(<span class="number">2010</span>, <span class="number">1</span>, <span class="number">1</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_ymd</span>(<span class="number">2014</span>, <span class="number">1</span>, <span class="number">1</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">365</span><span class="kw-2">*</span><span class="number">400</span> <span class="op">+</span> <span class="number">97</span>), <span class="ident">from_ymd</span>(<span class="number">1614</span>, <span class="number">1</span>, <span class="number">1</span>));</pre></div>
</div><div class="impl-items"><h4 id="associatedtype.Output-5" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#associatedtype.Output" class="type">Output</a> = <a class="struct" href="../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>-</code> operator.</p>
</div><h4 id="method.sub-1" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#tymethod.sub" class="fnname">sub</a>(self, rhs: <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a>) -&gt; <a class="struct" href="../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a class="srclink" href="../src/chrono/naive/date.rs.html#1513-1515" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>-</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#tymethod.sub">Read more</a></p>
</div></div><h3 id="impl-Sub%3CDuration%3E-2" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html" title="trait core::ops::arith::Sub">Sub</a>&lt;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>&gt; for <a class="struct" href="../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a href="#impl-Sub%3CDuration%3E-2" class="anchor"></a><a class="srclink" href="../src/chrono/naive/datetime.rs.html#1320-1327" title="goto source code">[src]</a></h3><div class="docblock"><p>A subtraction of <code>Duration</code> from <code>NaiveDateTime</code> yields another <code>NaiveDateTime</code>.
It is the same as the addition with a negated <code>Duration</code>.</p>
<p>As a part of Chrono's <a href="./struct.NaiveTime.html#leap-second-handling">leap second handling</a>,
the addition assumes that <strong>there is no leap second ever</strong>,
except when the <code>NaiveDateTime</code> itself represents a leap second
in which case the assumption becomes that <strong>there is exactly a single leap second ever</strong>.</p>
<p>Panics on underflow or overflow.
Use <a href="#method.checked_sub_signed"><code>NaiveDateTime::checked_sub_signed</code></a> to detect that.</p>
<h1 id="example-1" class="section-header"><a href="#example-1">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">Duration</span>, <span class="ident">NaiveDate</span>};
<span class="kw">let</span> <span class="ident">from_ymd</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>;
<span class="kw">let</span> <span class="ident">d</span> <span class="op">=</span> <span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">7</span>, <span class="number">8</span>);
<span class="kw">let</span> <span class="ident">hms</span> <span class="op">=</span> <span class="op">|</span><span class="ident">h</span>, <span class="ident">m</span>, <span class="ident">s</span><span class="op">|</span> <span class="ident">d</span>.<span class="ident">and_hms</span>(<span class="ident">h</span>, <span class="ident">m</span>, <span class="ident">s</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">zero</span>(), <span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">1</span>), <span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">6</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="op">-</span><span class="number">1</span>), <span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">8</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">3600</span> <span class="op">+</span> <span class="number">60</span>), <span class="ident">hms</span>(<span class="number">2</span>, <span class="number">4</span>, <span class="number">7</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">86_400</span>),
<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">7</span>, <span class="number">7</span>).<span class="ident">and_hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">365</span>),
<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">7</span>, <span class="number">9</span>).<span class="ident">and_hms</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>));
<span class="kw">let</span> <span class="ident">hmsm</span> <span class="op">=</span> <span class="op">|</span><span class="ident">h</span>, <span class="ident">m</span>, <span class="ident">s</span>, <span class="ident">milli</span><span class="op">|</span> <span class="ident">d</span>.<span class="ident">and_hms_milli</span>(<span class="ident">h</span>, <span class="ident">m</span>, <span class="ident">s</span>, <span class="ident">milli</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">450</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">670</span>), <span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">6</span>, <span class="number">780</span>));</pre></div>
<p>Leap seconds are handled,
but the subtraction assumes that it is the only leap second happened.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">leap</span> <span class="op">=</span> <span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">1_300</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">zero</span>(), <span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">1_300</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">200</span>), <span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">1_100</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">500</span>), <span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">800</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">60</span>), <span class="ident">hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">0</span>, <span class="number">300</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">1</span>),
<span class="ident">from_ymd</span>(<span class="number">2016</span>, <span class="number">7</span>, <span class="number">7</span>).<span class="ident">and_hms_milli</span>(<span class="number">3</span>, <span class="number">6</span>, <span class="number">0</span>, <span class="number">300</span>));</pre></div>
</div><div class="impl-items"><h4 id="associatedtype.Output-6" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#associatedtype.Output" class="type">Output</a> = <a class="struct" href="../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>-</code> operator.</p>
</div><h4 id="method.sub-2" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#tymethod.sub" class="fnname">sub</a>(self, rhs: <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a>) -&gt; <a class="struct" href="../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a class="srclink" href="../src/chrono/naive/datetime.rs.html#1324-1326" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>-</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#tymethod.sub">Read more</a></p>
</div></div><h3 id="impl-Sub%3CDuration%3E-3" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html" title="trait core::ops::arith::Sub">Sub</a>&lt;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>&gt; for <a class="struct" href="../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a href="#impl-Sub%3CDuration%3E-3" class="anchor"></a><a class="srclink" href="../src/chrono/naive/time.rs.html#1145-1152" title="goto source code">[src]</a></h3><div class="docblock"><p>A subtraction of <code>Duration</code> from <code>NaiveTime</code> wraps around and never overflows or underflows.
In particular the addition ignores integral number of days.
It is the same as the addition with a negated <code>Duration</code>.</p>
<p>As a part of Chrono's <a href="#leap-second-handling">leap second handling</a>,
the addition assumes that <strong>there is no leap second ever</strong>,
except when the <code>NaiveTime</code> itself represents a leap second
in which case the assumption becomes that <strong>there is exactly a single leap second ever</strong>.</p>
<h1 id="example-2" class="section-header"><a href="#example-2">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">Duration</span>, <span class="ident">NaiveTime</span>};
<span class="kw">let</span> <span class="ident">from_hmsm</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms_milli</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">zero</span>(), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">1</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">6</span>, <span class="number">0</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">60</span> <span class="op">+</span> <span class="number">5</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">4</span>, <span class="number">2</span>, <span class="number">0</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">2</span><span class="kw-2">*</span><span class="number">60</span><span class="kw-2">*</span><span class="number">60</span> <span class="op">+</span> <span class="number">6</span><span class="kw-2">*</span><span class="number">60</span>), <span class="ident">from_hmsm</span>(<span class="number">0</span>, <span class="number">59</span>, <span class="number">7</span>, <span class="number">0</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">80</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">6</span>, <span class="number">920</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">950</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">280</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">670</span>));</pre></div>
<p>The subtraction wraps around.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">8</span><span class="kw-2">*</span><span class="number">60</span><span class="kw-2">*</span><span class="number">60</span>), <span class="ident">from_hmsm</span>(<span class="number">19</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>) <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">800</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">0</span>));</pre></div>
<p>Leap seconds are handled, but the subtraction assumes that it is the only leap second happened.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">leap</span> <span class="op">=</span> <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">1_300</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">zero</span>(), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">1_300</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">200</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">1_100</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">500</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">59</span>, <span class="number">800</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">seconds</span>(<span class="number">60</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">5</span>, <span class="number">0</span>, <span class="number">300</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span> <span class="op">-</span> <span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">1</span>), <span class="ident">from_hmsm</span>(<span class="number">3</span>, <span class="number">6</span>, <span class="number">0</span>, <span class="number">300</span>));</pre></div>
</div><div class="impl-items"><h4 id="associatedtype.Output-7" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#associatedtype.Output" class="type">Output</a> = <a class="struct" href="../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>-</code> operator.</p>
</div><h4 id="method.sub-3" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#tymethod.sub" class="fnname">sub</a>(self, rhs: <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a>) -&gt; <a class="struct" href="../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a class="srclink" href="../src/chrono/naive/time.rs.html#1149-1151" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>-</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#tymethod.sub">Read more</a></p>
</div></div><h3 id="impl-Sub%3CDuration%3E-4" class="impl"><code class="in-band">impl&lt;Tz:&nbsp;<a class="trait" href="../chrono/offset/trait.TimeZone.html" title="trait chrono::offset::TimeZone">TimeZone</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html" title="trait core::ops::arith::Sub">Sub</a>&lt;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>&gt; for <a class="struct" href="../chrono/struct.Date.html" title="struct chrono::Date">Date</a>&lt;Tz&gt;</code><a href="#impl-Sub%3CDuration%3E-4" class="anchor"></a><a class="srclink" href="../src/chrono/date.rs.html#449-456" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Output-8" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#associatedtype.Output" class="type">Output</a> = <a class="struct" href="../chrono/struct.Date.html" title="struct chrono::Date">Date</a>&lt;Tz&gt;</code></h4><div class='docblock'><p>The resulting type after applying the <code>-</code> operator.</p>
</div><h4 id="method.sub-4" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#tymethod.sub" class="fnname">sub</a>(self, rhs: <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a>) -&gt; <a class="struct" href="../chrono/struct.Date.html" title="struct chrono::Date">Date</a>&lt;Tz&gt;</code><a class="srclink" href="../src/chrono/date.rs.html#453-455" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>-</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#tymethod.sub">Read more</a></p>
</div></div><h3 id="impl-Sub%3CDuration%3E-5" class="impl"><code class="in-band">impl&lt;Tz:&nbsp;<a class="trait" href="../chrono/offset/trait.TimeZone.html" title="trait chrono::offset::TimeZone">TimeZone</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html" title="trait core::ops::arith::Sub">Sub</a>&lt;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>&gt; for <a class="struct" href="../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Tz&gt;</code><a href="#impl-Sub%3CDuration%3E-5" class="anchor"></a><a class="srclink" href="../src/chrono/datetime.rs.html#702-709" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Output-9" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#associatedtype.Output" class="type">Output</a> = <a class="struct" href="../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Tz&gt;</code></h4><div class='docblock'><p>The resulting type after applying the <code>-</code> operator.</p>
</div><h4 id="method.sub-5" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#tymethod.sub" class="fnname">sub</a>(self, rhs: <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a>) -&gt; <a class="struct" href="../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Tz&gt;</code><a class="srclink" href="../src/chrono/datetime.rs.html#706-708" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>-</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html#tymethod.sub">Read more</a></p>
</div></div><h3 id="impl-SubAssign%3CDuration%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.SubAssign.html" title="trait core::ops::arith::SubAssign">SubAssign</a>&lt;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>&gt; for <a class="struct" href="../chrono/naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></code><a href="#impl-SubAssign%3CDuration%3E" class="anchor"></a><a class="srclink" href="../src/chrono/naive/date.rs.html#1518-1523" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.sub_assign" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.SubAssign.html#tymethod.sub_assign" class="fnname">sub_assign</a>(&amp;mut self, rhs: <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a>)</code><a class="srclink" href="../src/chrono/naive/date.rs.html#1520-1522" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>-=</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.SubAssign.html#tymethod.sub_assign">Read more</a></p>
</div></div><h3 id="impl-SubAssign%3CDuration%3E-1" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.SubAssign.html" title="trait core::ops::arith::SubAssign">SubAssign</a>&lt;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>&gt; for <a class="struct" href="../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a href="#impl-SubAssign%3CDuration%3E-1" class="anchor"></a><a class="srclink" href="../src/chrono/naive/datetime.rs.html#1329-1334" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.sub_assign-1" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.SubAssign.html#tymethod.sub_assign" class="fnname">sub_assign</a>(&amp;mut self, rhs: <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a>)</code><a class="srclink" href="../src/chrono/naive/datetime.rs.html#1331-1333" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>-=</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.SubAssign.html#tymethod.sub_assign">Read more</a></p>
</div></div><h3 id="impl-SubAssign%3CDuration%3E-2" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.SubAssign.html" title="trait core::ops::arith::SubAssign">SubAssign</a>&lt;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>&gt; for <a class="struct" href="../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a href="#impl-SubAssign%3CDuration%3E-2" class="anchor"></a><a class="srclink" href="../src/chrono/naive/time.rs.html#1154-1159" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.sub_assign-2" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.SubAssign.html#tymethod.sub_assign" class="fnname">sub_assign</a>(&amp;mut self, rhs: <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">OldDuration</a>)</code><a class="srclink" href="../src/chrono/naive/time.rs.html#1156-1158" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the <code>-=</code> operation. <a href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.SubAssign.html#tymethod.sub_assign">Read more</a></p>
</div></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></div><h3 id="impl-Borrow%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211-213" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id="impl-BorrowMut%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id="impl-From%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</code><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-Into%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-Into%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -&gt; U</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-ToOwned" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,&nbsp;</span></code><a href="#impl-ToOwned" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Owned" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
</div><h4 id="method.to_owned" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fnname">to_owned</a>(&amp;self) -&gt; T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
</div><h4 id="method.clone_into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fnname">clone_into</a>(&amp;self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T)</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><details><summary><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
</div></div><h3 id="impl-ToString" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-ToString" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2194-2207" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_string" class="method hidden"><code>pub default fn <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string" class="fnname">to_string</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2200-2206" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
</div></div><h3 id="impl-TryFrom%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id="method.try_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-TryInto%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-TryInto%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#575-584" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error-1" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id="method.try_into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#581-583" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "chrono";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
-24
View File
@@ -1,24 +0,0 @@
<!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 `ParseMonthError` struct in crate `chrono`."><meta name="keywords" content="rust, rustlang, rust-lang, ParseMonthError"><title>chrono::ParseMonthError - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[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">&#9776;</div><a href='../chrono/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Struct ParseMonthError</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-PartialEq%3CParseMonthError%3E">PartialEq&lt;ParseMonthError&gt;</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><p class="location"><a href="index.html">chrono</a></p><script>window.sidebarCurrent = {name: "ParseMonthError", ty: "struct", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../src/chrono/lib.rs.html#1127-1129" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="index.html">chrono</a>::<wbr><a class="struct" href="">ParseMonthError</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct ParseMonthError { /* fields omitted */ }</pre></div><div class="docblock"><p>An error resulting from reading <code>&lt;Month&gt;</code> value with <code>FromStr</code>.</p>
</div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Clone" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../chrono/struct.ParseMonthError.html" title="struct chrono::ParseMonthError">ParseMonthError</a></code><a href="#impl-Clone" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#1126" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&amp;self) -&gt; <a class="struct" href="../chrono/struct.ParseMonthError.html" title="struct chrono::ParseMonthError">ParseMonthError</a></code><a class="srclink" href="../src/chrono/lib.rs.html#1126" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id="method.clone_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&amp;mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self)</code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#128-130" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3 id="impl-Debug" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../chrono/struct.ParseMonthError.html" title="struct chrono::ParseMonthError">ParseMonthError</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#1131-1135" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class="srclink" href="../src/chrono/lib.rs.html#1132-1134" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id="impl-PartialEq%3CParseMonthError%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>&lt;<a class="struct" href="../chrono/struct.ParseMonthError.html" title="struct chrono::ParseMonthError">ParseMonthError</a>&gt; for <a class="struct" href="../chrono/struct.ParseMonthError.html" title="struct chrono::ParseMonthError">ParseMonthError</a></code><a href="#impl-PartialEq%3CParseMonthError%3E" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#1126" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.eq" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq" class="fnname">eq</a>(&amp;self, other: &amp;<a class="struct" href="../chrono/struct.ParseMonthError.html" title="struct chrono::ParseMonthError">ParseMonthError</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../src/chrono/lib.rs.html#1126" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id="method.ne" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne" class="fnname">ne</a>(&amp;self, other: &amp;<a class="struct" href="../chrono/struct.ParseMonthError.html" title="struct chrono::ParseMonthError">ParseMonthError</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../src/chrono/lib.rs.html#1126" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 id="impl-StructuralPartialEq" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="struct" href="../chrono/struct.ParseMonthError.html" title="struct chrono::ParseMonthError">ParseMonthError</a></code><a href="#impl-StructuralPartialEq" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#1126" title="goto source code">[src]</a></h3><div class="impl-items"></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../chrono/struct.ParseMonthError.html" title="struct chrono::ParseMonthError">ParseMonthError</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../chrono/struct.ParseMonthError.html" title="struct chrono::ParseMonthError">ParseMonthError</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../chrono/struct.ParseMonthError.html" title="struct chrono::ParseMonthError">ParseMonthError</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../chrono/struct.ParseMonthError.html" title="struct chrono::ParseMonthError">ParseMonthError</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../chrono/struct.ParseMonthError.html" title="struct chrono::ParseMonthError">ParseMonthError</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></div><h3 id="impl-Borrow%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211-213" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id="impl-BorrowMut%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id="impl-From%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</code><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-Into%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-Into%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -&gt; U</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-ToOwned" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,&nbsp;</span></code><a href="#impl-ToOwned" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Owned" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
</div><h4 id="method.to_owned" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fnname">to_owned</a>(&amp;self) -&gt; T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
</div><h4 id="method.clone_into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fnname">clone_into</a>(&amp;self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T)</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><details><summary><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
</div></div><h3 id="impl-TryFrom%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id="method.try_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-TryInto%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-TryInto%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#575-584" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error-1" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id="method.try_into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#581-583" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "chrono";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
-24
View File
@@ -1,24 +0,0 @@
<!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 `ParseWeekdayError` struct in crate `chrono`."><meta name="keywords" content="rust, rustlang, rust-lang, ParseWeekdayError"><title>chrono::ParseWeekdayError - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[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">&#9776;</div><a href='../chrono/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Struct ParseWeekdayError</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-PartialEq%3CParseWeekdayError%3E">PartialEq&lt;ParseWeekdayError&gt;</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><p class="location"><a href="index.html">chrono</a></p><script>window.sidebarCurrent = {name: "ParseWeekdayError", ty: "struct", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../src/chrono/lib.rs.html#824-826" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="index.html">chrono</a>::<wbr><a class="struct" href="">ParseWeekdayError</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct ParseWeekdayError { /* fields omitted */ }</pre></div><div class="docblock"><p>An error resulting from reading <code>Weekday</code> value with <code>FromStr</code>.</p>
</div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Clone" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../chrono/struct.ParseWeekdayError.html" title="struct chrono::ParseWeekdayError">ParseWeekdayError</a></code><a href="#impl-Clone" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#823" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&amp;self) -&gt; <a class="struct" href="../chrono/struct.ParseWeekdayError.html" title="struct chrono::ParseWeekdayError">ParseWeekdayError</a></code><a class="srclink" href="../src/chrono/lib.rs.html#823" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id="method.clone_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&amp;mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self)</code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#128-130" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3 id="impl-Debug" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../chrono/struct.ParseWeekdayError.html" title="struct chrono::ParseWeekdayError">ParseWeekdayError</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#828-832" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class="srclink" href="../src/chrono/lib.rs.html#829-831" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id="impl-PartialEq%3CParseWeekdayError%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>&lt;<a class="struct" href="../chrono/struct.ParseWeekdayError.html" title="struct chrono::ParseWeekdayError">ParseWeekdayError</a>&gt; for <a class="struct" href="../chrono/struct.ParseWeekdayError.html" title="struct chrono::ParseWeekdayError">ParseWeekdayError</a></code><a href="#impl-PartialEq%3CParseWeekdayError%3E" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#823" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.eq" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq" class="fnname">eq</a>(&amp;self, other: &amp;<a class="struct" href="../chrono/struct.ParseWeekdayError.html" title="struct chrono::ParseWeekdayError">ParseWeekdayError</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../src/chrono/lib.rs.html#823" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id="method.ne" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne" class="fnname">ne</a>(&amp;self, other: &amp;<a class="struct" href="../chrono/struct.ParseWeekdayError.html" title="struct chrono::ParseWeekdayError">ParseWeekdayError</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../src/chrono/lib.rs.html#823" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 id="impl-StructuralPartialEq" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="struct" href="../chrono/struct.ParseWeekdayError.html" title="struct chrono::ParseWeekdayError">ParseWeekdayError</a></code><a href="#impl-StructuralPartialEq" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#823" title="goto source code">[src]</a></h3><div class="impl-items"></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../chrono/struct.ParseWeekdayError.html" title="struct chrono::ParseWeekdayError">ParseWeekdayError</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../chrono/struct.ParseWeekdayError.html" title="struct chrono::ParseWeekdayError">ParseWeekdayError</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../chrono/struct.ParseWeekdayError.html" title="struct chrono::ParseWeekdayError">ParseWeekdayError</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../chrono/struct.ParseWeekdayError.html" title="struct chrono::ParseWeekdayError">ParseWeekdayError</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../chrono/struct.ParseWeekdayError.html" title="struct chrono::ParseWeekdayError">ParseWeekdayError</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../src/chrono/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></div><h3 id="impl-Borrow%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211-213" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id="impl-BorrowMut%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id="impl-From%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</code><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-Into%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-Into%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -&gt; U</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-ToOwned" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,&nbsp;</span></code><a href="#impl-ToOwned" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Owned" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
</div><h4 id="method.to_owned" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fnname">to_owned</a>(&amp;self) -&gt; T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
</div><h4 id="method.clone_into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fnname">clone_into</a>(&amp;self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T)</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><details><summary><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
</div></div><h3 id="impl-TryFrom%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id="method.try_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-TryInto%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-TryInto%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#575-584" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error-1" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id="method.try_into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#581-583" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "chrono";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
File diff suppressed because one or more lines are too long
-39
View File
@@ -1,39 +0,0 @@
<!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 `DurationRound` trait in crate `chrono`."><meta name="keywords" content="rust, rustlang, rust-lang, DurationRound"><title>chrono::DurationRound - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></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">&#9776;</div><a href='../chrono/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Trait DurationRound</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#associated-types">Associated Types</a><div class="sidebar-links"><a href="#associatedtype.Err">Err</a></div><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.duration_round">duration_round</a><a href="#tymethod.duration_trunc">duration_trunc</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class="location"><a href="index.html">chrono</a></p><script>window.sidebarCurrent = {name: "DurationRound", 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!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../src/chrono/round.rs.html#102-144" title="goto source code">[src]</a></span><span class="in-band">Trait <a href="index.html">chrono</a>::<wbr><a class="trait" href="">DurationRound</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust trait">pub trait DurationRound: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> {
type <a href="#associatedtype.Err" class="type">Err</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a>;
fn <a href="#tymethod.duration_round" class="fnname">duration_round</a>(self, duration: <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self, Self::<a class="type" href="../chrono/trait.DurationRound.html#associatedtype.Err" title="type chrono::DurationRound::Err">Err</a>&gt;;
<div class="item-spacer"></div> fn <a href="#tymethod.duration_trunc" class="fnname">duration_trunc</a>(self, duration: <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self, Self::<a class="type" href="../chrono/trait.DurationRound.html#associatedtype.Err" title="type chrono::DurationRound::Err">Err</a>&gt;;
}</pre></div><div class="docblock"><p>Extension trait for rounding or truncating a DateTime by a Duration.</p>
<h1 id="limitations" class="section-header"><a href="#limitations">Limitations</a></h1>
<p>Both rounding and truncating are done via <a href="../chrono/struct.Duration.html#method.num_nanoseconds" title="Duration::num_nanoseconds"><code>Duration::num_nanoseconds</code></a> and
<a href="../chrono/struct.DateTime.html#method.timestamp_nanos" title="DateTime::timestamp_nanos"><code>DateTime::timestamp_nanos</code></a>. This means that they will fail if either the
<code>Duration</code> or the <code>DateTime</code> are too big to represented as nanoseconds. They
will also fail if the <code>Duration</code> is bigger than the timestamp.</p>
</div><h2 id="associated-types" class="small-section-header">Associated Types<a href="#associated-types" class="anchor"></a></h2><div class="methods"><h3 id="associatedtype.Err" class="method"><code>type <a href="#associatedtype.Err" class="type">Err</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a></code><a class="srclink" href="../src/chrono/round.rs.html#105" title="goto source code">[src]</a></h3><div class="docblock"><p>Error that can occur in rounding or truncating</p>
</div></div><span class="loading-content">Loading content...</span><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><h3 id="tymethod.duration_round" class="method"><code>fn <a href="#tymethod.duration_round" class="fnname">duration_round</a>(self, duration: <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self, Self::<a class="type" href="../chrono/trait.DurationRound.html#associatedtype.Err" title="type chrono::DurationRound::Err">Err</a>&gt;</code><a class="srclink" href="../src/chrono/round.rs.html#126" title="goto source code">[src]</a></h3><div class="docblock"><p>Return a copy rounded by Duration.</p>
<h1 id="example" class="section-header"><a href="#example">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">Utc</span>.<span class="ident">ymd</span>(<span class="number">2018</span>, <span class="number">1</span>, <span class="number">11</span>).<span class="ident">and_hms_milli</span>(<span class="number">12</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">154</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(
<span class="ident">dt</span>.<span class="ident">duration_round</span>(<span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">10</span>)).<span class="ident">unwrap</span>().<span class="ident">to_string</span>(),
<span class="string">&quot;2018-01-11 12:00:00.150 UTC&quot;</span>
);
<span class="macro">assert_eq</span><span class="macro">!</span>(
<span class="ident">dt</span>.<span class="ident">duration_round</span>(<span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">1</span>)).<span class="ident">unwrap</span>().<span class="ident">to_string</span>(),
<span class="string">&quot;2018-01-12 00:00:00 UTC&quot;</span>
);</pre></div>
</div><h3 id="tymethod.duration_trunc" class="method"><code>fn <a href="#tymethod.duration_trunc" class="fnname">duration_trunc</a>(self, duration: <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self, Self::<a class="type" href="../chrono/trait.DurationRound.html#associatedtype.Err" title="type chrono::DurationRound::Err">Err</a>&gt;</code><a class="srclink" href="../src/chrono/round.rs.html#143" title="goto source code">[src]</a></h3><div class="docblock"><p>Return a copy truncated by Duration.</p>
<h1 id="example-1" class="section-header"><a href="#example-1">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">Utc</span>.<span class="ident">ymd</span>(<span class="number">2018</span>, <span class="number">1</span>, <span class="number">11</span>).<span class="ident">and_hms_milli</span>(<span class="number">12</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">154</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(
<span class="ident">dt</span>.<span class="ident">duration_trunc</span>(<span class="ident">Duration</span>::<span class="ident">milliseconds</span>(<span class="number">10</span>)).<span class="ident">unwrap</span>().<span class="ident">to_string</span>(),
<span class="string">&quot;2018-01-11 12:00:00.150 UTC&quot;</span>
);
<span class="macro">assert_eq</span><span class="macro">!</span>(
<span class="ident">dt</span>.<span class="ident">duration_trunc</span>(<span class="ident">Duration</span>::<span class="ident">days</span>(<span class="number">1</span>)).<span class="ident">unwrap</span>().<span class="ident">to_string</span>(),
<span class="string">&quot;2018-01-11 00:00:00 UTC&quot;</span>
);</pre></div>
</div></div><span class="loading-content">Loading content...</span><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"><h3 id="impl-DurationRound" class="impl"><code class="in-band">impl&lt;Tz:&nbsp;<a class="trait" href="../chrono/offset/trait.TimeZone.html" title="trait chrono::offset::TimeZone">TimeZone</a>&gt; DurationRound for <a class="struct" href="../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Tz&gt;</code><a href="#impl-DurationRound" class="anchor"></a><a class="srclink" href="../src/chrono/round.rs.html#149-200" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Err-1" class="type"><code>type <a href="#associatedtype.Err-1" class="type">Err</a> = <a class="enum" href="../chrono/enum.RoundingError.html" title="enum chrono::RoundingError">RoundingError</a></code></h4><h4 id="method.duration_round" class="method hidden"><code>fn <a href="#method.duration_round" class="fnname">duration_round</a>(self, duration: <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self, Self::<a class="type" href="../chrono/trait.DurationRound.html#associatedtype.Err" title="type chrono::DurationRound::Err">Err</a>&gt;</code><a class="srclink" href="../src/chrono/round.rs.html#152-179" title="goto source code">[src]</a></h4><h4 id="method.duration_trunc" class="method hidden"><code>fn <a href="#method.duration_trunc" class="fnname">duration_trunc</a>(self, duration: <a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self, Self::<a class="type" href="../chrono/trait.DurationRound.html#associatedtype.Err" title="type chrono::DurationRound::Err">Err</a>&gt;</code><a class="srclink" href="../src/chrono/round.rs.html#181-199" title="goto source code">[src]</a></h4></div></div><span class="loading-content">Loading content...</span><script type="text/javascript" src="../implementors/chrono/trait.DurationRound.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "chrono";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
-28
View File
@@ -1,28 +0,0 @@
<!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 `SubsecRound` trait in crate `chrono`."><meta name="keywords" content="rust, rustlang, rust-lang, SubsecRound"><title>chrono::SubsecRound - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></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">&#9776;</div><a href='../chrono/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Trait SubsecRound</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.round_subsecs">round_subsecs</a><a href="#tymethod.trunc_subsecs">trunc_subsecs</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class="location"><a href="index.html">chrono</a></p><script>window.sidebarCurrent = {name: "SubsecRound", 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!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../src/chrono/round.rs.html#21-46" title="goto source code">[src]</a></span><span class="in-band">Trait <a href="index.html">chrono</a>::<wbr><a class="trait" href="">SubsecRound</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust trait">pub trait SubsecRound {
fn <a href="#tymethod.round_subsecs" class="fnname">round_subsecs</a>(self, digits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u16.html">u16</a>) -&gt; Self;
<div class="item-spacer"></div> fn <a href="#tymethod.trunc_subsecs" class="fnname">trunc_subsecs</a>(self, digits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u16.html">u16</a>) -&gt; Self;
}</pre></div><div class="docblock"><p>Extension trait for subsecond rounding or truncation to a maximum number
of digits. Rounding can be used to decrease the error variance when
serializing/persisting to lower precision. Truncation is the default
behavior in Chrono display formatting. Either can be used to guarantee
equality (e.g. for testing) when round-tripping through a lower precision
format.</p>
</div><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><h3 id="tymethod.round_subsecs" class="method"><code>fn <a href="#tymethod.round_subsecs" class="fnname">round_subsecs</a>(self, digits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u16.html">u16</a>) -&gt; Self</code><a class="srclink" href="../src/chrono/round.rs.html#33" title="goto source code">[src]</a></h3><div class="docblock"><p>Return a copy rounded to the specified number of subsecond digits. With
9 or more digits, self is returned unmodified. Halfway values are
rounded up (away from zero).</p>
<h1 id="example" class="section-header"><a href="#example">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">Utc</span>.<span class="ident">ymd</span>(<span class="number">2018</span>, <span class="number">1</span>, <span class="number">11</span>).<span class="ident">and_hms_milli</span>(<span class="number">12</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">154</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">round_subsecs</span>(<span class="number">2</span>).<span class="ident">nanosecond</span>(), <span class="number">150_000_000</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">round_subsecs</span>(<span class="number">1</span>).<span class="ident">nanosecond</span>(), <span class="number">200_000_000</span>);</pre></div>
</div><h3 id="tymethod.trunc_subsecs" class="method"><code>fn <a href="#tymethod.trunc_subsecs" class="fnname">trunc_subsecs</a>(self, digits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u16.html">u16</a>) -&gt; Self</code><a class="srclink" href="../src/chrono/round.rs.html#45" title="goto source code">[src]</a></h3><div class="docblock"><p>Return a copy truncated to the specified number of subsecond
digits. With 9 or more digits, self is returned unmodified.</p>
<h1 id="example-1" class="section-header"><a href="#example-1">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">Utc</span>.<span class="ident">ymd</span>(<span class="number">2018</span>, <span class="number">1</span>, <span class="number">11</span>).<span class="ident">and_hms_milli</span>(<span class="number">12</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">154</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">trunc_subsecs</span>(<span class="number">2</span>).<span class="ident">nanosecond</span>(), <span class="number">150_000_000</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">trunc_subsecs</span>(<span class="number">1</span>).<span class="ident">nanosecond</span>(), <span class="number">100_000_000</span>);</pre></div>
</div></div><span class="loading-content">Loading content...</span><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"><h3 id="impl-SubsecRound" class="impl"><code class="in-band">impl&lt;T&gt; SubsecRound for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../chrono/trait.Timelike.html" title="trait chrono::Timelike">Timelike</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Add.html" title="trait core::ops::arith::Add">Add</a>&lt;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>, Output = T&gt; + <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Sub.html" title="trait core::ops::arith::Sub">Sub</a>&lt;<a class="struct" href="../chrono/struct.Duration.html" title="struct chrono::Duration">Duration</a>, Output = T&gt;,&nbsp;</span></code><a href="#impl-SubsecRound" class="anchor"></a><a class="srclink" href="../src/chrono/round.rs.html#48-76" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.round_subsecs" class="method hidden"><code>fn <a href="#method.round_subsecs" class="fnname">round_subsecs</a>(self, digits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u16.html">u16</a>) -&gt; T</code><a class="srclink" href="../src/chrono/round.rs.html#52-65" title="goto source code">[src]</a></h4><h4 id="method.trunc_subsecs" class="method hidden"><code>fn <a href="#method.trunc_subsecs" class="fnname">trunc_subsecs</a>(self, digits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u16.html">u16</a>) -&gt; T</code><a class="srclink" href="../src/chrono/round.rs.html#67-75" title="goto source code">[src]</a></h4></div></div><span class="loading-content">Loading content...</span><script type="text/javascript" src="../implementors/chrono/trait.SubsecRound.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "chrono";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
-234
View File
@@ -1,234 +0,0 @@
<!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 `Timelike` trait in crate `chrono`."><meta name="keywords" content="rust, rustlang, rust-lang, Timelike"><title>chrono::Timelike - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></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">&#9776;</div><a href='../chrono/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Trait Timelike</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.hour">hour</a><a href="#tymethod.minute">minute</a><a href="#tymethod.nanosecond">nanosecond</a><a href="#tymethod.second">second</a><a href="#tymethod.with_hour">with_hour</a><a href="#tymethod.with_minute">with_minute</a><a href="#tymethod.with_nanosecond">with_nanosecond</a><a href="#tymethod.with_second">with_second</a></div><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.hour12">hour12</a><a href="#method.num_seconds_from_midnight">num_seconds_from_midnight</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class="location"><a href="index.html">chrono</a></p><script>window.sidebarCurrent = {name: "Timelike", 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!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../src/chrono/lib.rs.html#1363-1419" title="goto source code">[src]</a></span><span class="in-band">Trait <a href="index.html">chrono</a>::<wbr><a class="trait" href="">Timelike</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust trait">pub trait Timelike: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> {
fn <a href="#tymethod.hour" class="fnname">hour</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>;
<div class="item-spacer"></div> fn <a href="#tymethod.minute" class="fnname">minute</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>;
<div class="item-spacer"></div> fn <a href="#tymethod.second" class="fnname">second</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>;
<div class="item-spacer"></div> fn <a href="#tymethod.nanosecond" class="fnname">nanosecond</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>;
<div class="item-spacer"></div> fn <a href="#tymethod.with_hour" class="fnname">with_hour</a>(&amp;self, hour: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;;
<div class="item-spacer"></div> fn <a href="#tymethod.with_minute" class="fnname">with_minute</a>(&amp;self, min: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;;
<div class="item-spacer"></div> fn <a href="#tymethod.with_second" class="fnname">with_second</a>(&amp;self, sec: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;;
<div class="item-spacer"></div> fn <a href="#tymethod.with_nanosecond" class="fnname">with_nanosecond</a>(&amp;self, nano: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;;
fn <a href="#method.hour12" class="fnname">hour12</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a> { ... }
<div class="item-spacer"></div> fn <a href="#method.num_seconds_from_midnight" class="fnname">num_seconds_from_midnight</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a> { ... }
}</pre></div><div class="docblock"><p>The common set of methods for time component.</p>
</div><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><h3 id="tymethod.hour" class="method"><code>fn <a href="#tymethod.hour" class="fnname">hour</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../src/chrono/lib.rs.html#1365" title="goto source code">[src]</a></h3><div class="docblock"><p>Returns the hour number from 0 to 23.</p>
</div><h3 id="tymethod.minute" class="method"><code>fn <a href="#tymethod.minute" class="fnname">minute</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../src/chrono/lib.rs.html#1380" title="goto source code">[src]</a></h3><div class="docblock"><p>Returns the minute number from 0 to 59.</p>
</div><h3 id="tymethod.second" class="method"><code>fn <a href="#tymethod.second" class="fnname">second</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../src/chrono/lib.rs.html#1383" title="goto source code">[src]</a></h3><div class="docblock"><p>Returns the second number from 0 to 59.</p>
</div><h3 id="tymethod.nanosecond" class="method"><code>fn <a href="#tymethod.nanosecond" class="fnname">nanosecond</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../src/chrono/lib.rs.html#1388" title="goto source code">[src]</a></h3><div class="docblock"><p>Returns the number of nanoseconds since the whole non-leap second.
The range from 1,000,000,000 to 1,999,999,999 represents
the <a href="./naive/struct.NaiveTime.html#leap-second-handling">leap second</a>.</p>
</div><h3 id="tymethod.with_hour" class="method"><code>fn <a href="#tymethod.with_hour" class="fnname">with_hour</a>(&amp;self, hour: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;</code><a class="srclink" href="../src/chrono/lib.rs.html#1393" title="goto source code">[src]</a></h3><div class="docblock"><p>Makes a new value with the hour number changed.</p>
<p>Returns <code>None</code> when the resulting value would be invalid.</p>
</div><h3 id="tymethod.with_minute" class="method"><code>fn <a href="#tymethod.with_minute" class="fnname">with_minute</a>(&amp;self, min: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;</code><a class="srclink" href="../src/chrono/lib.rs.html#1398" title="goto source code">[src]</a></h3><div class="docblock"><p>Makes a new value with the minute number changed.</p>
<p>Returns <code>None</code> when the resulting value would be invalid.</p>
</div><h3 id="tymethod.with_second" class="method"><code>fn <a href="#tymethod.with_second" class="fnname">with_second</a>(&amp;self, sec: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;</code><a class="srclink" href="../src/chrono/lib.rs.html#1405" title="goto source code">[src]</a></h3><div class="docblock"><p>Makes a new value with the second number changed.</p>
<p>Returns <code>None</code> when the resulting value would be invalid.
As with the <a href="#tymethod.second"><code>second</code></a> method,
the input range is restricted to 0 through 59.</p>
</div><h3 id="tymethod.with_nanosecond" class="method"><code>fn <a href="#tymethod.with_nanosecond" class="fnname">with_nanosecond</a>(&amp;self, nano: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;</code><a class="srclink" href="../src/chrono/lib.rs.html#1412" title="goto source code">[src]</a></h3><div class="docblock"><p>Makes a new value with nanoseconds since the whole non-leap second changed.</p>
<p>Returns <code>None</code> when the resulting value would be invalid.
As with the <a href="#tymethod.nanosecond"><code>nanosecond</code></a> method,
the input range can exceed 1,000,000,000 for leap seconds.</p>
</div></div><span class="loading-content">Loading content...</span><h2 id="provided-methods" class="small-section-header">Provided methods<a href="#provided-methods" class="anchor"></a></h2><div class="methods"><h3 id="method.hour12" class="method"><code>fn <a href="#method.hour12" class="fnname">hour12</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code><a class="srclink" href="../src/chrono/lib.rs.html#1370-1377" title="goto source code">[src]</a></h3><div class="docblock"><p>Returns the hour number from 1 to 12 with a boolean flag,
which is false for AM and true for PM.</p>
</div><h3 id="method.num_seconds_from_midnight" class="method"><code>fn <a href="#method.num_seconds_from_midnight" class="fnname">num_seconds_from_midnight</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../src/chrono/lib.rs.html#1416-1418" title="goto source code">[src]</a></h3><div class="docblock"><p>Returns the number of non-leap seconds past the last midnight.</p>
</div></div><span class="loading-content">Loading content...</span><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"><h3 id="impl-Timelike" class="impl"><code class="in-band">impl Timelike for <a class="struct" href="../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></code><a href="#impl-Timelike" class="anchor"></a><a class="srclink" href="../src/chrono/naive/datetime.rs.html#1020-1186" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.hour" class="method"><code>fn <a href="#method.hour" class="fnname">hour</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../src/chrono/naive/datetime.rs.html#1034-1036" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the hour number from 0 to 23.</p>
<p>See also the <a href="./struct.NaiveTime.html#method.hour"><code>NaiveTime::hour</code></a> method.</p>
<h1 id="example" class="section-header"><a href="#example">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Timelike</span>};
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">and_hms_milli</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>, <span class="number">789</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">hour</span>(), <span class="number">12</span>);</pre></div>
</div><h4 id="method.minute" class="method"><code>fn <a href="#method.minute" class="fnname">minute</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../src/chrono/naive/datetime.rs.html#1051-1053" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the minute number from 0 to 59.</p>
<p>See also the <a href="./struct.NaiveTime.html#method.minute"><code>NaiveTime::minute</code></a> method.</p>
<h1 id="example-1" class="section-header"><a href="#example-1">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Timelike</span>};
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">and_hms_milli</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>, <span class="number">789</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">minute</span>(), <span class="number">34</span>);</pre></div>
</div><h4 id="method.second" class="method"><code>fn <a href="#method.second" class="fnname">second</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../src/chrono/naive/datetime.rs.html#1068-1070" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the second number from 0 to 59.</p>
<p>See also the <a href="./struct.NaiveTime.html#method.second"><code>NaiveTime::second</code></a> method.</p>
<h1 id="example-2" class="section-header"><a href="#example-2">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Timelike</span>};
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">and_hms_milli</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>, <span class="number">789</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">second</span>(), <span class="number">56</span>);</pre></div>
</div><h4 id="method.nanosecond" class="method"><code>fn <a href="#method.nanosecond" class="fnname">nanosecond</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../src/chrono/naive/datetime.rs.html#1088-1090" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the number of nanoseconds since the whole non-leap second.
The range from 1,000,000,000 to 1,999,999,999 represents
the <a href="./struct.NaiveTime.html#leap-second-handling">leap second</a>.</p>
<p>See also the
<a href="./struct.NaiveTime.html#method.nanosecond"><code>NaiveTime::nanosecond</code></a> method.</p>
<h1 id="example-3" class="section-header"><a href="#example-3">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Timelike</span>};
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">and_hms_milli</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>, <span class="number">789</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">nanosecond</span>(), <span class="number">789_000_000</span>);</pre></div>
</div><h4 id="method.with_hour" class="method"><code>fn <a href="#method.with_hour" class="fnname">with_hour</a>(&amp;self, hour: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>&gt;</code><a class="srclink" href="../src/chrono/naive/datetime.rs.html#1110-1112" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDateTime</code> with the hour number changed.</p>
<p>Returns <code>None</code> when the resulting <code>NaiveDateTime</code> would be invalid.</p>
<p>See also the
<a href="./struct.NaiveTime.html#method.with_hour"><code>NaiveTime::with_hour</code></a> method.</p>
<h1 id="example-4" class="section-header"><a href="#example-4">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Timelike</span>};
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">and_hms_milli</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>, <span class="number">789</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_hour</span>(<span class="number">7</span>),
<span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">and_hms_milli</span>(<span class="number">7</span>, <span class="number">34</span>, <span class="number">56</span>, <span class="number">789</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_hour</span>(<span class="number">24</span>), <span class="prelude-val">None</span>);</pre></div>
</div><h4 id="method.with_minute" class="method"><code>fn <a href="#method.with_minute" class="fnname">with_minute</a>(&amp;self, min: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>&gt;</code><a class="srclink" href="../src/chrono/naive/datetime.rs.html#1132-1134" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDateTime</code> with the minute number changed.</p>
<p>Returns <code>None</code> when the resulting <code>NaiveDateTime</code> would be invalid.</p>
<p>See also the
<a href="./struct.NaiveTime.html#method.with_minute"><code>NaiveTime::with_minute</code></a> method.</p>
<h1 id="example-5" class="section-header"><a href="#example-5">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Timelike</span>};
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">and_hms_milli</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>, <span class="number">789</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_minute</span>(<span class="number">45</span>),
<span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">and_hms_milli</span>(<span class="number">12</span>, <span class="number">45</span>, <span class="number">56</span>, <span class="number">789</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_minute</span>(<span class="number">60</span>), <span class="prelude-val">None</span>);</pre></div>
</div><h4 id="method.with_second" class="method"><code>fn <a href="#method.with_second" class="fnname">with_second</a>(&amp;self, sec: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>&gt;</code><a class="srclink" href="../src/chrono/naive/datetime.rs.html#1156-1158" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDateTime</code> with the second number changed.</p>
<p>Returns <code>None</code> when the resulting <code>NaiveDateTime</code> would be invalid.
As with the <a href="#method.second"><code>second</code></a> method,
the input range is restricted to 0 through 59.</p>
<p>See also the
<a href="./struct.NaiveTime.html#method.with_second"><code>NaiveTime::with_second</code></a> method.</p>
<h1 id="example-6" class="section-header"><a href="#example-6">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Timelike</span>};
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">and_hms_milli</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>, <span class="number">789</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_second</span>(<span class="number">17</span>),
<span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">and_hms_milli</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">17</span>, <span class="number">789</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_second</span>(<span class="number">60</span>), <span class="prelude-val">None</span>);</pre></div>
</div><h4 id="method.with_nanosecond" class="method"><code>fn <a href="#method.with_nanosecond" class="fnname">with_nanosecond</a>(&amp;self, nano: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../chrono/naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>&gt;</code><a class="srclink" href="../src/chrono/naive/datetime.rs.html#1183-1185" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveDateTime</code> with nanoseconds since the whole non-leap second changed.</p>
<p>Returns <code>None</code> when the resulting <code>NaiveDateTime</code> would be invalid.
As with the <a href="#method.nanosecond"><code>nanosecond</code></a> method,
the input range can exceed 1,000,000,000 for leap seconds.</p>
<p>See also the
<a href="./struct.NaiveTime.html#method.with_nanosecond"><code>NaiveTime::with_nanosecond</code></a>
method.</p>
<h1 id="example-7" class="section-header"><a href="#example-7">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">NaiveDateTime</span>, <span class="ident">Timelike</span>};
<span class="kw">let</span> <span class="ident">dt</span>: <span class="ident">NaiveDateTime</span> <span class="op">=</span> <span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">and_hms_milli</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>, <span class="number">789</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_nanosecond</span>(<span class="number">333_333_333</span>),
<span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">and_hms_nano</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>, <span class="number">333_333_333</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_nanosecond</span>(<span class="number">1_333_333_333</span>), <span class="comment">// leap second</span>
<span class="prelude-val">Some</span>(<span class="ident">NaiveDate</span>::<span class="ident">from_ymd</span>(<span class="number">2015</span>, <span class="number">9</span>, <span class="number">8</span>).<span class="ident">and_hms_nano</span>(<span class="number">12</span>, <span class="number">34</span>, <span class="number">56</span>, <span class="number">1_333_333_333</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_nanosecond</span>(<span class="number">2_000_000_000</span>), <span class="prelude-val">None</span>);</pre></div>
</div></div><h3 id="impl-Timelike-1" class="impl"><code class="in-band">impl Timelike for <a class="struct" href="../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></code><a href="#impl-Timelike-1" class="anchor"></a><a class="srclink" href="../src/chrono/naive/time.rs.html#803-1010" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.hour-1" class="method"><code>fn <a href="#method.hour-1" class="fnname">hour</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../src/chrono/naive/time.rs.html#815-817" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the hour number from 0 to 23.</p>
<h1 id="example-8" class="section-header"><a href="#example-8">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveTime</span>, <span class="ident">Timelike</span>};
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>).<span class="ident">hour</span>(), <span class="number">0</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">12_345_678</span>).<span class="ident">hour</span>(), <span class="number">23</span>);</pre></div>
</div><h4 id="method.minute-1" class="method"><code>fn <a href="#method.minute-1" class="fnname">minute</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../src/chrono/naive/time.rs.html#830-832" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the minute number from 0 to 59.</p>
<h1 id="example-9" class="section-header"><a href="#example-9">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveTime</span>, <span class="ident">Timelike</span>};
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>).<span class="ident">minute</span>(), <span class="number">0</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">12_345_678</span>).<span class="ident">minute</span>(), <span class="number">56</span>);</pre></div>
</div><h4 id="method.second-1" class="method"><code>fn <a href="#method.second-1" class="fnname">second</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../src/chrono/naive/time.rs.html#856-858" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the second number from 0 to 59.</p>
<h1 id="example-10" class="section-header"><a href="#example-10">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveTime</span>, <span class="ident">Timelike</span>};
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>).<span class="ident">second</span>(), <span class="number">0</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">12_345_678</span>).<span class="ident">second</span>(), <span class="number">4</span>);</pre></div>
<p>This method never returns 60 even when it is a leap second.
(<a href="#leap-second-handling">Why?</a>)
Use the proper <a href="#method.format">formatting method</a> to get a human-readable representation.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">leap</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms_milli</span>(<span class="number">23</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">1_000</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span>.<span class="ident">second</span>(), <span class="number">59</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span>.<span class="ident">format</span>(<span class="string">&quot;%H:%M:%S&quot;</span>).<span class="ident">to_string</span>(), <span class="string">&quot;23:59:60&quot;</span>);</pre></div>
</div><h4 id="method.nanosecond-1" class="method"><code>fn <a href="#method.nanosecond-1" class="fnname">nanosecond</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../src/chrono/naive/time.rs.html#884-886" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the number of nanoseconds since the whole non-leap second.
The range from 1,000,000,000 to 1,999,999,999 represents
the <a href="#leap-second-handling">leap second</a>.</p>
<h1 id="example-11" class="section-header"><a href="#example-11">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveTime</span>, <span class="ident">Timelike</span>};
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>).<span class="ident">nanosecond</span>(), <span class="number">0</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">12_345_678</span>).<span class="ident">nanosecond</span>(), <span class="number">12_345_678</span>);</pre></div>
<p>Leap seconds may have seemingly out-of-range return values.
You can reduce the range with <code>time.nanosecond() % 1_000_000_000</code>, or
use the proper <a href="#method.format">formatting method</a> to get a human-readable representation.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">leap</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms_milli</span>(<span class="number">23</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">1_000</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span>.<span class="ident">nanosecond</span>(), <span class="number">1_000_000_000</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">leap</span>.<span class="ident">format</span>(<span class="string">&quot;%H:%M:%S%.9f&quot;</span>).<span class="ident">to_string</span>(), <span class="string">&quot;23:59:60.000000000&quot;</span>);</pre></div>
</div><h4 id="method.with_hour-1" class="method"><code>fn <a href="#method.with_hour-1" class="fnname">with_hour</a>(&amp;self, hour: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>&gt;</code><a class="srclink" href="../src/chrono/naive/time.rs.html#902-908" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveTime</code> with the hour number changed.</p>
<p>Returns <code>None</code> when the resulting <code>NaiveTime</code> would be invalid.</p>
<h1 id="example-12" class="section-header"><a href="#example-12">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveTime</span>, <span class="ident">Timelike</span>};
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">12_345_678</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_hour</span>(<span class="number">7</span>), <span class="prelude-val">Some</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano</span>(<span class="number">7</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">12_345_678</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_hour</span>(<span class="number">24</span>), <span class="prelude-val">None</span>);</pre></div>
</div><h4 id="method.with_minute-1" class="method"><code>fn <a href="#method.with_minute-1" class="fnname">with_minute</a>(&amp;self, min: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>&gt;</code><a class="srclink" href="../src/chrono/naive/time.rs.html#924-930" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveTime</code> with the minute number changed.</p>
<p>Returns <code>None</code> when the resulting <code>NaiveTime</code> would be invalid.</p>
<h1 id="example-13" class="section-header"><a href="#example-13">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveTime</span>, <span class="ident">Timelike</span>};
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">12_345_678</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_minute</span>(<span class="number">45</span>), <span class="prelude-val">Some</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano</span>(<span class="number">23</span>, <span class="number">45</span>, <span class="number">4</span>, <span class="number">12_345_678</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_minute</span>(<span class="number">60</span>), <span class="prelude-val">None</span>);</pre></div>
</div><h4 id="method.with_second-1" class="method"><code>fn <a href="#method.with_second-1" class="fnname">with_second</a>(&amp;self, sec: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>&gt;</code><a class="srclink" href="../src/chrono/naive/time.rs.html#948-954" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveTime</code> with the second number changed.</p>
<p>Returns <code>None</code> when the resulting <code>NaiveTime</code> would be invalid.
As with the <a href="#method.second"><code>second</code></a> method,
the input range is restricted to 0 through 59.</p>
<h1 id="example-14" class="section-header"><a href="#example-14">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveTime</span>, <span class="ident">Timelike</span>};
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">12_345_678</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_second</span>(<span class="number">17</span>), <span class="prelude-val">Some</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">17</span>, <span class="number">12_345_678</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_second</span>(<span class="number">60</span>), <span class="prelude-val">None</span>);</pre></div>
</div><h4 id="method.with_nanosecond-1" class="method"><code>fn <a href="#method.with_nanosecond-1" class="fnname">with_nanosecond</a>(&amp;self, nano: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../chrono/naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a>&gt;</code><a class="srclink" href="../src/chrono/naive/time.rs.html#985-990" title="goto source code">[src]</a></h4><div class="docblock"><p>Makes a new <code>NaiveTime</code> with nanoseconds since the whole non-leap second changed.</p>
<p>Returns <code>None</code> when the resulting <code>NaiveTime</code> would be invalid.
As with the <a href="#method.nanosecond"><code>nanosecond</code></a> method,
the input range can exceed 1,000,000,000 for leap seconds.</p>
<h1 id="example-15" class="section-header"><a href="#example-15">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveTime</span>, <span class="ident">Timelike</span>};
<span class="kw">let</span> <span class="ident">dt</span> <span class="op">=</span> <span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">12_345_678</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_nanosecond</span>(<span class="number">333_333_333</span>),
<span class="prelude-val">Some</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">333_333_333</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_nanosecond</span>(<span class="number">2_000_000_000</span>), <span class="prelude-val">None</span>);</pre></div>
<p>Leap seconds can theoretically follow <em>any</em> whole second.
The following would be a proper leap second at the time zone offset of UTC-00:03:57
(there are several historical examples comparable to this &quot;non-sense&quot; offset),
and therefore is allowed.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dt</span>.<span class="ident">with_nanosecond</span>(<span class="number">1_333_333_333</span>),
<span class="prelude-val">Some</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">1_333_333_333</span>)));</pre></div>
</div><h4 id="method.num_seconds_from_midnight-1" class="method"><code>fn <a href="#method.num_seconds_from_midnight-1" class="fnname">num_seconds_from_midnight</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../src/chrono/naive/time.rs.html#1007-1009" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the number of non-leap seconds past the last midnight.</p>
<h1 id="example-16" class="section-header"><a href="#example-16">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveTime</span>, <span class="ident">Timelike</span>};
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms</span>(<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>).<span class="ident">num_seconds_from_midnight</span>(),
<span class="number">3723</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms_nano</span>(<span class="number">23</span>, <span class="number">56</span>, <span class="number">4</span>, <span class="number">12_345_678</span>).<span class="ident">num_seconds_from_midnight</span>(),
<span class="number">86164</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">NaiveTime</span>::<span class="ident">from_hms_milli</span>(<span class="number">23</span>, <span class="number">59</span>, <span class="number">59</span>, <span class="number">1_000</span>).<span class="ident">num_seconds_from_midnight</span>(),
<span class="number">86399</span>);</pre></div>
</div></div><h3 id="impl-Timelike-2" class="impl"><code class="in-band">impl&lt;Tz:&nbsp;<a class="trait" href="../chrono/offset/trait.TimeZone.html" title="trait chrono::offset::TimeZone">TimeZone</a>&gt; Timelike for <a class="struct" href="../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Tz&gt;</code><a href="#impl-Timelike-2" class="anchor"></a><a class="srclink" href="../src/chrono/datetime.rs.html#609-646" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.hour-2" class="method hidden"><code>fn <a href="#method.hour-2" class="fnname">hour</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../src/chrono/datetime.rs.html#611-613" title="goto source code">[src]</a></h4><h4 id="method.minute-2" class="method hidden"><code>fn <a href="#method.minute-2" class="fnname">minute</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../src/chrono/datetime.rs.html#615-617" title="goto source code">[src]</a></h4><h4 id="method.second-2" class="method hidden"><code>fn <a href="#method.second-2" class="fnname">second</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../src/chrono/datetime.rs.html#619-621" title="goto source code">[src]</a></h4><h4 id="method.nanosecond-2" class="method hidden"><code>fn <a href="#method.nanosecond-2" class="fnname">nanosecond</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../src/chrono/datetime.rs.html#623-625" title="goto source code">[src]</a></h4><h4 id="method.with_hour-2" class="method hidden"><code>fn <a href="#method.with_hour-2" class="fnname">with_hour</a>(&amp;self, hour: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Tz&gt;&gt;</code><a class="srclink" href="../src/chrono/datetime.rs.html#628-630" title="goto source code">[src]</a></h4><h4 id="method.with_minute-2" class="method hidden"><code>fn <a href="#method.with_minute-2" class="fnname">with_minute</a>(&amp;self, min: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Tz&gt;&gt;</code><a class="srclink" href="../src/chrono/datetime.rs.html#633-635" title="goto source code">[src]</a></h4><h4 id="method.with_second-2" class="method hidden"><code>fn <a href="#method.with_second-2" class="fnname">with_second</a>(&amp;self, sec: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Tz&gt;&gt;</code><a class="srclink" href="../src/chrono/datetime.rs.html#638-640" title="goto source code">[src]</a></h4><h4 id="method.with_nanosecond-2" class="method hidden"><code>fn <a href="#method.with_nanosecond-2" class="fnname">with_nanosecond</a>(&amp;self, nano: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../chrono/struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Tz&gt;&gt;</code><a class="srclink" href="../src/chrono/datetime.rs.html#643-645" title="goto source code">[src]</a></h4></div></div><span class="loading-content">Loading content...</span><script type="text/javascript" src="../implementors/chrono/trait.Timelike.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "chrono";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
+2 -2
View File
@@ -1,6 +1,6 @@
<!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="List of all items in this crate"><meta name="keywords" content="rust, rustlang, rust-lang"><title>List of all items in this crate</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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg"> <!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="List of all items in this crate"><meta name="keywords" content="rust, rustlang, rust-lang"><title>List of all items in this crate</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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png"> <link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[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">&#9776;</div><a href='../http_body/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Crate http_body</p><div class="block version"><p>Version 0.4.0</p></div><a id="all-types" href="index.html"><p>Back to index</p></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button> <link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[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">&#9776;</div><a href='../http_body/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Crate http_body</p><div class="block version"><p>Version 0.4.1</p></div><a id="all-types" href="index.html"><p>Back to index</p></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span> <a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span>
</span> </span>
<span class="in-band">List of all items</span></h1><h3 id="Structs">Structs</h3><ul class="structs docblock"><li><a href="struct.Data.html">Data</a></li><li><a href="struct.SizeHint.html">SizeHint</a></li><li><a href="struct.Trailers.html">Trailers</a></li></ul><h3 id="Traits">Traits</h3><ul class="traits docblock"><li><a href="trait.Body.html">Body</a></li></ul></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "http_body";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html> <span class="in-band">List of all items</span></h1><h3 id="Structs">Structs</h3><ul class="structs docblock"><li><a href="struct.Data.html">Data</a></li><li><a href="struct.Empty.html">Empty</a></li><li><a href="struct.SizeHint.html">SizeHint</a></li><li><a href="struct.Trailers.html">Trailers</a></li><li><a href="combinators/struct.BoxBody.html">combinators::BoxBody</a></li><li><a href="combinators/struct.MapData.html">combinators::MapData</a></li><li><a href="combinators/struct.MapErr.html">combinators::MapErr</a></li></ul><h3 id="Traits">Traits</h3><ul class="traits docblock"><li><a href="trait.Body.html">Body</a></li></ul></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "http_body";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../http_body/combinators/struct.BoxBody.html">
</head>
<body>
<p>Redirecting to <a href="../../../http_body/combinators/struct.BoxBody.html">../../../http_body/combinators/struct.BoxBody.html</a>...</p>
<script>location.replace("../../../http_body/combinators/struct.BoxBody.html" + location.search + location.hash);</script>
</body>
</html>
+9
View File
@@ -0,0 +1,9 @@
<!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 `combinators` mod in crate `http_body`."><meta name="keywords" content="rust, rustlang, rust-lang, combinators"><title>http_body::combinators - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[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">&#9776;</div><a href='../../http_body/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Module combinators</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><p class="location"><a href="../index.html">http_body</a></p><script>window.sidebarCurrent = {name: "combinators", ty: "mod", relpath: "../"};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../../src/http_body/combinators/mod.rs.html#1-7" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../index.html">http_body</a>::<wbr><a class="mod" href="">combinators</a></span></h1><div class="docblock"><p>Combinators for the <code>Body</code> trait.</p>
</div><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
<table><tr class="module-item"><td><a class="struct" href="struct.BoxBody.html" title="http_body::combinators::BoxBody struct">BoxBody</a></td><td class="docblock-short"><p>A boxed <a href="../../http_body/trait.Body.html" title="Body"><code>Body</code></a> trait object.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.MapData.html" title="http_body::combinators::MapData struct">MapData</a></td><td class="docblock-short"><p>Body returned by the <a href="crate::util::BodyExt::map_data"><code>map_data</code></a> combinator.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.MapErr.html" title="http_body::combinators::MapErr struct">MapErr</a></td><td class="docblock-short"><p>Body returned by the <a href="crate::util::BodyExt::map_err"><code>map_err</code></a> combinator.</p>
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "http_body";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../http_body/combinators/struct.MapData.html">
</head>
<body>
<p>Redirecting to <a href="../../../http_body/combinators/struct.MapData.html">../../../http_body/combinators/struct.MapData.html</a>...</p>
<script>location.replace("../../../http_body/combinators/struct.MapData.html" + location.search + location.hash);</script>
</body>
</html>
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../http_body/combinators/struct.MapErr.html">
</head>
<body>
<p>Redirecting to <a href="../../../http_body/combinators/struct.MapErr.html">../../../http_body/combinators/struct.MapErr.html</a>...</p>
<script>location.replace("../../../http_body/combinators/struct.MapErr.html" + location.search + location.hash);</script>
</body>
</html>
@@ -0,0 +1 @@
initSidebarItems({"struct":[["BoxBody","A boxed [`Body`] trait object."],["MapData","Body returned by the `map_data` combinator."],["MapErr","Body returned by the `map_err` combinator."]]});
@@ -0,0 +1,27 @@
<!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 `BoxBody` struct in crate `http_body`."><meta name="keywords" content="rust, rustlang, rust-lang, BoxBody"><title>http_body::combinators::BoxBody - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[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">&#9776;</div><a href='../../http_body/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Struct BoxBody</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.new">new</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Body">Body</a><a href="#impl-Debug">Debug</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">!UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><p class="location"><a href="../index.html">http_body</a>::<wbr><a href="index.html">combinators</a></p><script>window.sidebarCurrent = {name: "BoxBody", ty: "struct", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../../src/http_body/combinators/box_body.rs.html#10-12" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="../index.html">http_body</a>::<wbr><a href="index.html">combinators</a>::<wbr><a class="struct" href="">BoxBody</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct BoxBody&lt;D, E&gt; { /* fields omitted */ }</pre></div><div class="docblock"><p>A boxed <a href="../../http_body/trait.Body.html" title="Body"><code>Body</code></a> trait object.</p>
</div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl&lt;D, E&gt; <a class="struct" href="../../http_body/combinators/struct.BoxBody.html" title="struct http_body::combinators::BoxBody">BoxBody</a>&lt;D, E&gt;</code><a href="#impl" class="anchor"></a><a class="srclink" href="../../src/http_body/combinators/box_body.rs.html#14-25" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.new" class="method"><code>pub fn <a href="#method.new" class="fnname">new</a>&lt;B&gt;(body: B) -&gt; Self <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;B: <a class="trait" href="../../http_body/trait.Body.html" title="trait http_body::Body">Body</a>&lt;Data = D, Error = E&gt; + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;D: <a class="trait" href="../../bytes/buf/buf_impl/trait.Buf.html" title="trait bytes::buf::buf_impl::Buf">Buf</a>,&nbsp;</span></code><a class="srclink" href="../../src/http_body/combinators/box_body.rs.html#16-24" title="goto source code">[src]</a></h4><div class="docblock"><p>Create a new <code>BoxBody</code>.</p>
</div></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Body" class="impl"><code class="in-band">impl&lt;D, E&gt; <a class="trait" href="../../http_body/trait.Body.html" title="trait http_body::Body">Body</a> for <a class="struct" href="../../http_body/combinators/struct.BoxBody.html" title="struct http_body::combinators::BoxBody">BoxBody</a>&lt;D, E&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;D: <a class="trait" href="../../bytes/buf/buf_impl/trait.Buf.html" title="trait bytes::buf::buf_impl::Buf">Buf</a>,&nbsp;</span></code><a href="#impl-Body" class="anchor"></a><a class="srclink" href="../../src/http_body/combinators/box_body.rs.html#33-61" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Data" class="type"><code>type <a href="../../http_body/trait.Body.html#associatedtype.Data" class="type">Data</a> = D</code></h4><div class='docblock'><p>Values yielded by the <code>Body</code>.</p>
</div><h4 id="associatedtype.Error" class="type"><code>type <a href="../../http_body/trait.Body.html#associatedtype.Error" class="type">Error</a> = E</code></h4><div class='docblock'><p>The error type this <code>Body</code> might generate.</p>
</div><h4 id="method.poll_data" class="method hidden"><code>fn <a href="../../http_body/trait.Body.html#tymethod.poll_data" class="fnname">poll_data</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="type" href="../../http_body/trait.Body.html#associatedtype.Data" title="type http_body::Body::Data">Data</a>, Self::<a class="type" href="../../http_body/trait.Body.html#associatedtype.Error" title="type http_body::Body::Error">Error</a>&gt;&gt;&gt;</code><a class="srclink" href="../../src/http_body/combinators/box_body.rs.html#40-45" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Attempt to pull out the next data buffer of this stream.</p>
</div><h4 id="method.poll_trailers" class="method hidden"><code>fn <a href="../../http_body/trait.Body.html#tymethod.poll_trailers" class="fnname">poll_trailers</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../http/header/map/struct.HeaderMap.html" title="struct http::header::map::HeaderMap">HeaderMap</a>&gt;, Self::<a class="type" href="../../http_body/trait.Body.html#associatedtype.Error" title="type http_body::Body::Error">Error</a>&gt;&gt;</code><a class="srclink" href="../../src/http_body/combinators/box_body.rs.html#47-52" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Poll for an optional <strong>single</strong> <code>HeaderMap</code> of trailers. <a href="../../http_body/trait.Body.html#tymethod.poll_trailers">Read more</a></p>
</div><h4 id="method.is_end_stream" class="method hidden"><code>fn <a href="../../http_body/trait.Body.html#method.is_end_stream" class="fnname">is_end_stream</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/http_body/combinators/box_body.rs.html#54-56" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns <code>true</code> when the end of stream has been reached. <a href="../../http_body/trait.Body.html#method.is_end_stream">Read more</a></p>
</div><h4 id="method.size_hint" class="method hidden"><code>fn <a href="../../http_body/trait.Body.html#method.size_hint" class="fnname">size_hint</a>(&amp;self) -&gt; <a class="struct" href="../../http_body/struct.SizeHint.html" title="struct http_body::SizeHint">SizeHint</a></code><a class="srclink" href="../../src/http_body/combinators/box_body.rs.html#58-60" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the bounds on the remaining length of the stream. <a href="../../http_body/trait.Body.html#method.size_hint">Read more</a></p>
</div><h4 id="method.data" class="method hidden"><code>fn <a href="../../http_body/trait.Body.html#method.data" class="fnname">data</a>(&amp;mut self) -&gt; <a class="struct" href="../../http_body/struct.Data.html" title="struct http_body::Data">Data</a>&lt;'_, Self&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../http_body/struct.Data.html" title="struct http_body::Data">Data</a>&lt;'a, T&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;'a, T:&nbsp;<a class="trait" href="../../http_body/trait.Body.html" title="trait http_body::Body">Body</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> for <a class="struct" href="../../http_body/struct.Data.html" title="struct http_body::Data">Data</a>&lt;'a, T&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T::<a class="type" href="../../http_body/trait.Body.html#associatedtype.Data" title="type http_body::Body::Data">Data</a>, T::<a class="type" href="../../http_body/trait.Body.html#associatedtype.Error" title="type http_body::Body::Error">Error</a>&gt;&gt;;</span></code></span></div></span></span> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a class="srclink" href="../../src/http_body/lib.rs.html#82-87" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns future that resolves to next data chunk, if any.</p>
</div><h4 id="method.trailers" class="method hidden"><code>fn <a href="../../http_body/trait.Body.html#method.trailers" class="fnname">trailers</a>(&amp;mut self) -&gt; <a class="struct" href="../../http_body/struct.Trailers.html" title="struct http_body::Trailers">Trailers</a>&lt;'_, Self&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../../http_body/struct.Trailers.html" title="struct http_body::Trailers">Trailers</a>&lt;'a, T&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;'a, T:&nbsp;<a class="trait" href="../../http_body/trait.Body.html" title="trait http_body::Body">Body</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> for <a class="struct" href="../../http_body/struct.Trailers.html" title="struct http_body::Trailers">Trailers</a>&lt;'a, T&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../http/header/map/struct.HeaderMap.html" title="struct http::header::map::HeaderMap">HeaderMap</a>&gt;, T::<a class="type" href="../../http_body/trait.Body.html#associatedtype.Error" title="type http_body::Body::Error">Error</a>&gt;;</span></code></span></div></span></span> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a class="srclink" href="../../src/http_body/lib.rs.html#90-95" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns future that resolves to trailers, if any.</p>
</div><h4 id="method.map_data" class="method hidden"><code>fn <a href="../../http_body/trait.Body.html#method.map_data" class="fnname">map_data</a>&lt;F, B&gt;(self, f: F) -&gt; <a class="struct" href="../../http_body/combinators/struct.MapData.html" title="struct http_body::combinators::MapData">MapData</a>&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="../../http_body/trait.Body.html#associatedtype.Data" title="type http_body::Body::Data">Data</a>) -&gt; B,<br>&nbsp;&nbsp;&nbsp;&nbsp;B: <a class="trait" href="../../bytes/buf/buf_impl/trait.Buf.html" title="trait bytes::buf::buf_impl::Buf">Buf</a>,&nbsp;</span></code><a class="srclink" href="../../src/http_body/lib.rs.html#98-105" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Maps this body's data value to a different value.</p>
</div><h4 id="method.map_err" class="method hidden"><code>fn <a href="../../http_body/trait.Body.html#method.map_err" class="fnname">map_err</a>&lt;F, E&gt;(self, f: F) -&gt; <a class="struct" href="../../http_body/combinators/struct.MapErr.html" title="struct http_body::combinators::MapErr">MapErr</a>&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="../../http_body/trait.Body.html#associatedtype.Error" title="type http_body::Body::Error">Error</a>) -&gt; E,&nbsp;</span></code><a class="srclink" href="../../src/http_body/lib.rs.html#108-114" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Maps this body's error value to a different value.</p>
</div><h4 id="method.boxed" class="method hidden"><code>fn <a href="../../http_body/trait.Body.html#method.boxed" class="fnname">boxed</a>(self) -&gt; <a class="struct" href="../../http_body/combinators/struct.BoxBody.html" title="struct http_body::combinators::BoxBody">BoxBody</a>&lt;Self::<a class="type" href="../../http_body/trait.Body.html#associatedtype.Data" title="type http_body::Body::Data">Data</a>, Self::<a class="type" href="../../http_body/trait.Body.html#associatedtype.Error" title="type http_body::Body::Error">Error</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'static,&nbsp;</span></code><a class="srclink" href="../../src/http_body/lib.rs.html#117-122" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Turn this body into a boxed trait object.</p>
</div></div><h3 id="impl-Debug" class="impl"><code class="in-band">impl&lt;D, E&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../http_body/combinators/struct.BoxBody.html" title="struct http_body::combinators::BoxBody">BoxBody</a>&lt;D, E&gt;</code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../src/http_body/combinators/box_body.rs.html#27-31" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class="srclink" href="../../src/http_body/combinators/box_body.rs.html#28-30" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl&lt;D, E&gt; !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../http_body/combinators/struct.BoxBody.html" title="struct http_body::combinators::BoxBody">BoxBody</a>&lt;D, E&gt;</code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../src/http_body/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl&lt;D, E&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../http_body/combinators/struct.BoxBody.html" title="struct http_body::combinators::BoxBody">BoxBody</a>&lt;D, E&gt;</code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../src/http_body/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl&lt;D, E&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../http_body/combinators/struct.BoxBody.html" title="struct http_body::combinators::BoxBody">BoxBody</a>&lt;D, E&gt;</code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../src/http_body/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl&lt;D, E&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../http_body/combinators/struct.BoxBody.html" title="struct http_body::combinators::BoxBody">BoxBody</a>&lt;D, E&gt;</code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../src/http_body/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl&lt;D, E&gt; !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../http_body/combinators/struct.BoxBody.html" title="struct http_body::combinators::BoxBody">BoxBody</a>&lt;D, E&gt;</code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../src/http_body/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></div><h3 id="impl-Borrow%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211-213" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id="impl-BorrowMut%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id="impl-From%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</code><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-Into%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-Into%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -&gt; U</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-TryFrom%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error-1" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id="method.try_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-TryInto%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-TryInto%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#575-584" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error-2" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id="method.try_into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#581-583" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "http_body";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+10
View File
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../http_body/struct.Empty.html">
</head>
<body>
<p>Redirecting to <a href="../../http_body/struct.Empty.html">../../http_body/struct.Empty.html</a>...</p>
<script>location.replace("../../http_body/struct.Empty.html" + location.search + location.hash);</script>
</body>
</html>
+6 -3
View File
@@ -1,10 +1,13 @@
<!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 `http_body` crate."><meta name="keywords" content="rust, rustlang, rust-lang, http_body"><title>http_body - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg"> <!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 `http_body` crate."><meta name="keywords" content="rust, rustlang, rust-lang, http_body"><title>http_body - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png"> <link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[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">&#9776;</div><a href='../http_body/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Crate http_body</p><div class="block version"><p>Version 0.4.0</p></div><div class="sidebar-elems"><a id="all-types" href="all.html"><p>See all http_body's items</p></a><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#traits">Traits</a></li></ul></div><p class="location"></p><script>window.sidebarCurrent = {name: "http_body", ty: "mod", relpath: "../"};</script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button> <link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[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">&#9776;</div><a href='../http_body/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Crate http_body</p><div class="block version"><p>Version 0.4.1</p></div><div class="sidebar-elems"><a id="all-types" href="all.html"><p>See all http_body's items</p></a><div class="block items"><ul><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#traits">Traits</a></li></ul></div><p class="location"></p><script>window.sidebarCurrent = {name: "http_body", ty: "mod", relpath: "../"};</script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../src/http_body/lib.rs.html#1-242" title="goto source code">[src]</a></span><span class="in-band">Crate <a class="mod" href="">http_body</a></span></h1><div class="docblock"><p>Asynchronous HTTP request or response body.</p> <a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../src/http_body/lib.rs.html#1-279" title="goto source code">[src]</a></span><span class="in-band">Crate <a class="mod" href="">http_body</a></span></h1><div class="docblock"><p>Asynchronous HTTP request or response body.</p>
<p>See <a href="trait.Body.html"><code>Body</code></a> for more details.</p> <p>See <a href="trait.Body.html"><code>Body</code></a> for more details.</p>
</div><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2> </div><h2 id="modules" class="section-header"><a href="#modules">Modules</a></h2>
<table><tr class="module-item"><td><a class="mod" href="combinators/index.html" title="http_body::combinators mod">combinators</a></td><td class="docblock-short"><p>Combinators for the <code>Body</code> trait.</p>
</td></tr></table><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
<table><tr class="module-item"><td><a class="struct" href="struct.Data.html" title="http_body::Data struct">Data</a></td><td class="docblock-short"><p>Future that resolves to the next data chunk from <code>Body</code></p> <table><tr class="module-item"><td><a class="struct" href="struct.Data.html" title="http_body::Data struct">Data</a></td><td class="docblock-short"><p>Future that resolves to the next data chunk from <code>Body</code></p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.Empty.html" title="http_body::Empty struct">Empty</a></td><td class="docblock-short"><p>A body that is always empty.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.SizeHint.html" title="http_body::SizeHint struct">SizeHint</a></td><td class="docblock-short"><p>A <code>Body</code> size hint</p> </td></tr><tr class="module-item"><td><a class="struct" href="struct.SizeHint.html" title="http_body::SizeHint struct">SizeHint</a></td><td class="docblock-short"><p>A <code>Body</code> size hint</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.Trailers.html" title="http_body::Trailers struct">Trailers</a></td><td class="docblock-short"><p>Future that resolves to the optional trailers from <code>Body</code></p> </td></tr><tr class="module-item"><td><a class="struct" href="struct.Trailers.html" title="http_body::Trailers struct">Trailers</a></td><td class="docblock-short"><p>Future that resolves to the optional trailers from <code>Body</code></p>
</td></tr></table><h2 id="traits" class="section-header"><a href="#traits">Traits</a></h2> </td></tr></table><h2 id="traits" class="section-header"><a href="#traits">Traits</a></h2>
+1 -1
View File
@@ -1 +1 @@
initSidebarItems({"struct":[["Data","Future that resolves to the next data chunk from `Body`"],["SizeHint","A `Body` size hint"],["Trailers","Future that resolves to the optional trailers from `Body`"]],"trait":[["Body","Trait representing a streaming body of a Request or Response."]]}); initSidebarItems({"mod":[["combinators","Combinators for the `Body` trait."]],"struct":[["Data","Future that resolves to the next data chunk from `Body`"],["Empty","A body that is always empty."],["SizeHint","A `Body` size hint"],["Trailers","Future that resolves to the optional trailers from `Body`"]],"trait":[["Body","Trait representing a streaming body of a Request or Response."]]});
+34
View File
@@ -0,0 +1,34 @@
<!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 `Empty` struct in crate `http_body`."><meta name="keywords" content="rust, rustlang, rust-lang, Empty"><title>http_body::Empty - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[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">&#9776;</div><a href='../http_body/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Struct Empty</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.new">new</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Body">Body</a><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><p class="location"><a href="index.html">http_body</a></p><script>window.sidebarCurrent = {name: "Empty", ty: "struct", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">&#x2212;</span>]</a></span><a class="srclink" href="../src/http_body/empty.rs.html#13-15" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="index.html">http_body</a>::<wbr><a class="struct" href="">Empty</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct Empty&lt;D&gt; { /* fields omitted */ }</pre></div><div class="docblock"><p>A body that is always empty.</p>
</div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl&lt;D&gt; <a class="struct" href="../http_body/struct.Empty.html" title="struct http_body::Empty">Empty</a>&lt;D&gt;</code><a href="#impl" class="anchor"></a><a class="srclink" href="../src/http_body/empty.rs.html#17-22" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.new" class="method"><code>pub fn <a href="#method.new" class="fnname">new</a>() -&gt; Self</code><a class="srclink" href="../src/http_body/empty.rs.html#19-21" title="goto source code">[src]</a></h4><div class="docblock"><p>Create a new <code>Empty</code>.</p>
</div></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Body" class="impl"><code class="in-band">impl&lt;D:&nbsp;<a class="trait" href="../bytes/buf/buf_impl/trait.Buf.html" title="trait bytes::buf::buf_impl::Buf">Buf</a>&gt; <a class="trait" href="../http_body/trait.Body.html" title="trait http_body::Body">Body</a> for <a class="struct" href="../http_body/struct.Empty.html" title="struct http_body::Empty">Empty</a>&lt;D&gt;</code><a href="#impl-Body" class="anchor"></a><a class="srclink" href="../src/http_body/empty.rs.html#24-43" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Data" class="type"><code>type <a href="../http_body/trait.Body.html#associatedtype.Data" class="type">Data</a> = D</code></h4><div class='docblock'><p>Values yielded by the <code>Body</code>.</p>
</div><h4 id="associatedtype.Error" class="type"><code>type <a href="../http_body/trait.Body.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The error type this <code>Body</code> might generate.</p>
</div><h4 id="method.poll_data" class="method hidden"><code>fn <a href="../http_body/trait.Body.html#tymethod.poll_data" class="fnname">poll_data</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;_cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="type" href="../http_body/trait.Body.html#associatedtype.Data" title="type http_body::Body::Data">Data</a>, Self::<a class="type" href="../http_body/trait.Body.html#associatedtype.Error" title="type http_body::Body::Error">Error</a>&gt;&gt;&gt;</code><a class="srclink" href="../src/http_body/empty.rs.html#29-34" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Attempt to pull out the next data buffer of this stream.</p>
</div><h4 id="method.poll_trailers" class="method hidden"><code>fn <a href="../http_body/trait.Body.html#tymethod.poll_trailers" class="fnname">poll_trailers</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;_cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../http/header/map/struct.HeaderMap.html" title="struct http::header::map::HeaderMap">HeaderMap</a>&gt;, Self::<a class="type" href="../http_body/trait.Body.html#associatedtype.Error" title="type http_body::Body::Error">Error</a>&gt;&gt;</code><a class="srclink" href="../src/http_body/empty.rs.html#37-42" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Poll for an optional <strong>single</strong> <code>HeaderMap</code> of trailers. <a href="../http_body/trait.Body.html#tymethod.poll_trailers">Read more</a></p>
</div><h4 id="method.is_end_stream" class="method hidden"><code>fn <a href="../http_body/trait.Body.html#method.is_end_stream" class="fnname">is_end_stream</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../src/http_body/lib.rs.html#69-71" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns <code>true</code> when the end of stream has been reached. <a href="../http_body/trait.Body.html#method.is_end_stream">Read more</a></p>
</div><h4 id="method.size_hint" class="method hidden"><code>fn <a href="../http_body/trait.Body.html#method.size_hint" class="fnname">size_hint</a>(&amp;self) -&gt; <a class="struct" href="../http_body/struct.SizeHint.html" title="struct http_body::SizeHint">SizeHint</a></code><a class="srclink" href="../src/http_body/lib.rs.html#77-79" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the bounds on the remaining length of the stream. <a href="../http_body/trait.Body.html#method.size_hint">Read more</a></p>
</div><h4 id="method.data" class="method hidden"><code>fn <a href="../http_body/trait.Body.html#method.data" class="fnname">data</a>(&amp;mut self) -&gt; <a class="struct" href="../http_body/struct.Data.html" title="struct http_body::Data">Data</a>&lt;'_, Self&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../http_body/struct.Data.html" title="struct http_body::Data">Data</a>&lt;'a, T&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;'a, T:&nbsp;<a class="trait" href="../http_body/trait.Body.html" title="trait http_body::Body">Body</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> for <a class="struct" href="../http_body/struct.Data.html" title="struct http_body::Data">Data</a>&lt;'a, T&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T::<a class="type" href="../http_body/trait.Body.html#associatedtype.Data" title="type http_body::Body::Data">Data</a>, T::<a class="type" href="../http_body/trait.Body.html#associatedtype.Error" title="type http_body::Body::Error">Error</a>&gt;&gt;;</span></code></span></div></span></span> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a class="srclink" href="../src/http_body/lib.rs.html#82-87" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns future that resolves to next data chunk, if any.</p>
</div><h4 id="method.trailers" class="method hidden"><code>fn <a href="../http_body/trait.Body.html#method.trailers" class="fnname">trailers</a>(&amp;mut self) -&gt; <a class="struct" href="../http_body/struct.Trailers.html" title="struct http_body::Trailers">Trailers</a>&lt;'_, Self&gt;<span class="notable-traits"><span class="notable-traits-tooltip"><div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="struct" href="../http_body/struct.Trailers.html" title="struct http_body::Trailers">Trailers</a>&lt;'a, T&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;'a, T:&nbsp;<a class="trait" href="../http_body/trait.Body.html" title="trait http_body::Body">Body</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> for <a class="struct" href="../http_body/struct.Trailers.html" title="struct http_body::Trailers">Trailers</a>&lt;'a, T&gt;</span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../http/header/map/struct.HeaderMap.html" title="struct http::header::map::HeaderMap">HeaderMap</a>&gt;, T::<a class="type" href="../http_body/trait.Body.html#associatedtype.Error" title="type http_body::Body::Error">Error</a>&gt;;</span></code></span></div></span></span> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a class="srclink" href="../src/http_body/lib.rs.html#90-95" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns future that resolves to trailers, if any.</p>
</div><h4 id="method.map_data" class="method hidden"><code>fn <a href="../http_body/trait.Body.html#method.map_data" class="fnname">map_data</a>&lt;F, B&gt;(self, f: F) -&gt; <a class="struct" href="../http_body/combinators/struct.MapData.html" title="struct http_body::combinators::MapData">MapData</a>&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="../http_body/trait.Body.html#associatedtype.Data" title="type http_body::Body::Data">Data</a>) -&gt; B,<br>&nbsp;&nbsp;&nbsp;&nbsp;B: <a class="trait" href="../bytes/buf/buf_impl/trait.Buf.html" title="trait bytes::buf::buf_impl::Buf">Buf</a>,&nbsp;</span></code><a class="srclink" href="../src/http_body/lib.rs.html#98-105" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Maps this body's data value to a different value.</p>
</div><h4 id="method.map_err" class="method hidden"><code>fn <a href="../http_body/trait.Body.html#method.map_err" class="fnname">map_err</a>&lt;F, E&gt;(self, f: F) -&gt; <a class="struct" href="../http_body/combinators/struct.MapErr.html" title="struct http_body::combinators::MapErr">MapErr</a>&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="../http_body/trait.Body.html#associatedtype.Error" title="type http_body::Body::Error">Error</a>) -&gt; E,&nbsp;</span></code><a class="srclink" href="../src/http_body/lib.rs.html#108-114" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Maps this body's error value to a different value.</p>
</div><h4 id="method.boxed" class="method hidden"><code>fn <a href="../http_body/trait.Body.html#method.boxed" class="fnname">boxed</a>(self) -&gt; <a class="struct" href="../http_body/combinators/struct.BoxBody.html" title="struct http_body::combinators::BoxBody">BoxBody</a>&lt;Self::<a class="type" href="../http_body/trait.Body.html#associatedtype.Data" title="type http_body::Body::Data">Data</a>, Self::<a class="type" href="../http_body/trait.Body.html#associatedtype.Error" title="type http_body::Body::Error">Error</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'static,&nbsp;</span></code><a class="srclink" href="../src/http_body/lib.rs.html#117-122" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Turn this body into a boxed trait object.</p>
</div></div><h3 id="impl-Clone" class="impl"><code class="in-band">impl&lt;D&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../http_body/struct.Empty.html" title="struct http_body::Empty">Empty</a>&lt;D&gt;</code><a href="#impl-Clone" class="anchor"></a><a class="srclink" href="../src/http_body/empty.rs.html#59-65" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&amp;self) -&gt; Self</code><a class="srclink" href="../src/http_body/empty.rs.html#60-64" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id="method.clone_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&amp;mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self)</code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#128-130" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3 id="impl-Copy" class="impl"><code class="in-band">impl&lt;D&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="struct" href="../http_body/struct.Empty.html" title="struct http_body::Empty">Empty</a>&lt;D&gt;</code><a href="#impl-Copy" class="anchor"></a><a class="srclink" href="../src/http_body/empty.rs.html#67" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Debug" class="impl"><code class="in-band">impl&lt;D&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../http_body/struct.Empty.html" title="struct http_body::Empty">Empty</a>&lt;D&gt;</code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../src/http_body/empty.rs.html#45-49" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class="srclink" href="../src/http_body/empty.rs.html#46-48" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id="impl-Default" class="impl"><code class="in-band">impl&lt;D&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../http_body/struct.Empty.html" title="struct http_body::Empty">Empty</a>&lt;D&gt;</code><a href="#impl-Default" class="anchor"></a><a class="srclink" href="../src/http_body/empty.rs.html#51-57" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.default" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default" class="fnname">default</a>() -&gt; Self</code><a class="srclink" href="../src/http_body/empty.rs.html#52-56" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the &quot;default value&quot; for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
</div></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl&lt;D&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../http_body/struct.Empty.html" title="struct http_body::Empty">Empty</a>&lt;D&gt;</code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../src/http_body/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl&lt;D&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../http_body/struct.Empty.html" title="struct http_body::Empty">Empty</a>&lt;D&gt;</code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../src/http_body/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl&lt;D&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../http_body/struct.Empty.html" title="struct http_body::Empty">Empty</a>&lt;D&gt;</code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../src/http_body/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl&lt;D&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../http_body/struct.Empty.html" title="struct http_body::Empty">Empty</a>&lt;D&gt;</code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../src/http_body/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl&lt;D&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../http_body/struct.Empty.html" title="struct http_body::Empty">Empty</a>&lt;D&gt;</code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../src/http_body/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></div><h3 id="impl-Borrow%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211-213" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id="impl-BorrowMut%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id="impl-From%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</code><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#552-556" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#553-555" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-Into%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-Into%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#541-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -&gt; U</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#545-547" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-ToOwned" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,&nbsp;</span></code><a href="#impl-ToOwned" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Owned" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
</div><h4 id="method.to_owned" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fnname">to_owned</a>(&amp;self) -&gt; T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
</div><h4 id="method.clone_into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fnname">clone_into</a>(&amp;self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T)</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><details><summary><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
</div></div><h3 id="impl-TryFrom%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error-1" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id="method.try_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595-597" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-TryInto%3CU%3E" class="impl"><code class="in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></code><a href="#impl-TryInto%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#575-584" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error-2" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id="method.try_into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#581-583" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "http_body";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
File diff suppressed because one or more lines are too long
+5 -2
View File
@@ -19,8 +19,11 @@ applications.</p>
</div><h4 id="method.poll_trailers" class="method hidden"><code>fn <a href="../../hyper/body/trait.HttpBody.html#tymethod.poll_trailers" class="fnname">poll_trailers</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../hyper/struct.HeaderMap.html" title="struct hyper::HeaderMap">HeaderMap</a>&gt;, Self::<a class="type" href="../../hyper/body/trait.HttpBody.html#associatedtype.Error" title="type hyper::body::HttpBody::Error">Error</a>&gt;&gt;</code><a class="srclink" href="../../src/hyper/body/body.rs.html#362-390" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Poll for an optional <strong>single</strong> <code>HeaderMap</code> of trailers. <a href="../../hyper/body/trait.HttpBody.html#tymethod.poll_trailers">Read more</a></p> </div><h4 id="method.poll_trailers" class="method hidden"><code>fn <a href="../../hyper/body/trait.HttpBody.html#tymethod.poll_trailers" class="fnname">poll_trailers</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../hyper/struct.HeaderMap.html" title="struct hyper::HeaderMap">HeaderMap</a>&gt;, Self::<a class="type" href="../../hyper/body/trait.HttpBody.html#associatedtype.Error" title="type hyper::body::HttpBody::Error">Error</a>&gt;&gt;</code><a class="srclink" href="../../src/hyper/body/body.rs.html#362-390" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Poll for an optional <strong>single</strong> <code>HeaderMap</code> of trailers. <a href="../../hyper/body/trait.HttpBody.html#tymethod.poll_trailers">Read more</a></p>
</div><h4 id="method.is_end_stream" class="method hidden"><code>fn <a href="../../hyper/body/trait.HttpBody.html#method.is_end_stream" class="fnname">is_end_stream</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/hyper/body/body.rs.html#392-403" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns <code>true</code> when the end of stream has been reached. <a href="../../hyper/body/trait.HttpBody.html#method.is_end_stream">Read more</a></p> </div><h4 id="method.is_end_stream" class="method hidden"><code>fn <a href="../../hyper/body/trait.HttpBody.html#method.is_end_stream" class="fnname">is_end_stream</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/hyper/body/body.rs.html#392-403" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns <code>true</code> when the end of stream has been reached. <a href="../../hyper/body/trait.HttpBody.html#method.is_end_stream">Read more</a></p>
</div><h4 id="method.size_hint" class="method hidden"><code>fn <a href="../../hyper/body/trait.HttpBody.html#method.size_hint" class="fnname">size_hint</a>(&amp;self) -&gt; <a class="struct" href="../../hyper/body/struct.SizeHint.html" title="struct hyper::body::SizeHint">SizeHint</a></code><a class="srclink" href="../../src/hyper/body/body.rs.html#405-429" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the bounds on the remaining length of the stream. <a href="../../hyper/body/trait.HttpBody.html#method.size_hint">Read more</a></p> </div><h4 id="method.size_hint" class="method hidden"><code>fn <a href="../../hyper/body/trait.HttpBody.html#method.size_hint" class="fnname">size_hint</a>(&amp;self) -&gt; <a class="struct" href="../../hyper/body/struct.SizeHint.html" title="struct hyper::body::SizeHint">SizeHint</a></code><a class="srclink" href="../../src/hyper/body/body.rs.html#405-429" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the bounds on the remaining length of the stream. <a href="../../hyper/body/trait.HttpBody.html#method.size_hint">Read more</a></p>
</div><h4 id="method.data" class="method hidden"><code>pub fn <a href="../../hyper/body/trait.HttpBody.html#method.data" class="fnname">data</a>(&amp;mut self) -&gt; <a class="struct" href="../../http_body/next/struct.Data.html" title="struct http_body::next::Data">Data</a>&lt;'_, Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,&nbsp;</span></code><a class="srclink" href="../../src/http_body/lib.rs.html#72-77" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns future that resolves to next data chunk, if any.</p> </div><h4 id="method.data" class="method hidden"><code>pub fn <a href="../../hyper/body/trait.HttpBody.html#method.data" class="fnname">data</a>(&amp;mut self) -&gt; <a class="struct" href="../../http_body/next/struct.Data.html" title="struct http_body::next::Data">Data</a>&lt;'_, Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,&nbsp;</span></code><a class="srclink" href="../../src/http_body/lib.rs.html#82-87" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns future that resolves to next data chunk, if any.</p>
</div><h4 id="method.trailers" class="method hidden"><code>pub fn <a href="../../hyper/body/trait.HttpBody.html#method.trailers" class="fnname">trailers</a>(&amp;mut self) -&gt; <a class="struct" href="../../http_body/next/struct.Trailers.html" title="struct http_body::next::Trailers">Trailers</a>&lt;'_, Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,&nbsp;</span></code><a class="srclink" href="../../src/http_body/lib.rs.html#80-85" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns future that resolves to trailers, if any.</p> </div><h4 id="method.trailers" class="method hidden"><code>pub fn <a href="../../hyper/body/trait.HttpBody.html#method.trailers" class="fnname">trailers</a>(&amp;mut self) -&gt; <a class="struct" href="../../http_body/next/struct.Trailers.html" title="struct http_body::next::Trailers">Trailers</a>&lt;'_, Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,&nbsp;</span></code><a class="srclink" href="../../src/http_body/lib.rs.html#90-95" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns future that resolves to trailers, if any.</p>
</div><h4 id="method.map_data" class="method hidden"><code>pub fn <a href="../../hyper/body/trait.HttpBody.html#method.map_data" class="fnname">map_data</a>&lt;F, B&gt;(self, f: F) -&gt; <a class="struct" href="../../http_body/combinators/map_data/struct.MapData.html" title="struct http_body::combinators::map_data::MapData">MapData</a>&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="../../hyper/body/trait.HttpBody.html#associatedtype.Data" title="type hyper::body::HttpBody::Data">Data</a>) -&gt; B,<br>&nbsp;&nbsp;&nbsp;&nbsp;B: <a class="trait" href="../../hyper/body/trait.Buf.html" title="trait hyper::body::Buf">Buf</a>,&nbsp;</span></code><a class="srclink" href="../../src/http_body/lib.rs.html#98-105" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Maps this body's data value to a different value.</p>
</div><h4 id="method.map_err" class="method hidden"><code>pub fn <a href="../../hyper/body/trait.HttpBody.html#method.map_err" class="fnname">map_err</a>&lt;F, E&gt;(self, f: F) -&gt; <a class="struct" href="../../http_body/combinators/map_err/struct.MapErr.html" title="struct http_body::combinators::map_err::MapErr">MapErr</a>&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="../../hyper/body/trait.HttpBody.html#associatedtype.Error" title="type hyper::body::HttpBody::Error">Error</a>) -&gt; E,&nbsp;</span></code><a class="srclink" href="../../src/http_body/lib.rs.html#108-114" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Maps this body's error value to a different value.</p>
</div><h4 id="method.boxed" class="method hidden"><code>pub fn <a href="../../hyper/body/trait.HttpBody.html#method.boxed" class="fnname">boxed</a>(self) -&gt; <a class="struct" href="../../http_body/combinators/box_body/struct.BoxBody.html" title="struct http_body::combinators::box_body::BoxBody">BoxBody</a>&lt;Self::<a class="type" href="../../hyper/body/trait.HttpBody.html#associatedtype.Data" title="type hyper::body::HttpBody::Data">Data</a>, Self::<a class="type" href="../../hyper/body/trait.HttpBody.html#associatedtype.Error" title="type hyper::body::HttpBody::Error">Error</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'static,&nbsp;</span></code><a class="srclink" href="../../src/http_body/lib.rs.html#117-122" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Turn this body into a boxed trait object.</p>
</div></div><h3 id="impl-Debug" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../hyper/body/struct.Body.html" title="struct hyper::body::Body">Body</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../src/hyper/body/body.rs.html#432-450" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class="srclink" href="../../src/hyper/body/body.rs.html#433-449" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p> </div></div><h3 id="impl-Debug" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../hyper/body/struct.Body.html" title="struct hyper::body::Body">Body</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../src/hyper/body/body.rs.html#432-450" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class="srclink" href="../../src/hyper/body/body.rs.html#433-449" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id="impl-Default" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../../hyper/body/struct.Body.html" title="struct hyper::body::Body">Body</a></code><a href="#impl-Default" class="anchor"></a><a class="srclink" href="../../src/hyper/body/body.rs.html#343-349" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.default" class="method"><code>fn <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default" class="fnname">default</a>() -&gt; <a class="struct" href="../../hyper/body/struct.Body.html" title="struct hyper::body::Body">Body</a></code><a class="srclink" href="../../src/hyper/body/body.rs.html#346-348" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns <code>Body::empty()</code>.</p> </div></div><h3 id="impl-Default" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../../hyper/body/struct.Body.html" title="struct hyper::body::Body">Body</a></code><a href="#impl-Default" class="anchor"></a><a class="srclink" href="../../src/hyper/body/body.rs.html#343-349" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.default" class="method"><code>fn <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default" class="fnname">default</a>() -&gt; <a class="struct" href="../../hyper/body/struct.Body.html" title="struct hyper::body::Body">Body</a></code><a class="srclink" href="../../src/hyper/body/body.rs.html#346-348" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns <code>Body::empty()</code>.</p>
</div></div><h3 id="impl-From%3C%26%27static%20%5Bu8%5D%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;'static [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>&gt; for <a class="struct" href="../../hyper/body/struct.Body.html" title="struct hyper::body::Body">Body</a></code><a href="#impl-From%3C%26%27static%20%5Bu8%5D%3E" class="anchor"></a><a class="srclink" href="../../src/hyper/body/body.rs.html#497-502" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-2" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(slice: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;'static [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -&gt; <a class="struct" href="../../hyper/body/struct.Body.html" title="struct hyper::body::Body">Body</a></code><a class="srclink" href="../../src/hyper/body/body.rs.html#499-501" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p> </div></div><h3 id="impl-From%3C%26%27static%20%5Bu8%5D%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;'static [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>&gt; for <a class="struct" href="../../hyper/body/struct.Body.html" title="struct hyper::body::Body">Body</a></code><a href="#impl-From%3C%26%27static%20%5Bu8%5D%3E" class="anchor"></a><a class="srclink" href="../../src/hyper/body/body.rs.html#497-502" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-2" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(slice: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;'static [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -&gt; <a class="struct" href="../../hyper/body/struct.Body.html" title="struct hyper::body::Body">Body</a></code><a class="srclink" href="../../src/hyper/body/body.rs.html#499-501" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
File diff suppressed because one or more lines are too long
+5 -2
View File
@@ -19,8 +19,11 @@ applications.</p>
</div><h4 id="method.poll_trailers" class="method hidden"><code>fn <a href="../hyper/body/trait.HttpBody.html#tymethod.poll_trailers" class="fnname">poll_trailers</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../hyper/struct.HeaderMap.html" title="struct hyper::HeaderMap">HeaderMap</a>&gt;, Self::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Error" title="type hyper::body::HttpBody::Error">Error</a>&gt;&gt;</code><a class="srclink" href="../src/hyper/body/body.rs.html#362-390" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Poll for an optional <strong>single</strong> <code>HeaderMap</code> of trailers. <a href="../hyper/body/trait.HttpBody.html#tymethod.poll_trailers">Read more</a></p> </div><h4 id="method.poll_trailers" class="method hidden"><code>fn <a href="../hyper/body/trait.HttpBody.html#tymethod.poll_trailers" class="fnname">poll_trailers</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../hyper/struct.HeaderMap.html" title="struct hyper::HeaderMap">HeaderMap</a>&gt;, Self::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Error" title="type hyper::body::HttpBody::Error">Error</a>&gt;&gt;</code><a class="srclink" href="../src/hyper/body/body.rs.html#362-390" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Poll for an optional <strong>single</strong> <code>HeaderMap</code> of trailers. <a href="../hyper/body/trait.HttpBody.html#tymethod.poll_trailers">Read more</a></p>
</div><h4 id="method.is_end_stream" class="method hidden"><code>fn <a href="../hyper/body/trait.HttpBody.html#method.is_end_stream" class="fnname">is_end_stream</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../src/hyper/body/body.rs.html#392-403" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns <code>true</code> when the end of stream has been reached. <a href="../hyper/body/trait.HttpBody.html#method.is_end_stream">Read more</a></p> </div><h4 id="method.is_end_stream" class="method hidden"><code>fn <a href="../hyper/body/trait.HttpBody.html#method.is_end_stream" class="fnname">is_end_stream</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../src/hyper/body/body.rs.html#392-403" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns <code>true</code> when the end of stream has been reached. <a href="../hyper/body/trait.HttpBody.html#method.is_end_stream">Read more</a></p>
</div><h4 id="method.size_hint" class="method hidden"><code>fn <a href="../hyper/body/trait.HttpBody.html#method.size_hint" class="fnname">size_hint</a>(&amp;self) -&gt; <a class="struct" href="../hyper/body/struct.SizeHint.html" title="struct hyper::body::SizeHint">SizeHint</a></code><a class="srclink" href="../src/hyper/body/body.rs.html#405-429" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the bounds on the remaining length of the stream. <a href="../hyper/body/trait.HttpBody.html#method.size_hint">Read more</a></p> </div><h4 id="method.size_hint" class="method hidden"><code>fn <a href="../hyper/body/trait.HttpBody.html#method.size_hint" class="fnname">size_hint</a>(&amp;self) -&gt; <a class="struct" href="../hyper/body/struct.SizeHint.html" title="struct hyper::body::SizeHint">SizeHint</a></code><a class="srclink" href="../src/hyper/body/body.rs.html#405-429" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the bounds on the remaining length of the stream. <a href="../hyper/body/trait.HttpBody.html#method.size_hint">Read more</a></p>
</div><h4 id="method.data" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#method.data" class="fnname">data</a>(&amp;mut self) -&gt; <a class="struct" href="../http_body/next/struct.Data.html" title="struct http_body::next::Data">Data</a>&lt;'_, Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,&nbsp;</span></code><a class="srclink" href="../src/http_body/lib.rs.html#72-77" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns future that resolves to next data chunk, if any.</p> </div><h4 id="method.data" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#method.data" class="fnname">data</a>(&amp;mut self) -&gt; <a class="struct" href="../http_body/next/struct.Data.html" title="struct http_body::next::Data">Data</a>&lt;'_, Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,&nbsp;</span></code><a class="srclink" href="../src/http_body/lib.rs.html#82-87" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns future that resolves to next data chunk, if any.</p>
</div><h4 id="method.trailers" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#method.trailers" class="fnname">trailers</a>(&amp;mut self) -&gt; <a class="struct" href="../http_body/next/struct.Trailers.html" title="struct http_body::next::Trailers">Trailers</a>&lt;'_, Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,&nbsp;</span></code><a class="srclink" href="../src/http_body/lib.rs.html#80-85" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns future that resolves to trailers, if any.</p> </div><h4 id="method.trailers" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#method.trailers" class="fnname">trailers</a>(&amp;mut self) -&gt; <a class="struct" href="../http_body/next/struct.Trailers.html" title="struct http_body::next::Trailers">Trailers</a>&lt;'_, Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,&nbsp;</span></code><a class="srclink" href="../src/http_body/lib.rs.html#90-95" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns future that resolves to trailers, if any.</p>
</div><h4 id="method.map_data" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#method.map_data" class="fnname">map_data</a>&lt;F, B&gt;(self, f: F) -&gt; <a class="struct" href="../http_body/combinators/map_data/struct.MapData.html" title="struct http_body::combinators::map_data::MapData">MapData</a>&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Data" title="type hyper::body::HttpBody::Data">Data</a>) -&gt; B,<br>&nbsp;&nbsp;&nbsp;&nbsp;B: <a class="trait" href="../hyper/body/trait.Buf.html" title="trait hyper::body::Buf">Buf</a>,&nbsp;</span></code><a class="srclink" href="../src/http_body/lib.rs.html#98-105" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Maps this body's data value to a different value.</p>
</div><h4 id="method.map_err" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#method.map_err" class="fnname">map_err</a>&lt;F, E&gt;(self, f: F) -&gt; <a class="struct" href="../http_body/combinators/map_err/struct.MapErr.html" title="struct http_body::combinators::map_err::MapErr">MapErr</a>&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Error" title="type hyper::body::HttpBody::Error">Error</a>) -&gt; E,&nbsp;</span></code><a class="srclink" href="../src/http_body/lib.rs.html#108-114" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Maps this body's error value to a different value.</p>
</div><h4 id="method.boxed" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#method.boxed" class="fnname">boxed</a>(self) -&gt; <a class="struct" href="../http_body/combinators/box_body/struct.BoxBody.html" title="struct http_body::combinators::box_body::BoxBody">BoxBody</a>&lt;Self::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Data" title="type hyper::body::HttpBody::Data">Data</a>, Self::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Error" title="type hyper::body::HttpBody::Error">Error</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'static,&nbsp;</span></code><a class="srclink" href="../src/http_body/lib.rs.html#117-122" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Turn this body into a boxed trait object.</p>
</div></div><h3 id="impl-Debug" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../hyper/body/struct.Body.html" title="struct hyper::body::Body">Body</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../src/hyper/body/body.rs.html#432-450" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class="srclink" href="../src/hyper/body/body.rs.html#433-449" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p> </div></div><h3 id="impl-Debug" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../hyper/body/struct.Body.html" title="struct hyper::body::Body">Body</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../src/hyper/body/body.rs.html#432-450" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class="srclink" href="../src/hyper/body/body.rs.html#433-449" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id="impl-Default" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../hyper/body/struct.Body.html" title="struct hyper::body::Body">Body</a></code><a href="#impl-Default" class="anchor"></a><a class="srclink" href="../src/hyper/body/body.rs.html#343-349" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.default" class="method"><code>fn <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default" class="fnname">default</a>() -&gt; <a class="struct" href="../hyper/body/struct.Body.html" title="struct hyper::body::Body">Body</a></code><a class="srclink" href="../src/hyper/body/body.rs.html#346-348" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns <code>Body::empty()</code>.</p> </div></div><h3 id="impl-Default" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../hyper/body/struct.Body.html" title="struct hyper::body::Body">Body</a></code><a href="#impl-Default" class="anchor"></a><a class="srclink" href="../src/hyper/body/body.rs.html#343-349" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.default" class="method"><code>fn <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default" class="fnname">default</a>() -&gt; <a class="struct" href="../hyper/body/struct.Body.html" title="struct hyper::body::Body">Body</a></code><a class="srclink" href="../src/hyper/body/body.rs.html#346-348" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns <code>Body::empty()</code>.</p>
</div></div><h3 id="impl-From%3C%26%27static%20%5Bu8%5D%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;'static [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>&gt; for <a class="struct" href="../hyper/body/struct.Body.html" title="struct hyper::body::Body">Body</a></code><a href="#impl-From%3C%26%27static%20%5Bu8%5D%3E" class="anchor"></a><a class="srclink" href="../src/hyper/body/body.rs.html#497-502" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-2" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(slice: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;'static [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -&gt; <a class="struct" href="../hyper/body/struct.Body.html" title="struct hyper::body::Body">Body</a></code><a class="srclink" href="../src/hyper/body/body.rs.html#499-501" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p> </div></div><h3 id="impl-From%3C%26%27static%20%5Bu8%5D%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;'static [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>&gt; for <a class="struct" href="../hyper/body/struct.Body.html" title="struct hyper::body::Body">Body</a></code><a href="#impl-From%3C%26%27static%20%5Bu8%5D%3E" class="anchor"></a><a class="srclink" href="../src/hyper/body/body.rs.html#497-502" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-2" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(slice: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;'static [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -&gt; <a class="struct" href="../hyper/body/struct.Body.html" title="struct hyper::body::Body">Body</a></code><a class="srclink" href="../src/hyper/body/body.rs.html#499-501" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
+10 -7
View File
@@ -265,14 +265,17 @@ return type of the passed in function.</p>
<span class="ident">b</span>.<span class="ident">as_bytes</span>() <span class="ident">b</span>.<span class="ident">as_bytes</span>()
}); });
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mapped_request</span>.<span class="ident">body</span>(), <span class="kw-2">&amp;</span><span class="string">&quot;some string&quot;</span>.<span class="ident">as_bytes</span>());</pre></div> <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mapped_request</span>.<span class="ident">body</span>(), <span class="kw-2">&amp;</span><span class="string">&quot;some string&quot;</span>.<span class="ident">as_bytes</span>());</pre></div>
</div></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Body" class="impl"><code class="in-band">impl&lt;B&gt; <a class="trait" href="../hyper/body/trait.HttpBody.html" title="trait hyper::body::HttpBody">Body</a> for <a class="struct" href="../hyper/struct.Request.html" title="struct hyper::Request">Request</a>&lt;B&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;B: <a class="trait" href="../hyper/body/trait.HttpBody.html" title="trait hyper::body::HttpBody">Body</a>,&nbsp;</span></code><a href="#impl-Body" class="anchor"></a><a class="srclink" href="../src/http_body/lib.rs.html#173-204" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Data" class="type"><code>type <a href="../hyper/body/trait.HttpBody.html#associatedtype.Data" class="type">Data</a> = &lt;B as <a class="trait" href="../hyper/body/trait.HttpBody.html" title="trait hyper::body::HttpBody">Body</a>&gt;::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Data" title="type hyper::body::HttpBody::Data">Data</a></code></h4><div class='docblock'><p>Values yielded by the <code>Body</code>.</p> </div></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Body" class="impl"><code class="in-band">impl&lt;B&gt; <a class="trait" href="../hyper/body/trait.HttpBody.html" title="trait hyper::body::HttpBody">Body</a> for <a class="struct" href="../hyper/struct.Request.html" title="struct hyper::Request">Request</a>&lt;B&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;B: <a class="trait" href="../hyper/body/trait.HttpBody.html" title="trait hyper::body::HttpBody">Body</a>,&nbsp;</span></code><a href="#impl-Body" class="anchor"></a><a class="srclink" href="../src/http_body/lib.rs.html#210-241" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Data" class="type"><code>type <a href="../hyper/body/trait.HttpBody.html#associatedtype.Data" class="type">Data</a> = &lt;B as <a class="trait" href="../hyper/body/trait.HttpBody.html" title="trait hyper::body::HttpBody">Body</a>&gt;::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Data" title="type hyper::body::HttpBody::Data">Data</a></code></h4><div class='docblock'><p>Values yielded by the <code>Body</code>.</p>
</div><h4 id="associatedtype.Error" class="type"><code>type <a href="../hyper/body/trait.HttpBody.html#associatedtype.Error" class="type">Error</a> = &lt;B as <a class="trait" href="../hyper/body/trait.HttpBody.html" title="trait hyper::body::HttpBody">Body</a>&gt;::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Error" title="type hyper::body::HttpBody::Error">Error</a></code></h4><div class='docblock'><p>The error type this <code>Body</code> might generate.</p> </div><h4 id="associatedtype.Error" class="type"><code>type <a href="../hyper/body/trait.HttpBody.html#associatedtype.Error" class="type">Error</a> = &lt;B as <a class="trait" href="../hyper/body/trait.HttpBody.html" title="trait hyper::body::HttpBody">Body</a>&gt;::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Error" title="type hyper::body::HttpBody::Error">Error</a></code></h4><div class='docblock'><p>The error type this <code>Body</code> might generate.</p>
</div><h4 id="method.poll_data" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#tymethod.poll_data" class="fnname">poll_data</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut <a class="struct" href="../hyper/struct.Request.html" title="struct hyper::Request">Request</a>&lt;B&gt;&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;&lt;<a class="struct" href="../hyper/struct.Request.html" title="struct hyper::Request">Request</a>&lt;B&gt; as <a class="trait" href="../hyper/body/trait.HttpBody.html" title="trait hyper::body::HttpBody">Body</a>&gt;::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Data" title="type hyper::body::HttpBody::Data">Data</a>, &lt;<a class="struct" href="../hyper/struct.Request.html" title="struct hyper::Request">Request</a>&lt;B&gt; as <a class="trait" href="../hyper/body/trait.HttpBody.html" title="trait hyper::body::HttpBody">Body</a>&gt;::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Error" title="type hyper::body::HttpBody::Error">Error</a>&gt;&gt;&gt;</code><a class="srclink" href="../src/http_body/lib.rs.html#177-185" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Attempt to pull out the next data buffer of this stream.</p> </div><h4 id="method.poll_data" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#tymethod.poll_data" class="fnname">poll_data</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut <a class="struct" href="../hyper/struct.Request.html" title="struct hyper::Request">Request</a>&lt;B&gt;&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;&lt;<a class="struct" href="../hyper/struct.Request.html" title="struct hyper::Request">Request</a>&lt;B&gt; as <a class="trait" href="../hyper/body/trait.HttpBody.html" title="trait hyper::body::HttpBody">Body</a>&gt;::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Data" title="type hyper::body::HttpBody::Data">Data</a>, &lt;<a class="struct" href="../hyper/struct.Request.html" title="struct hyper::Request">Request</a>&lt;B&gt; as <a class="trait" href="../hyper/body/trait.HttpBody.html" title="trait hyper::body::HttpBody">Body</a>&gt;::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Error" title="type hyper::body::HttpBody::Error">Error</a>&gt;&gt;&gt;</code><a class="srclink" href="../src/http_body/lib.rs.html#214-222" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Attempt to pull out the next data buffer of this stream.</p>
</div><h4 id="method.poll_trailers" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#tymethod.poll_trailers" class="fnname">poll_trailers</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut <a class="struct" href="../hyper/struct.Request.html" title="struct hyper::Request">Request</a>&lt;B&gt;&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../hyper/struct.HeaderMap.html" title="struct hyper::HeaderMap">HeaderMap</a>&lt;<a class="struct" href="../hyper/header/struct.HeaderValue.html" title="struct hyper::header::HeaderValue">HeaderValue</a>&gt;&gt;, &lt;<a class="struct" href="../hyper/struct.Request.html" title="struct hyper::Request">Request</a>&lt;B&gt; as <a class="trait" href="../hyper/body/trait.HttpBody.html" title="trait hyper::body::HttpBody">Body</a>&gt;::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Error" title="type hyper::body::HttpBody::Error">Error</a>&gt;&gt;</code><a class="srclink" href="../src/http_body/lib.rs.html#187-195" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Poll for an optional <strong>single</strong> <code>HeaderMap</code> of trailers. <a href="../hyper/body/trait.HttpBody.html#tymethod.poll_trailers">Read more</a></p> </div><h4 id="method.poll_trailers" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#tymethod.poll_trailers" class="fnname">poll_trailers</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut <a class="struct" href="../hyper/struct.Request.html" title="struct hyper::Request">Request</a>&lt;B&gt;&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../hyper/struct.HeaderMap.html" title="struct hyper::HeaderMap">HeaderMap</a>&lt;<a class="struct" href="../hyper/header/struct.HeaderValue.html" title="struct hyper::header::HeaderValue">HeaderValue</a>&gt;&gt;, &lt;<a class="struct" href="../hyper/struct.Request.html" title="struct hyper::Request">Request</a>&lt;B&gt; as <a class="trait" href="../hyper/body/trait.HttpBody.html" title="trait hyper::body::HttpBody">Body</a>&gt;::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Error" title="type hyper::body::HttpBody::Error">Error</a>&gt;&gt;</code><a class="srclink" href="../src/http_body/lib.rs.html#224-232" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Poll for an optional <strong>single</strong> <code>HeaderMap</code> of trailers. <a href="../hyper/body/trait.HttpBody.html#tymethod.poll_trailers">Read more</a></p>
</div><h4 id="method.is_end_stream" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#method.is_end_stream" class="fnname">is_end_stream</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../src/http_body/lib.rs.html#197-199" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns <code>true</code> when the end of stream has been reached. <a href="../hyper/body/trait.HttpBody.html#method.is_end_stream">Read more</a></p> </div><h4 id="method.is_end_stream" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#method.is_end_stream" class="fnname">is_end_stream</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../src/http_body/lib.rs.html#234-236" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns <code>true</code> when the end of stream has been reached. <a href="../hyper/body/trait.HttpBody.html#method.is_end_stream">Read more</a></p>
</div><h4 id="method.size_hint" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#method.size_hint" class="fnname">size_hint</a>(&amp;self) -&gt; <a class="struct" href="../hyper/body/struct.SizeHint.html" title="struct hyper::body::SizeHint">SizeHint</a></code><a class="srclink" href="../src/http_body/lib.rs.html#201-203" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the bounds on the remaining length of the stream. <a href="../hyper/body/trait.HttpBody.html#method.size_hint">Read more</a></p> </div><h4 id="method.size_hint" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#method.size_hint" class="fnname">size_hint</a>(&amp;self) -&gt; <a class="struct" href="../hyper/body/struct.SizeHint.html" title="struct hyper::body::SizeHint">SizeHint</a></code><a class="srclink" href="../src/http_body/lib.rs.html#238-240" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the bounds on the remaining length of the stream. <a href="../hyper/body/trait.HttpBody.html#method.size_hint">Read more</a></p>
</div><h4 id="method.data" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#method.data" class="fnname">data</a>(&amp;mut self) -&gt; <a class="struct" href="../http_body/next/struct.Data.html" title="struct http_body::next::Data">Data</a>&lt;'_, Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,&nbsp;</span></code><a class="srclink" href="../src/http_body/lib.rs.html#72-77" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns future that resolves to next data chunk, if any.</p> </div><h4 id="method.data" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#method.data" class="fnname">data</a>(&amp;mut self) -&gt; <a class="struct" href="../http_body/next/struct.Data.html" title="struct http_body::next::Data">Data</a>&lt;'_, Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,&nbsp;</span></code><a class="srclink" href="../src/http_body/lib.rs.html#82-87" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns future that resolves to next data chunk, if any.</p>
</div><h4 id="method.trailers" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#method.trailers" class="fnname">trailers</a>(&amp;mut self) -&gt; <a class="struct" href="../http_body/next/struct.Trailers.html" title="struct http_body::next::Trailers">Trailers</a>&lt;'_, Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,&nbsp;</span></code><a class="srclink" href="../src/http_body/lib.rs.html#80-85" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns future that resolves to trailers, if any.</p> </div><h4 id="method.trailers" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#method.trailers" class="fnname">trailers</a>(&amp;mut self) -&gt; <a class="struct" href="../http_body/next/struct.Trailers.html" title="struct http_body::next::Trailers">Trailers</a>&lt;'_, Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,&nbsp;</span></code><a class="srclink" href="../src/http_body/lib.rs.html#90-95" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns future that resolves to trailers, if any.</p>
</div><h4 id="method.map_data" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#method.map_data" class="fnname">map_data</a>&lt;F, B&gt;(self, f: F) -&gt; <a class="struct" href="../http_body/combinators/map_data/struct.MapData.html" title="struct http_body::combinators::map_data::MapData">MapData</a>&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Data" title="type hyper::body::HttpBody::Data">Data</a>) -&gt; B,<br>&nbsp;&nbsp;&nbsp;&nbsp;B: <a class="trait" href="../hyper/body/trait.Buf.html" title="trait hyper::body::Buf">Buf</a>,&nbsp;</span></code><a class="srclink" href="../src/http_body/lib.rs.html#98-105" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Maps this body's data value to a different value.</p>
</div><h4 id="method.map_err" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#method.map_err" class="fnname">map_err</a>&lt;F, E&gt;(self, f: F) -&gt; <a class="struct" href="../http_body/combinators/map_err/struct.MapErr.html" title="struct http_body::combinators::map_err::MapErr">MapErr</a>&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Error" title="type hyper::body::HttpBody::Error">Error</a>) -&gt; E,&nbsp;</span></code><a class="srclink" href="../src/http_body/lib.rs.html#108-114" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Maps this body's error value to a different value.</p>
</div><h4 id="method.boxed" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#method.boxed" class="fnname">boxed</a>(self) -&gt; <a class="struct" href="../http_body/combinators/box_body/struct.BoxBody.html" title="struct http_body::combinators::box_body::BoxBody">BoxBody</a>&lt;Self::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Data" title="type hyper::body::HttpBody::Data">Data</a>, Self::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Error" title="type hyper::body::HttpBody::Error">Error</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'static,&nbsp;</span></code><a class="srclink" href="../src/http_body/lib.rs.html#117-122" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Turn this body into a boxed trait object.</p>
</div></div><h3 id="impl-Debug" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../hyper/struct.Request.html" title="struct hyper::Request">Request</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>,&nbsp;</span></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../src/http/request.rs.html#704-715" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Error.html" title="struct core::fmt::Error">Error</a>&gt;</code><a class="srclink" href="../src/http/request.rs.html#705-714" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p> </div></div><h3 id="impl-Debug" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../hyper/struct.Request.html" title="struct hyper::Request">Request</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>,&nbsp;</span></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../src/http/request.rs.html#704-715" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Error.html" title="struct core::fmt::Error">Error</a>&gt;</code><a class="srclink" href="../src/http/request.rs.html#705-714" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id="impl-Default" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../hyper/struct.Request.html" title="struct hyper::Request">Request</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a>,&nbsp;</span></code><a href="#impl-Default" class="anchor"></a><a class="srclink" href="../src/http/request.rs.html#698-702" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.default" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default" class="fnname">default</a>() -&gt; <a class="struct" href="../hyper/struct.Request.html" title="struct hyper::Request">Request</a>&lt;T&gt;</code><a class="srclink" href="../src/http/request.rs.html#699-701" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the &quot;default value&quot; for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p> </div></div><h3 id="impl-Default" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../hyper/struct.Request.html" title="struct hyper::Request">Request</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a>,&nbsp;</span></code><a href="#impl-Default" class="anchor"></a><a class="srclink" href="../src/http/request.rs.html#698-702" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.default" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default" class="fnname">default</a>() -&gt; <a class="struct" href="../hyper/struct.Request.html" title="struct hyper::Request">Request</a>&lt;T&gt;</code><a class="srclink" href="../src/http/request.rs.html#699-701" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the &quot;default value&quot; for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
</div></div><h3 id="impl-Service%3CRequest%3CB%3E%3E" class="impl"><code class="in-band">impl&lt;C, B&gt; <a class="trait" href="../hyper/service/trait.Service.html" title="trait hyper::service::Service">Service</a>&lt;<a class="struct" href="../hyper/struct.Request.html" title="struct hyper::Request">Request</a>&lt;B&gt;&gt; for <a class="struct" href="../hyper/client/struct.Client.html" title="struct hyper::client::Client">Client</a>&lt;C, B&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;C: <a class="trait" href="../hyper/client/connect/trait.Connect.html" title="trait hyper::client::connect::Connect">Connect</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;B: <a class="trait" href="../hyper/body/trait.HttpBody.html" title="trait hyper::body::HttpBody">HttpBody</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;B::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Data" title="type hyper::body::HttpBody::Data">Data</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;B::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Error" title="type hyper::body::HttpBody::Error">Error</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">StdError</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>&gt;&gt;,&nbsp;</span></code><a href="#impl-Service%3CRequest%3CB%3E%3E" class="anchor"></a><a class="srclink" href="../src/hyper/client/client.rs.html#506-524" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Response" class="type"><code>type <a href="../hyper/service/trait.Service.html#associatedtype.Response" class="type">Response</a> = <a class="struct" href="../hyper/struct.Response.html" title="struct hyper::Response">Response</a>&lt;<a class="struct" href="../hyper/body/struct.Body.html" title="struct hyper::body::Body">Body</a>&gt;</code></h4><div class='docblock'><p>Responses given by the service.</p> </div></div><h3 id="impl-Service%3CRequest%3CB%3E%3E" class="impl"><code class="in-band">impl&lt;C, B&gt; <a class="trait" href="../hyper/service/trait.Service.html" title="trait hyper::service::Service">Service</a>&lt;<a class="struct" href="../hyper/struct.Request.html" title="struct hyper::Request">Request</a>&lt;B&gt;&gt; for <a class="struct" href="../hyper/client/struct.Client.html" title="struct hyper::client::Client">Client</a>&lt;C, B&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;C: <a class="trait" href="../hyper/client/connect/trait.Connect.html" title="trait hyper::client::connect::Connect">Connect</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;B: <a class="trait" href="../hyper/body/trait.HttpBody.html" title="trait hyper::body::HttpBody">HttpBody</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;B::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Data" title="type hyper::body::HttpBody::Data">Data</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;B::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Error" title="type hyper::body::HttpBody::Error">Error</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">StdError</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>&gt;&gt;,&nbsp;</span></code><a href="#impl-Service%3CRequest%3CB%3E%3E" class="anchor"></a><a class="srclink" href="../src/hyper/client/client.rs.html#506-524" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Response" class="type"><code>type <a href="../hyper/service/trait.Service.html#associatedtype.Response" class="type">Response</a> = <a class="struct" href="../hyper/struct.Response.html" title="struct hyper::Response">Response</a>&lt;<a class="struct" href="../hyper/body/struct.Body.html" title="struct hyper::body::Body">Body</a>&gt;</code></h4><div class='docblock'><p>Responses given by the service.</p>
+10 -7
View File
@@ -190,14 +190,17 @@ return type of the passed in function.</p>
<span class="ident">b</span>.<span class="ident">as_bytes</span>() <span class="ident">b</span>.<span class="ident">as_bytes</span>()
}); });
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mapped_response</span>.<span class="ident">body</span>(), <span class="kw-2">&amp;</span><span class="string">&quot;some string&quot;</span>.<span class="ident">as_bytes</span>());</pre></div> <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mapped_response</span>.<span class="ident">body</span>(), <span class="kw-2">&amp;</span><span class="string">&quot;some string&quot;</span>.<span class="ident">as_bytes</span>());</pre></div>
</div></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Body" class="impl"><code class="in-band">impl&lt;B&gt; <a class="trait" href="../hyper/body/trait.HttpBody.html" title="trait hyper::body::HttpBody">Body</a> for <a class="struct" href="../hyper/struct.Response.html" title="struct hyper::Response">Response</a>&lt;B&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;B: <a class="trait" href="../hyper/body/trait.HttpBody.html" title="trait hyper::body::HttpBody">Body</a>,&nbsp;</span></code><a href="#impl-Body" class="anchor"></a><a class="srclink" href="../src/http_body/lib.rs.html#206-237" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Data" class="type"><code>type <a href="../hyper/body/trait.HttpBody.html#associatedtype.Data" class="type">Data</a> = &lt;B as <a class="trait" href="../hyper/body/trait.HttpBody.html" title="trait hyper::body::HttpBody">Body</a>&gt;::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Data" title="type hyper::body::HttpBody::Data">Data</a></code></h4><div class='docblock'><p>Values yielded by the <code>Body</code>.</p> </div></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Body" class="impl"><code class="in-band">impl&lt;B&gt; <a class="trait" href="../hyper/body/trait.HttpBody.html" title="trait hyper::body::HttpBody">Body</a> for <a class="struct" href="../hyper/struct.Response.html" title="struct hyper::Response">Response</a>&lt;B&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;B: <a class="trait" href="../hyper/body/trait.HttpBody.html" title="trait hyper::body::HttpBody">Body</a>,&nbsp;</span></code><a href="#impl-Body" class="anchor"></a><a class="srclink" href="../src/http_body/lib.rs.html#243-274" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Data" class="type"><code>type <a href="../hyper/body/trait.HttpBody.html#associatedtype.Data" class="type">Data</a> = &lt;B as <a class="trait" href="../hyper/body/trait.HttpBody.html" title="trait hyper::body::HttpBody">Body</a>&gt;::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Data" title="type hyper::body::HttpBody::Data">Data</a></code></h4><div class='docblock'><p>Values yielded by the <code>Body</code>.</p>
</div><h4 id="associatedtype.Error" class="type"><code>type <a href="../hyper/body/trait.HttpBody.html#associatedtype.Error" class="type">Error</a> = &lt;B as <a class="trait" href="../hyper/body/trait.HttpBody.html" title="trait hyper::body::HttpBody">Body</a>&gt;::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Error" title="type hyper::body::HttpBody::Error">Error</a></code></h4><div class='docblock'><p>The error type this <code>Body</code> might generate.</p> </div><h4 id="associatedtype.Error" class="type"><code>type <a href="../hyper/body/trait.HttpBody.html#associatedtype.Error" class="type">Error</a> = &lt;B as <a class="trait" href="../hyper/body/trait.HttpBody.html" title="trait hyper::body::HttpBody">Body</a>&gt;::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Error" title="type hyper::body::HttpBody::Error">Error</a></code></h4><div class='docblock'><p>The error type this <code>Body</code> might generate.</p>
</div><h4 id="method.poll_data" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#tymethod.poll_data" class="fnname">poll_data</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut <a class="struct" href="../hyper/struct.Response.html" title="struct hyper::Response">Response</a>&lt;B&gt;&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;&lt;<a class="struct" href="../hyper/struct.Response.html" title="struct hyper::Response">Response</a>&lt;B&gt; as <a class="trait" href="../hyper/body/trait.HttpBody.html" title="trait hyper::body::HttpBody">Body</a>&gt;::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Data" title="type hyper::body::HttpBody::Data">Data</a>, &lt;<a class="struct" href="../hyper/struct.Response.html" title="struct hyper::Response">Response</a>&lt;B&gt; as <a class="trait" href="../hyper/body/trait.HttpBody.html" title="trait hyper::body::HttpBody">Body</a>&gt;::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Error" title="type hyper::body::HttpBody::Error">Error</a>&gt;&gt;&gt;</code><a class="srclink" href="../src/http_body/lib.rs.html#210-218" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Attempt to pull out the next data buffer of this stream.</p> </div><h4 id="method.poll_data" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#tymethod.poll_data" class="fnname">poll_data</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut <a class="struct" href="../hyper/struct.Response.html" title="struct hyper::Response">Response</a>&lt;B&gt;&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;&lt;<a class="struct" href="../hyper/struct.Response.html" title="struct hyper::Response">Response</a>&lt;B&gt; as <a class="trait" href="../hyper/body/trait.HttpBody.html" title="trait hyper::body::HttpBody">Body</a>&gt;::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Data" title="type hyper::body::HttpBody::Data">Data</a>, &lt;<a class="struct" href="../hyper/struct.Response.html" title="struct hyper::Response">Response</a>&lt;B&gt; as <a class="trait" href="../hyper/body/trait.HttpBody.html" title="trait hyper::body::HttpBody">Body</a>&gt;::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Error" title="type hyper::body::HttpBody::Error">Error</a>&gt;&gt;&gt;</code><a class="srclink" href="../src/http_body/lib.rs.html#247-255" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Attempt to pull out the next data buffer of this stream.</p>
</div><h4 id="method.poll_trailers" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#tymethod.poll_trailers" class="fnname">poll_trailers</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut <a class="struct" href="../hyper/struct.Response.html" title="struct hyper::Response">Response</a>&lt;B&gt;&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../hyper/struct.HeaderMap.html" title="struct hyper::HeaderMap">HeaderMap</a>&lt;<a class="struct" href="../hyper/header/struct.HeaderValue.html" title="struct hyper::header::HeaderValue">HeaderValue</a>&gt;&gt;, &lt;<a class="struct" href="../hyper/struct.Response.html" title="struct hyper::Response">Response</a>&lt;B&gt; as <a class="trait" href="../hyper/body/trait.HttpBody.html" title="trait hyper::body::HttpBody">Body</a>&gt;::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Error" title="type hyper::body::HttpBody::Error">Error</a>&gt;&gt;</code><a class="srclink" href="../src/http_body/lib.rs.html#220-228" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Poll for an optional <strong>single</strong> <code>HeaderMap</code> of trailers. <a href="../hyper/body/trait.HttpBody.html#tymethod.poll_trailers">Read more</a></p> </div><h4 id="method.poll_trailers" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#tymethod.poll_trailers" class="fnname">poll_trailers</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;self: <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;&amp;mut <a class="struct" href="../hyper/struct.Response.html" title="struct hyper::Response">Response</a>&lt;B&gt;&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;cx: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/task/wake/struct.Context.html" title="struct core::task::wake::Context">Context</a>&lt;'_&gt;<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/task/poll/enum.Poll.html" title="enum core::task::poll::Poll">Poll</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../hyper/struct.HeaderMap.html" title="struct hyper::HeaderMap">HeaderMap</a>&lt;<a class="struct" href="../hyper/header/struct.HeaderValue.html" title="struct hyper::header::HeaderValue">HeaderValue</a>&gt;&gt;, &lt;<a class="struct" href="../hyper/struct.Response.html" title="struct hyper::Response">Response</a>&lt;B&gt; as <a class="trait" href="../hyper/body/trait.HttpBody.html" title="trait hyper::body::HttpBody">Body</a>&gt;::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Error" title="type hyper::body::HttpBody::Error">Error</a>&gt;&gt;</code><a class="srclink" href="../src/http_body/lib.rs.html#257-265" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Poll for an optional <strong>single</strong> <code>HeaderMap</code> of trailers. <a href="../hyper/body/trait.HttpBody.html#tymethod.poll_trailers">Read more</a></p>
</div><h4 id="method.is_end_stream" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#method.is_end_stream" class="fnname">is_end_stream</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../src/http_body/lib.rs.html#230-232" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns <code>true</code> when the end of stream has been reached. <a href="../hyper/body/trait.HttpBody.html#method.is_end_stream">Read more</a></p> </div><h4 id="method.is_end_stream" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#method.is_end_stream" class="fnname">is_end_stream</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../src/http_body/lib.rs.html#267-269" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns <code>true</code> when the end of stream has been reached. <a href="../hyper/body/trait.HttpBody.html#method.is_end_stream">Read more</a></p>
</div><h4 id="method.size_hint" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#method.size_hint" class="fnname">size_hint</a>(&amp;self) -&gt; <a class="struct" href="../hyper/body/struct.SizeHint.html" title="struct hyper::body::SizeHint">SizeHint</a></code><a class="srclink" href="../src/http_body/lib.rs.html#234-236" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the bounds on the remaining length of the stream. <a href="../hyper/body/trait.HttpBody.html#method.size_hint">Read more</a></p> </div><h4 id="method.size_hint" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#method.size_hint" class="fnname">size_hint</a>(&amp;self) -&gt; <a class="struct" href="../hyper/body/struct.SizeHint.html" title="struct hyper::body::SizeHint">SizeHint</a></code><a class="srclink" href="../src/http_body/lib.rs.html#271-273" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the bounds on the remaining length of the stream. <a href="../hyper/body/trait.HttpBody.html#method.size_hint">Read more</a></p>
</div><h4 id="method.data" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#method.data" class="fnname">data</a>(&amp;mut self) -&gt; <a class="struct" href="../http_body/next/struct.Data.html" title="struct http_body::next::Data">Data</a>&lt;'_, Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,&nbsp;</span></code><a class="srclink" href="../src/http_body/lib.rs.html#72-77" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns future that resolves to next data chunk, if any.</p> </div><h4 id="method.data" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#method.data" class="fnname">data</a>(&amp;mut self) -&gt; <a class="struct" href="../http_body/next/struct.Data.html" title="struct http_body::next::Data">Data</a>&lt;'_, Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,&nbsp;</span></code><a class="srclink" href="../src/http_body/lib.rs.html#82-87" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns future that resolves to next data chunk, if any.</p>
</div><h4 id="method.trailers" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#method.trailers" class="fnname">trailers</a>(&amp;mut self) -&gt; <a class="struct" href="../http_body/next/struct.Trailers.html" title="struct http_body::next::Trailers">Trailers</a>&lt;'_, Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,&nbsp;</span></code><a class="srclink" href="../src/http_body/lib.rs.html#80-85" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns future that resolves to trailers, if any.</p> </div><h4 id="method.trailers" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#method.trailers" class="fnname">trailers</a>(&amp;mut self) -&gt; <a class="struct" href="../http_body/next/struct.Trailers.html" title="struct http_body::next::Trailers">Trailers</a>&lt;'_, Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,&nbsp;</span></code><a class="srclink" href="../src/http_body/lib.rs.html#90-95" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns future that resolves to trailers, if any.</p>
</div><h4 id="method.map_data" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#method.map_data" class="fnname">map_data</a>&lt;F, B&gt;(self, f: F) -&gt; <a class="struct" href="../http_body/combinators/map_data/struct.MapData.html" title="struct http_body::combinators::map_data::MapData">MapData</a>&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Data" title="type hyper::body::HttpBody::Data">Data</a>) -&gt; B,<br>&nbsp;&nbsp;&nbsp;&nbsp;B: <a class="trait" href="../hyper/body/trait.Buf.html" title="trait hyper::body::Buf">Buf</a>,&nbsp;</span></code><a class="srclink" href="../src/http_body/lib.rs.html#98-105" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Maps this body's data value to a different value.</p>
</div><h4 id="method.map_err" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#method.map_err" class="fnname">map_err</a>&lt;F, E&gt;(self, f: F) -&gt; <a class="struct" href="../http_body/combinators/map_err/struct.MapErr.html" title="struct http_body::combinators::map_err::MapErr">MapErr</a>&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Error" title="type hyper::body::HttpBody::Error">Error</a>) -&gt; E,&nbsp;</span></code><a class="srclink" href="../src/http_body/lib.rs.html#108-114" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Maps this body's error value to a different value.</p>
</div><h4 id="method.boxed" class="method hidden"><code>pub fn <a href="../hyper/body/trait.HttpBody.html#method.boxed" class="fnname">boxed</a>(self) -&gt; <a class="struct" href="../http_body/combinators/box_body/struct.BoxBody.html" title="struct http_body::combinators::box_body::BoxBody">BoxBody</a>&lt;Self::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Data" title="type hyper::body::HttpBody::Data">Data</a>, Self::<a class="type" href="../hyper/body/trait.HttpBody.html#associatedtype.Error" title="type hyper::body::HttpBody::Error">Error</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'static,&nbsp;</span></code><a class="srclink" href="../src/http_body/lib.rs.html#117-122" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Turn this body into a boxed trait object.</p>
</div></div><h3 id="impl-Debug" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../hyper/struct.Response.html" title="struct hyper::Response">Response</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>,&nbsp;</span></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../src/http/response.rs.html#491-501" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Error.html" title="struct core::fmt::Error">Error</a>&gt;</code><a class="srclink" href="../src/http/response.rs.html#492-500" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p> </div></div><h3 id="impl-Debug" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../hyper/struct.Response.html" title="struct hyper::Response">Response</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>,&nbsp;</span></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../src/http/response.rs.html#491-501" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Error.html" title="struct core::fmt::Error">Error</a>&gt;</code><a class="srclink" href="../src/http/response.rs.html#492-500" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id="impl-Default" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../hyper/struct.Response.html" title="struct hyper::Response">Response</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a>,&nbsp;</span></code><a href="#impl-Default" class="anchor"></a><a class="srclink" href="../src/http/response.rs.html#484-489" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.default" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default" class="fnname">default</a>() -&gt; <a class="struct" href="../hyper/struct.Response.html" title="struct hyper::Response">Response</a>&lt;T&gt;</code><a class="srclink" href="../src/http/response.rs.html#486-488" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the &quot;default value&quot; for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p> </div></div><h3 id="impl-Default" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../hyper/struct.Response.html" title="struct hyper::Response">Response</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a>,&nbsp;</span></code><a href="#impl-Default" class="anchor"></a><a class="srclink" href="../src/http/response.rs.html#484-489" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.default" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default" class="fnname">default</a>() -&gt; <a class="struct" href="../hyper/struct.Response.html" title="struct hyper::Response">Response</a>&lt;T&gt;</code><a class="srclink" href="../src/http/response.rs.html#486-488" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns the &quot;default value&quot; for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
</div></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl&lt;T&gt; !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../hyper/struct.Response.html" title="struct hyper::Response">Response</a>&lt;T&gt;</code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../src/hyper/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../hyper/struct.Response.html" title="struct hyper::Response">Response</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,&nbsp;</span></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../src/hyper/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../hyper/struct.Response.html" title="struct hyper::Response">Response</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,&nbsp;</span></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../src/hyper/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../hyper/struct.Response.html" title="struct hyper::Response">Response</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,&nbsp;</span></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../src/hyper/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl&lt;T&gt; !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../hyper/struct.Response.html" title="struct hyper::Response">Response</a>&lt;T&gt;</code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../src/hyper/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p> </div></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl&lt;T&gt; !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../hyper/struct.Response.html" title="struct hyper::Response">Response</a>&lt;T&gt;</code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../src/hyper/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../hyper/struct.Response.html" title="struct hyper::Response">Response</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,&nbsp;</span></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../src/hyper/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../hyper/struct.Response.html" title="struct hyper::Response">Response</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,&nbsp;</span></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../src/hyper/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../hyper/struct.Response.html" title="struct hyper::Response">Response</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,&nbsp;</span></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../src/hyper/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl&lt;T&gt; !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../hyper/struct.Response.html" title="struct hyper::Response">Response</a>&lt;T&gt;</code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../src/hyper/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>

Some files were not shown because too many files have changed in this diff Show More