<!DOCTYPE html><htmllang="en"><head><metacharset="utf-8"><metaname="viewport"content="width=device-width, initial-scale=1.0"><metaname="generator"content="rustdoc"><metaname="description"content="A structure to represent a git index"><title>Index in git2 - Rust</title><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><linkrel="stylesheet"href="../static.files/normalize-76eba96aa4d2e634.css"><linkrel="stylesheet"href="../static.files/rustdoc-5bc39a1768837dd0.css"><metaname="rustdoc-vars"data-root-path="../"data-static-root-path="../static.files/"data-current-crate="git2"data-themes=""data-resource-suffix=""data-rustdoc-version="1.77.2 (25ef9e3d8 2024-04-09)"data-channel="1.77.2"data-search-js="search-dd67cee4cfa65049.js"data-settings-js="settings-4313503d2e1961c2.js"><scriptsrc="../static.files/storage-4c98445ec4002617.js"></script><scriptdefersrc="sidebar-items.js"></script><scriptdefersrc="../static.files/main-48f368f3872407c8.js"></script><noscript><linkrel="stylesheet"href="../static.files/noscript-04d5337699b92874.css"></noscript><linkrel="alternate icon"type="image/png"href="../static.files/favicon-16x16-8b506e7a72182f1c.png"><linkrel="alternate icon"type="image/png"href="../static.files/favicon-32x32-422f7d1d52889060.png"><linkrel="icon"type="image/svg+xml"href="../static.files/favicon-2c020d218678b618.svg"></head><bodyclass="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><navclass="mobile-topbar"><buttonclass="sidebar-menu-toggle"title="show sidebar"></button></nav><navclass="sidebar"><divclass="sidebar-crate"><h2><ahref="../git2/index.html">git2</a><spanclass="version">0.18.3</span></h2></div><h2class="location"><ahref="#">Index</a></h2><divclass="sidebar-elems"><section><h3><ahref="#implementations">Methods</a></h3><ulclass="block method"><li><ahref="#method.add">add</a></li><li><ahref="#method.add_all">add_all</a></li><li><ahref="#method.add_frombuffer">add_frombuffer</a></li><li><ahref="#method.add_path">add_path</a></li><li><ahref="#method.clear">clear</a></li><li><ahref="#method.conflicts">conflicts</a></li><li><ahref="#method.find_prefix">find_prefix</a></li><li><ahref="#method.get">get</a></li><li><ahref="#method.get_path">get_path</a></li><li><ahref="#method.has_conflicts">has_conflicts</a></li><li><ahref="#method.is_empty">is_empty</a></li><li><ahref="#method.iter">iter</a></li><li><ahref="#method.len">len</a></li><li><ahref="#method.new">new</a></li><li><ahref="#method.open">open</a></li><li><ahref="#method.path">path</a></li><li><ahref="#method.read">read</a></li><li><ahref="#method.read_tree">read_tree</a></li><li><ahref="#method.remove">remove</a></li><li><ahref="#method.remove_all">remove_all</a></li><li><ahref="#method.remove_dir">remove_dir</a></li><li><ahref="#method.remove_path">remove_path</a></li><li><ahref="#method.set_version">set_version</a></li><li><ahref="#method.update_all">update_all</a></li><li><ahref="#method.version">version</a></li><li><ahref="#method.write">write</a></li><li><ahref="#method.write_tree">write_tree</a></li><li><ahref="#method.write_tree_to">write_tree_to</a></li></ul><h3><ahref="#trait-implementations">Trait Implementations</a></h3><ulclass="block trait-implementation"><li><ahref="#impl-Drop-for-Index">Drop</a></li></ul><h3><ahref="#synthetic-implementations">Auto Trait Implementations</a></h3><ulclass="
<main><divclass="width-limiter"><navclass="sub"><formclass="search-form"><span></span><divid="sidebar-button"tabindex="-1"><ahref="../git2/all.html"title="show sidebar"></a></div><inputclass="search-input"name="search"aria-label="Run search in the documentation"autocomplete="off"spellcheck="false"placeholder="Click or press ‘S’ to search, ‘?’ for more options…"type="search"><divid="help-button"tabindex="-1"><ahref="../help.html"title="help">?</a></div><divid="settings-menu"tabindex="-1"><ahref="../settings.html"title="settings"><imgwidth="22"height="22"alt="Change settings"src="../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><sectionid="main-content"class="content"><divclass="main-heading"><h1>Struct <ahref="index.html">git2</a>::<wbr><aclass="struct"href="#">Index</a><buttonid="copy-path"title="Copy item path to clipboard"><imgsrc="../static.files/clipboard-7571035ce49a181d.svg"width="19"height="18"alt="Copy item path"></button></h1><spanclass="out-of-band"><aclass="src"href="../src/git2/index.rs.html#17-19">source</a> · <buttonid="toggle-all-docs"title="collapse all docs">[<span>−</span>]</button></span></div><preclass="rust item-decl"><code>pub struct Index { <spanclass="comment">/* private fields */</span> }</code></pre><detailsclass="toggle top-doc"open><summaryclass="hideme"><span>Expand description</span></summary><divclass="docblock"><p>A structure to represent a git <ahref="http://git-scm.com/book/en/Git-Internals-Git-Objects">index</a></p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.open"class="method"><aclass="src rightside"href="../src/git2/index.rs.html#110-119">source</a><h4class="code-header">pub fn <ahref="#method.open"class="fn">open</a>(index_path: &<aclass="struct"href="https://doc.rust-lang.org/1.77.2/std/path/struct.Path.html"title="struct std::path::Path">Path</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/result/enum.Result.html"title="enum core::result::Result">Result</a><<aclass="struct"href="struct.Index.html"title="struct git2::Index">Index</a>, <aclass="struct"href="struct.Error.html"title="struct git2::Error">Error</a>></h4></section></summary><divclass="docblock"><p>Create a new bare Git index object as a memory representation of the Git
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.add"class="method"><aclass="src rightside"href="../src/git2/index.rs.html#147-185">source</a><h4class="code-header">pub fn <ahref="#method.add"class="fn">add</a>(&mut self, entry: &<aclass="struct"href="struct.IndexEntry.html"title="struct git2::IndexEntry">IndexEntry</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/result/enum.Result.html"title="enum core::result::Result">Result</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.unit.html">()</a>, <aclass="struct"href="struct.Error.html"title="struct git2::Error">Error</a>></h4></section></summary><divclass="docblock"><p>Add or update an index entry from an in-memory struct</p>
) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/result/enum.Result.html"title="enum core::result::Result">Result</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.unit.html">()</a>, <aclass="struct"href="struct.Error.html"title="struct git2::Error">Error</a>></h4></section></summary><divclass="docblock"><p>Add or update an index entry from a buffer in memory</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.add_path"class="method"><aclass="src rightside"href="../src/git2/index.rs.html#260-266">source</a><h4class="code-header">pub fn <ahref="#method.add_path"class="fn">add_path</a>(&mut self, path: &<aclass="struct"href="https://doc.rust-lang.org/1.77.2/std/path/struct.Path.html"title="struct std::path::Path">Path</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/result/enum.Result.html"title="enum core::result::Result">Result</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.unit.html">()</a>, <aclass="struct"href="struct.Error.html"title="struct git2::Error">Error</a>></h4></section></summary><divclass="docblock"><p>Add or update an index entry from a file on disk</p>
I: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/iter/traits/collect/trait.IntoIterator.html"title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = T>,</div></h4></section></summary><divclass="docblock"><p>Add or update index entries matching files in the working directory.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.clear"class="method"><aclass="src rightside"href="../src/git2/index.rs.html#345-350">source</a><h4class="code-header">pub fn <ahref="#method.clear"class="fn">clear</a>(&mut self) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/result/enum.Result.html"title="enum core::result::Result">Result</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.unit.html">()</a>, <aclass="struct"href="struct.Error.html"title="struct git2::Error">Error</a>></h4></section></summary><divclass="docblock"><p>Clear the contents (all the entries) of an index object.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.len"class="method"><aclass="src rightside"href="../src/git2/index.rs.html#353-355">source</a><h4class="code-header">pub fn <ahref="#method.len"class="fn">len</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a></h4></section></summary><divclass="docblock"><p>Get the count of entries currently in the index</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.is_empty"class="method"><aclass="src rightside"href="../src/git2/index.rs.html#358-360">source</a><h4class="code-header">pub fn <ahref="#method.is_empty"class="fn">is_empty</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.bool.html">bool</a></h4></section></summary><divclass="docblock"><p>Return <code>true</code> is there is no entry in the index</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.get"class="method"><aclass="src rightside"href="../src/git2/index.rs.html#363-372">source</a><h4class="code-header">pub fn <ahref="#method.get"class="fn">get</a>(&self, n: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="struct"href="struct.IndexEntry.html"title="struct git2::IndexEntry">IndexEntry</a>></h4></section></summary><divclass="docblock"><p>Get one of the entries in the index by its position.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.iter"class="method"><aclass="src rightside"href="../src/git2/index.rs.html#375-380">source</a><h4class="code-header">pub fn <ahref="#method.iter"class="fn">iter</a>(&self) -><aclass="struct"href="struct.IndexEntries.html"title="struct git2::IndexEntries">IndexEntries</a><'_><ahref="#"class="tooltip"data-notable-ty="IndexEntries<'_>">ⓘ</a></h4></section></summary><divclass="docblock"><p>Get an iterator over the entries in this index.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.conflicts"class="method"><aclass="src rightside"href="../src/git2/index.rs.html#383-393">source</a><h4class="code-header">pub fn <ahref="#method.conflicts"class="fn">conflicts</a>(&self) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/result/enum.Result.html"title="enum core::result::Result">Result</a><<aclass="struct"href="struct.IndexConflicts.html"title="struct git2::IndexConflicts">IndexConflicts</a><'_>, <aclass="struct"href="struct.Error.html"title="struct git2::Error">Error</a>></h4></section></summary><divclass="docblock"><p>Get an iterator over the index entries that have conflicts</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.get_path"class="method"><aclass="src rightside"href="../src/git2/index.rs.html#396-406">source</a><h4class="code-header">pub fn <ahref="#method.get_path"class="fn">get_path</a>(&self, path: &<aclass="struct"href="https://doc.rust-lang.org/1.77.2/std/path/struct.Path.html"title="struct std::path::Path">Path</a>, stage: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.i32.html">i32</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="struct"href="struct.IndexEntry.html"title="struct git2::IndexEntry">IndexEntry</a>></h4></section></summary><divclass="docblock"><p>Get one of the entries in the index by its path.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.has_conflicts"class="method"><aclass="src rightside"href="../src/git2/index.rs.html#411-413">source</a><h4class="code-header">pub fn <ahref="#method.has_conflicts"class="fn">has_conflicts</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.bool.html">bool</a></h4></section></summary><divclass="docblock"><p>Does this index have conflicts?</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.path"class="method"><aclass="src rightside"href="../src/git2/index.rs.html#418-420">source</a><h4class="code-header">pub fn <ahref="#method.path"class="fn">path</a>(&self) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/option/enum.Option.html"title="enum core::option::Option">Option</a><&<aclass="struct"href="https://doc.rust-lang.org/1.77.2/std/path/struct.Path.html"title="struct std::path::Path">Path</a>></h4></section></summary><divclass="docblock"><p>Get the full path to the index file on disk.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.read"class="method"><aclass="src rightside"href="../src/git2/index.rs.html#433-438">source</a><h4class="code-header">pub fn <ahref="#method.read"class="fn">read</a>(&mut self, force: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.bool.html">bool</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/result/enum.Result.html"title="enum core::result::Result">Result</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.unit.html">()</a>, <aclass="struct"href="struct.Error.html"title="struct git2::Error">Error</a>></h4></section></summary><divclass="docblock"><p>Update the contents of an existing index object in memory by reading
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.read_tree"class="method"><aclass="src rightside"href="../src/git2/index.rs.html#443-448">source</a><h4class="code-header">pub fn <ahref="#method.read_tree"class="fn">read_tree</a>(&mut self, tree: &<aclass="struct"href="struct.Tree.html"title="struct git2::Tree">Tree</a><'_>) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/result/enum.Result.html"title="enum core::result::Result">Result</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.unit.html">()</a>, <aclass="struct"href="struct.Error.html"title="struct git2::Error">Error</a>></h4></section></summary><divclass="docblock"><p>Read a tree into the index file with stats</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.remove"class="method"><aclass="src rightside"href="../src/git2/index.rs.html#451-457">source</a><h4class="code-header">pub fn <ahref="#method.remove"class="fn">remove</a>(&mut self, path: &<aclass="struct"href="https://doc.rust-lang.org/1.77.2/std/path/struct.Path.html"title="struct std::path::Path">Path</a>, stage: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.i32.html">i32</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/result/enum.Result.html"title="enum core::result::Result">Result</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.unit.html">()</a>, <aclass="struct"href="struct.Error.html"title="struct git2::Error">Error</a>></h4></section></summary><divclass="docblock"><p>Remove an entry from the index</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.remove_path"class="method"><aclass="src rightside"href="../src/git2/index.rs.html#467-473">source</a><h4class="code-header">pub fn <ahref="#method.remove_path"class="fn">remove_path</a>(&mut self, path: &<aclass="struct"href="https://doc.rust-lang.org/1.77.2/std/path/struct.Path.html"title="struct std::path::Path">Path</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/result/enum.Result.html"title="enum core::result::Result">Result</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.unit.html">()</a>, <aclass="struct"href="struct.Error.html"title="struct git2::Error">Error</a>></h4></section></summary><divclass="docblock"><p>Remove an index entry corresponding to a file on disk.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.remove_dir"class="method"><aclass="src rightside"href="../src/git2/index.rs.html#476-486">source</a><h4class="code-header">pub fn <ahref="#method.remove_dir"class="fn">remove_dir</a>(&mut self, path: &<aclass="struct"href="https://doc.rust-lang.org/1.77.2/std/path/struct.Path.html"title="struct std::path::Path">Path</a>, stage: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.i32.html">i32</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/result/enum.Result.html"title="enum core::result::Result">Result</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.unit.html">()</a>, <aclass="struct"href="struct.Error.html"title="struct git2::Error">Error</a>></h4></section></summary><divclass="docblock"><p>Remove all entries from the index under a given directory.</p>
I: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/iter/traits/collect/trait.IntoIterator.html"title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = T>,</div></h4></section></summary><divclass="docblock"><p>Remove all matching index entries.</p>
I: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/iter/traits/collect/trait.IntoIterator.html"title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = T>,</div></h4></section></summary><divclass="docblock"><p>Update all index entries to match the working directory</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.write"class="method"><aclass="src rightside"href="../src/git2/index.rs.html#558-563">source</a><h4class="code-header">pub fn <ahref="#method.write"class="fn">write</a>(&mut self) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/result/enum.Result.html"title="enum core::result::Result">Result</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.unit.html">()</a>, <aclass="struct"href="struct.Error.html"title="struct git2::Error">Error</a>></h4></section></summary><divclass="docblock"><p>Write an existing index object from memory back to disk using an atomic
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.write_tree"class="method"><aclass="src rightside"href="../src/git2/index.rs.html#576-584">source</a><h4class="code-header">pub fn <ahref="#method.write_tree"class="fn">write_tree</a>(&mut self) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/result/enum.Result.html"title="enum core::result::Result">Result</a><<aclass="struct"href="struct.Oid.html"title="struct git2::Oid">Oid</a>, <aclass="struct"href="struct.Error.html"title="struct git2::Error">Error</a>></h4></section></summary><divclass="docblock"><p>Write the index as a tree.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.write_tree_to"class="method"><aclass="src rightside"href="../src/git2/index.rs.html#590-598">source</a><h4class="code-header">pub fn <ahref="#method.write_tree_to"class="fn">write_tree_to</a>(&mut self, repo: &<aclass="struct"href="struct.Repository.html"title="struct git2::Repository">Repository</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/result/enum.Result.html"title="enum core::result::Result">Result</a><<aclass="struct"href="struct.Oid.html"title="struct git2::Oid">Oid</a>, <aclass="struct"href="struct.Error.html"title="struct git2::Error">Error</a>></h4></section></summary><divclass="docblock"><p>Write the index as a tree to the given repository</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.find_prefix"class="method"><aclass="src rightside"href="../src/git2/index.rs.html#603-614">source</a><h4class="code-header">pub fn <ahref="#method.find_prefix"class="fn">find_prefix</a><T: <aclass="trait"href="trait.IntoCString.html"title="trait git2::IntoCString">IntoCString</a>>(&self, prefix: T) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/result/enum.Result.html"title="enum core::result::Result">Result</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>, <aclass="struct"href="struct.Error.html"title="struct git2::Error">Error</a>></h4></section></summary><divclass="docblock"><p>Find the first position of any entries matching a prefix.</p>
<code><ahref="https://doc.rust-lang.org/1.77.2/core/convert/trait.From.html"title="trait core::convert::From">From</a><T> for U</code> chooses to do.</p>
</div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-TryFrom%3CU%3E-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/convert/mod.rs.html#804-806">source</a><ahref="#impl-TryFrom%3CU%3E-for-T"class="anchor">§</a><h3class="code-header">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U> for T<divclass="where">where
U: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><T>,</div></h3></section></summary><divclass="impl-items"><detailsclass="toggle"open><summary><sectionid="associatedtype.Error-1"class="associatedtype trait-impl"><ahref="#associatedtype.Error-1"class="anchor">§</a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.77.2/core/convert/trait.TryFrom.html#associatedtype.Error"class="associatedtype">Error</a> = <aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/convert/enum.Infallible.html"title="enum core::convert::Infallible">Infallible</a></h4></section></summary><divclass='docblock'>The type returned in the event of a conversion error.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.try_from"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/convert/mod.rs.html#811">source</a><ahref="#method.try_from"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.2/core/convert/trait.TryFrom.html#tymethod.try_from"class="fn">try_from</a>(value: U) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/result/enum.Result.html"title="enum core::result::Result">Result</a><T, <T as <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.77.2/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><divclass='docblock'>Performs the conversion.</div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-TryInto%3CU%3E-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/convert/mod.rs.html#789-791">source</a><ahref="#impl-TryInto%3CU%3E-for-T"class="anchor">§</a><h3class="code-header">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/convert/trait.TryInto.html"title="trait core::convert::TryInto">TryInto</a><U> for T<divclass="where">where
U: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>,</div></h3></section></summary><divclass="impl-items"><detailsclass="toggle"open><summary><sectionid="associatedtype.Error"class="associatedtype trait-impl"><ahref="#associatedtype.Error"class="anchor">§</a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.77.2/core/convert/trait.TryInto.html#associatedtype.Error"class="associatedtype">Error</a> = <U as <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.77.2/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><divclass='docblock'>The type returned in the event of a conversion error.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.try_into"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/convert/mod.rs.html#796">source</a><ahref="#method.try_into"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.2/core/convert/trait.TryInto.html#tymethod.try_into"class="fn">try_into</a>(self) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/result/enum.Result.html"title="enum core::result::Result">Result</a><U, <U as <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.77.2/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><divclass='docblock'>Performs the conversion.</div></details></div></details></div><scripttype="text/json"id="notable-traits-data">{"IndexEntries<'_>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.IndexEntries.html\" title=\"struct git2::IndexEntries\">IndexEntries</a><'index></code></h3><pre><code><div class=\"where\">impl<'index> <a class=\"trait\" href=\"https://doc.rust-lang.org/1.77.2/core/iter/traits/iterator/trait.Iterator.html\" title=\"trait core::iter::traits::iterator::Iterator\">Iterator</a> for <a class=\"struct\" href=\"struct.IndexEntries.html\" title=\"struct git2::IndexEntries\">IndexEntries</a><'index></div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/1.77.2/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = <a class=\"struct\" href=\"struct.IndexEntry.html\" title=\"struct git2::IndexEntry\">IndexEntry</a>;</div>"}</script></section></div></main></body></html>