mirror of
https://github.com/edg-l/edlang.git
synced 2024-11-22 16:08:24 +00:00
174 lines
51 KiB
HTML
174 lines
51 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A structure to represent a git index"><title>Index in git2 - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-dd39b87e5fcfba68.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="git2" data-themes="" data-resource-suffix="" data-rustdoc-version="1.80.0 (051478957 2024-07-21)" data-channel="1.80.0" data-search-js="search-d52510db62a78183.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../static.files/storage-118b08c4c78b968e.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-20a3ad099b048cf2.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-df360f571f6edeae.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../git2/index.html">git2</a><span class="version">0.18.3</span></h2></div><h2 class="location"><a href="#">Index</a></h2><div class="sidebar-elems"><section><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.add">add</a></li><li><a href="#method.add_all">add_all</a></li><li><a href="#method.add_frombuffer">add_frombuffer</a></li><li><a href="#method.add_path">add_path</a></li><li><a href="#method.clear">clear</a></li><li><a href="#method.conflicts">conflicts</a></li><li><a href="#method.find_prefix">find_prefix</a></li><li><a href="#method.get">get</a></li><li><a href="#method.get_path">get_path</a></li><li><a href="#method.has_conflicts">has_conflicts</a></li><li><a href="#method.is_empty">is_empty</a></li><li><a href="#method.iter">iter</a></li><li><a href="#method.len">len</a></li><li><a href="#method.new">new</a></li><li><a href="#method.open">open</a></li><li><a href="#method.path">path</a></li><li><a href="#method.read">read</a></li><li><a href="#method.read_tree">read_tree</a></li><li><a href="#method.remove">remove</a></li><li><a href="#method.remove_all">remove_all</a></li><li><a href="#method.remove_dir">remove_dir</a></li><li><a href="#method.remove_path">remove_path</a></li><li><a href="#method.set_version">set_version</a></li><li><a href="#method.update_all">update_all</a></li><li><a href="#method.version">version</a></li><li><a href="#method.write">write</a></li><li><a href="#method.write_tree">write_tree</a></li><li><a href="#method.write_tree_to">write_tree_to</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-Drop-for-Index">Drop</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Send-for-Index">!Send</a></li><li><a href="#impl-Sync-for-Index">!Sync</a></li><li><a href="#impl-Freeze-for-Index">Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-Index">RefUnwindSafe</a></li><li><a href="#impl-Unpin-for-Index">Unpin</a></li><li><a href="#impl-UnwindSafe-for-Index">UnwindSafe</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block blanket-implementation"><li><a href="#impl-Any-for-T">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-T">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T">BorrowMut<T></a></li><li><a href="#impl-From%3CT%3E-for-T">From<T></a></li><li><a href="#impl-Into%3CU%3E-for-T">Into<U></a></li><li><a href="#impl-TryFrom%3CU%3E-for-T">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E-for-T">TryInto<U></a></li></ul></section><h2><a href="index.html">In crate git2</a></h2></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><h1>Struct <a href="index.html">git2</a>::<wbr><a class="struct" href="#">Index</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><a class="src" href="../src/git2/index.rs.html#17-19">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>pub struct Index { <span class="comment">/* private fields */</span> }</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A structure to represent a git <a href="http://git-scm.com/book/en/Git-Internals-Git-Objects">index</a></p>
|
||
</div></details><h2 id="implementations" class="section-header">Implementations<a href="#implementations" class="anchor">§</a></h2><div id="implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Index" class="impl"><a class="src rightside" href="../src/git2/index.rs.html#88-615">source</a><a href="#impl-Index" class="anchor">§</a><h3 class="code-header">impl <a class="struct" href="struct.Index.html" title="struct git2::Index">Index</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.new" class="method"><a class="src rightside" href="../src/git2/index.rs.html#93-100">source</a><h4 class="code-header">pub fn <a href="#method.new" class="fn">new</a>() -> <a class="enum" href="https://doc.rust-lang.org/1.80.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="struct.Index.html" title="struct git2::Index">Index</a>, <a class="struct" href="struct.Error.html" title="struct git2::Error">Error</a>></h4></section></summary><div class="docblock"><p>Creates a new in-memory index.</p>
|
||
<p>This index object cannot be read/written to the filesystem, but may be
|
||
used to perform in-memory index operations.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.open" class="method"><a class="src rightside" href="../src/git2/index.rs.html#110-119">source</a><h4 class="code-header">pub fn <a href="#method.open" class="fn">open</a>(index_path: &<a class="struct" href="https://doc.rust-lang.org/1.80.0/std/path/struct.Path.html" title="struct std::path::Path">Path</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.80.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="struct.Index.html" title="struct git2::Index">Index</a>, <a class="struct" href="struct.Error.html" title="struct git2::Error">Error</a>></h4></section></summary><div class="docblock"><p>Create a new bare Git index object as a memory representation of the Git
|
||
index file in ‘index_path’, without a repository to back it.</p>
|
||
<p>Since there is no ODB or working directory behind this index, any Index
|
||
methods which rely on these (e.g. add_path) will fail.</p>
|
||
<p>If you need an index attached to a repository, use the <code>index()</code> method
|
||
on <code>Repository</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.version" class="method"><a class="src rightside" href="../src/git2/index.rs.html#126-128">source</a><h4 class="code-header">pub fn <a href="#method.version" class="fn">version</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.u32.html">u32</a></h4></section></summary><div class="docblock"><p>Get index on-disk version.</p>
|
||
<p>Valid return values are 2, 3, or 4. If 3 is returned, an index
|
||
with version 2 may be written instead, if the extension data in
|
||
version 3 is not necessary.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_version" class="method"><a class="src rightside" href="../src/git2/index.rs.html#135-140">source</a><h4 class="code-header">pub fn <a href="#method.set_version" class="fn">set_version</a>(&mut self, version: <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.u32.html">u32</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.80.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.unit.html">()</a>, <a class="struct" href="struct.Error.html" title="struct git2::Error">Error</a>></h4></section></summary><div class="docblock"><p>Set index on-disk version.</p>
|
||
<p>Valid values are 2, 3, or 4. If 2 is given, git_index_write may
|
||
write an index with version 3 instead, if necessary to accurately
|
||
represent the index.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.add" class="method"><a class="src rightside" href="../src/git2/index.rs.html#147-185">source</a><h4 class="code-header">pub fn <a href="#method.add" class="fn">add</a>(&mut self, entry: &<a class="struct" href="struct.IndexEntry.html" title="struct git2::IndexEntry">IndexEntry</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.80.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.unit.html">()</a>, <a class="struct" href="struct.Error.html" title="struct git2::Error">Error</a>></h4></section></summary><div class="docblock"><p>Add or update an index entry from an in-memory struct</p>
|
||
<p>If a previous index entry exists that has the same path and stage as the
|
||
given ‘source_entry’, it will be replaced. Otherwise, the ‘source_entry’
|
||
will be added.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.add_frombuffer" class="method"><a class="src rightside" href="../src/git2/index.rs.html#204-245">source</a><h4 class="code-header">pub fn <a href="#method.add_frombuffer" class="fn">add_frombuffer</a>(
|
||
&mut self,
|
||
entry: &<a class="struct" href="struct.IndexEntry.html" title="struct git2::IndexEntry">IndexEntry</a>,
|
||
data: &[<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.u8.html">u8</a>],
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.80.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.unit.html">()</a>, <a class="struct" href="struct.Error.html" title="struct git2::Error">Error</a>></h4></section></summary><div class="docblock"><p>Add or update an index entry from a buffer in memory</p>
|
||
<p>This method will create a blob in the repository that owns the index and
|
||
then add the index entry to the index. The path of the entry represents
|
||
the position of the blob relative to the repository’s root folder.</p>
|
||
<p>If a previous index entry exists that has the same path as the given
|
||
‘entry’, it will be replaced. Otherwise, the ‘entry’ will be added.
|
||
The id and the file_size of the ‘entry’ are updated with the real value
|
||
of the blob.</p>
|
||
<p>This forces the file to be added to the index, not looking at gitignore
|
||
rules.</p>
|
||
<p>If this file currently is the result of a merge conflict, this file will
|
||
no longer be marked as conflicting. The data about the conflict will be
|
||
moved to the “resolve undo” (REUC) section.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.add_path" class="method"><a class="src rightside" href="../src/git2/index.rs.html#260-266">source</a><h4 class="code-header">pub fn <a href="#method.add_path" class="fn">add_path</a>(&mut self, path: &<a class="struct" href="https://doc.rust-lang.org/1.80.0/std/path/struct.Path.html" title="struct std::path::Path">Path</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.80.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.unit.html">()</a>, <a class="struct" href="struct.Error.html" title="struct git2::Error">Error</a>></h4></section></summary><div class="docblock"><p>Add or update an index entry from a file on disk</p>
|
||
<p>The file path must be relative to the repository’s working folder and
|
||
must be readable.</p>
|
||
<p>This method will fail in bare index instances.</p>
|
||
<p>This forces the file to be added to the index, not looking at gitignore
|
||
rules.</p>
|
||
<p>If this file currently is the result of a merge conflict, this file will
|
||
no longer be marked as conflicting. The data about the conflict will be
|
||
moved to the “resolve undo” (REUC) section.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.add_all" class="method"><a class="src rightside" href="../src/git2/index.rs.html#314-339">source</a><h4 class="code-header">pub fn <a href="#method.add_all" class="fn">add_all</a><T, I>(
|
||
&mut self,
|
||
pathspecs: I,
|
||
flag: <a class="struct" href="struct.IndexAddOption.html" title="struct git2::IndexAddOption">IndexAddOption</a>,
|
||
cb: <a class="enum" href="https://doc.rust-lang.org/1.80.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&mut <a class="type" href="type.IndexMatchedPath.html" title="type git2::IndexMatchedPath">IndexMatchedPath</a><'_>>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.80.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.unit.html">()</a>, <a class="struct" href="struct.Error.html" title="struct git2::Error">Error</a>><div class="where">where
|
||
T: <a class="trait" href="trait.IntoCString.html" title="trait git2::IntoCString">IntoCString</a>,
|
||
I: <a class="trait" href="https://doc.rust-lang.org/1.80.0/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = T>,</div></h4></section></summary><div class="docblock"><p>Add or update index entries matching files in the working directory.</p>
|
||
<p>This method will fail in bare index instances.</p>
|
||
<p>The <code>pathspecs</code> are a list of file names or shell glob patterns that
|
||
will matched against files in the repository’s working directory. Each
|
||
file that matches will be added to the index (either updating an
|
||
existing entry or adding a new entry). You can disable glob expansion
|
||
and force exact matching with the <code>AddDisablePathspecMatch</code> flag.</p>
|
||
<p>Files that are ignored will be skipped (unlike <code>add_path</code>). If a file is
|
||
already tracked in the index, then it will be updated even if it is
|
||
ignored. Pass the <code>AddForce</code> flag to skip the checking of ignore rules.</p>
|
||
<p>To emulate <code>git add -A</code> and generate an error if the pathspec contains
|
||
the exact path of an ignored file (when not using <code>AddForce</code>), add the
|
||
<code>AddCheckPathspec</code> flag. This checks that each entry in <code>pathspecs</code>
|
||
that is an exact match to a filename on disk is either not ignored or
|
||
already in the index. If this check fails, the function will return
|
||
an error.</p>
|
||
<p>To emulate <code>git add -A</code> with the “dry-run” option, just use a callback
|
||
function that always returns a positive value. See below for details.</p>
|
||
<p>If any files are currently the result of a merge conflict, those files
|
||
will no longer be marked as conflicting. The data about the conflicts
|
||
will be moved to the “resolve undo” (REUC) section.</p>
|
||
<p>If you provide a callback function, it will be invoked on each matching
|
||
item in the working directory immediately before it is added to /
|
||
updated in the index. Returning zero will add the item to the index,
|
||
greater than zero will skip the item, and less than zero will abort the
|
||
scan an return an error to the caller.</p>
|
||
<h5 id="example"><a class="doc-anchor" href="#example">§</a>Example</h5>
|
||
<p>Emulate <code>git add *</code>:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>git2::{Index, IndexAddOption, Repository};
|
||
|
||
<span class="kw">let </span>repo = Repository::open(<span class="string">"/path/to/a/repo"</span>).expect(<span class="string">"failed to open"</span>);
|
||
<span class="kw">let </span><span class="kw-2">mut </span>index = repo.index().expect(<span class="string">"cannot get the Index file"</span>);
|
||
index.add_all([<span class="string">"*"</span>].iter(), IndexAddOption::DEFAULT, <span class="prelude-val">None</span>);
|
||
index.write();</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.clear" class="method"><a class="src rightside" href="../src/git2/index.rs.html#345-350">source</a><h4 class="code-header">pub fn <a href="#method.clear" class="fn">clear</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.80.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.unit.html">()</a>, <a class="struct" href="struct.Error.html" title="struct git2::Error">Error</a>></h4></section></summary><div class="docblock"><p>Clear the contents (all the entries) of an index object.</p>
|
||
<p>This clears the index object in memory; changes must be explicitly
|
||
written to disk for them to take effect persistently via <code>write_*</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.len" class="method"><a class="src rightside" href="../src/git2/index.rs.html#353-355">source</a><h4 class="code-header">pub fn <a href="#method.len" class="fn">len</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Get the count of entries currently in the index</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.is_empty" class="method"><a class="src rightside" href="../src/git2/index.rs.html#358-360">source</a><h4 class="code-header">pub fn <a href="#method.is_empty" class="fn">is_empty</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Return <code>true</code> is there is no entry in the index</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.get" class="method"><a class="src rightside" href="../src/git2/index.rs.html#363-372">source</a><h4 class="code-header">pub fn <a href="#method.get" class="fn">get</a>(&self, n: <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.80.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="struct.IndexEntry.html" title="struct git2::IndexEntry">IndexEntry</a>></h4></section></summary><div class="docblock"><p>Get one of the entries in the index by its position.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.iter" class="method"><a class="src rightside" href="../src/git2/index.rs.html#375-380">source</a><h4 class="code-header">pub fn <a href="#method.iter" class="fn">iter</a>(&self) -> <a class="struct" href="struct.IndexEntries.html" title="struct git2::IndexEntries">IndexEntries</a><'_> <a href="#" class="tooltip" data-notable-ty="IndexEntries<'_>">ⓘ</a></h4></section></summary><div class="docblock"><p>Get an iterator over the entries in this index.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.conflicts" class="method"><a class="src rightside" href="../src/git2/index.rs.html#383-393">source</a><h4 class="code-header">pub fn <a href="#method.conflicts" class="fn">conflicts</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.80.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="struct.IndexConflicts.html" title="struct git2::IndexConflicts">IndexConflicts</a><'_>, <a class="struct" href="struct.Error.html" title="struct git2::Error">Error</a>></h4></section></summary><div class="docblock"><p>Get an iterator over the index entries that have conflicts</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.get_path" class="method"><a class="src rightside" href="../src/git2/index.rs.html#396-406">source</a><h4 class="code-header">pub fn <a href="#method.get_path" class="fn">get_path</a>(&self, path: &<a class="struct" href="https://doc.rust-lang.org/1.80.0/std/path/struct.Path.html" title="struct std::path::Path">Path</a>, stage: <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.i32.html">i32</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.80.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="struct.IndexEntry.html" title="struct git2::IndexEntry">IndexEntry</a>></h4></section></summary><div class="docblock"><p>Get one of the entries in the index by its path.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.has_conflicts" class="method"><a class="src rightside" href="../src/git2/index.rs.html#411-413">source</a><h4 class="code-header">pub fn <a href="#method.has_conflicts" class="fn">has_conflicts</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Does this index have conflicts?</p>
|
||
<p>Returns <code>true</code> if the index contains conflicts, <code>false</code> if it does not.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.path" class="method"><a class="src rightside" href="../src/git2/index.rs.html#418-420">source</a><h4 class="code-header">pub fn <a href="#method.path" class="fn">path</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.80.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="struct" href="https://doc.rust-lang.org/1.80.0/std/path/struct.Path.html" title="struct std::path::Path">Path</a>></h4></section></summary><div class="docblock"><p>Get the full path to the index file on disk.</p>
|
||
<p>Returns <code>None</code> if this is an in-memory index.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.read" class="method"><a class="src rightside" href="../src/git2/index.rs.html#433-438">source</a><h4 class="code-header">pub fn <a href="#method.read" class="fn">read</a>(&mut self, force: <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.bool.html">bool</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.80.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.unit.html">()</a>, <a class="struct" href="struct.Error.html" title="struct git2::Error">Error</a>></h4></section></summary><div class="docblock"><p>Update the contents of an existing index object in memory by reading
|
||
from the hard disk.</p>
|
||
<p>If force is true, this performs a “hard” read that discards in-memory
|
||
changes and always reloads the on-disk index data. If there is no
|
||
on-disk version, the index will be cleared.</p>
|
||
<p>If force is false, this does a “soft” read that reloads the index data
|
||
from disk only if it has changed since the last time it was loaded.
|
||
Purely in-memory index data will be untouched. Be aware: if there are
|
||
changes on disk, unwritten in-memory changes are discarded.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.read_tree" class="method"><a class="src rightside" href="../src/git2/index.rs.html#443-448">source</a><h4 class="code-header">pub fn <a href="#method.read_tree" class="fn">read_tree</a>(&mut self, tree: &<a class="struct" href="struct.Tree.html" title="struct git2::Tree">Tree</a><'_>) -> <a class="enum" href="https://doc.rust-lang.org/1.80.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.unit.html">()</a>, <a class="struct" href="struct.Error.html" title="struct git2::Error">Error</a>></h4></section></summary><div class="docblock"><p>Read a tree into the index file with stats</p>
|
||
<p>The current index contents will be replaced by the specified tree.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.remove" class="method"><a class="src rightside" href="../src/git2/index.rs.html#451-457">source</a><h4 class="code-header">pub fn <a href="#method.remove" class="fn">remove</a>(&mut self, path: &<a class="struct" href="https://doc.rust-lang.org/1.80.0/std/path/struct.Path.html" title="struct std::path::Path">Path</a>, stage: <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.i32.html">i32</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.80.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.unit.html">()</a>, <a class="struct" href="struct.Error.html" title="struct git2::Error">Error</a>></h4></section></summary><div class="docblock"><p>Remove an entry from the index</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.remove_path" class="method"><a class="src rightside" href="../src/git2/index.rs.html#467-473">source</a><h4 class="code-header">pub fn <a href="#method.remove_path" class="fn">remove_path</a>(&mut self, path: &<a class="struct" href="https://doc.rust-lang.org/1.80.0/std/path/struct.Path.html" title="struct std::path::Path">Path</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.80.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.unit.html">()</a>, <a class="struct" href="struct.Error.html" title="struct git2::Error">Error</a>></h4></section></summary><div class="docblock"><p>Remove an index entry corresponding to a file on disk.</p>
|
||
<p>The file path must be relative to the repository’s working folder. It
|
||
may exist.</p>
|
||
<p>If this file currently is the result of a merge conflict, this file will
|
||
no longer be marked as conflicting. The data about the conflict will be
|
||
moved to the “resolve undo” (REUC) section.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.remove_dir" class="method"><a class="src rightside" href="../src/git2/index.rs.html#476-486">source</a><h4 class="code-header">pub fn <a href="#method.remove_dir" class="fn">remove_dir</a>(&mut self, path: &<a class="struct" href="https://doc.rust-lang.org/1.80.0/std/path/struct.Path.html" title="struct std::path::Path">Path</a>, stage: <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.i32.html">i32</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.80.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.unit.html">()</a>, <a class="struct" href="struct.Error.html" title="struct git2::Error">Error</a>></h4></section></summary><div class="docblock"><p>Remove all entries from the index under a given directory.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.remove_all" class="method"><a class="src rightside" href="../src/git2/index.rs.html#493-516">source</a><h4 class="code-header">pub fn <a href="#method.remove_all" class="fn">remove_all</a><T, I>(
|
||
&mut self,
|
||
pathspecs: I,
|
||
cb: <a class="enum" href="https://doc.rust-lang.org/1.80.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&mut <a class="type" href="type.IndexMatchedPath.html" title="type git2::IndexMatchedPath">IndexMatchedPath</a><'_>>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.80.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.unit.html">()</a>, <a class="struct" href="struct.Error.html" title="struct git2::Error">Error</a>><div class="where">where
|
||
T: <a class="trait" href="trait.IntoCString.html" title="trait git2::IntoCString">IntoCString</a>,
|
||
I: <a class="trait" href="https://doc.rust-lang.org/1.80.0/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = T>,</div></h4></section></summary><div class="docblock"><p>Remove all matching index entries.</p>
|
||
<p>If you provide a callback function, it will be invoked on each matching
|
||
item in the index immediately before it is removed. Return 0 to remove
|
||
the item, > 0 to skip the item, and < 0 to abort the scan.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.update_all" class="method"><a class="src rightside" href="../src/git2/index.rs.html#531-554">source</a><h4 class="code-header">pub fn <a href="#method.update_all" class="fn">update_all</a><T, I>(
|
||
&mut self,
|
||
pathspecs: I,
|
||
cb: <a class="enum" href="https://doc.rust-lang.org/1.80.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&mut <a class="type" href="type.IndexMatchedPath.html" title="type git2::IndexMatchedPath">IndexMatchedPath</a><'_>>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.80.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.unit.html">()</a>, <a class="struct" href="struct.Error.html" title="struct git2::Error">Error</a>><div class="where">where
|
||
T: <a class="trait" href="trait.IntoCString.html" title="trait git2::IntoCString">IntoCString</a>,
|
||
I: <a class="trait" href="https://doc.rust-lang.org/1.80.0/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = T>,</div></h4></section></summary><div class="docblock"><p>Update all index entries to match the working directory</p>
|
||
<p>This method will fail in bare index instances.</p>
|
||
<p>This scans the existing index entries and synchronizes them with the
|
||
working directory, deleting them if the corresponding working directory
|
||
file no longer exists otherwise updating the information (including
|
||
adding the latest version of file to the ODB if needed).</p>
|
||
<p>If you provide a callback function, it will be invoked on each matching
|
||
item in the index immediately before it is updated (either refreshed or
|
||
removed depending on working directory state). Return 0 to proceed with
|
||
updating the item, > 0 to skip the item, and < 0 to abort the scan.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.write" class="method"><a class="src rightside" href="../src/git2/index.rs.html#558-563">source</a><h4 class="code-header">pub fn <a href="#method.write" class="fn">write</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.80.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.unit.html">()</a>, <a class="struct" href="struct.Error.html" title="struct git2::Error">Error</a>></h4></section></summary><div class="docblock"><p>Write an existing index object from memory back to disk using an atomic
|
||
file lock.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.write_tree" class="method"><a class="src rightside" href="../src/git2/index.rs.html#576-584">source</a><h4 class="code-header">pub fn <a href="#method.write_tree" class="fn">write_tree</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.80.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="struct.Oid.html" title="struct git2::Oid">Oid</a>, <a class="struct" href="struct.Error.html" title="struct git2::Error">Error</a>></h4></section></summary><div class="docblock"><p>Write the index as a tree.</p>
|
||
<p>This method will scan the index and write a representation of its
|
||
current state back to disk; it recursively creates tree objects for each
|
||
of the subtrees stored in the index, but only returns the OID of the
|
||
root tree. This is the OID that can be used e.g. to create a commit.</p>
|
||
<p>The index instance cannot be bare, and needs to be associated to an
|
||
existing repository.</p>
|
||
<p>The index must not contain any file in conflict.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.write_tree_to" class="method"><a class="src rightside" href="../src/git2/index.rs.html#590-598">source</a><h4 class="code-header">pub fn <a href="#method.write_tree_to" class="fn">write_tree_to</a>(&mut self, repo: &<a class="struct" href="struct.Repository.html" title="struct git2::Repository">Repository</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.80.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="struct.Oid.html" title="struct git2::Oid">Oid</a>, <a class="struct" href="struct.Error.html" title="struct git2::Error">Error</a>></h4></section></summary><div class="docblock"><p>Write the index as a tree to the given repository</p>
|
||
<p>This is the same as <code>write_tree</code> except that the destination repository
|
||
can be chosen.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.find_prefix" class="method"><a class="src rightside" href="../src/git2/index.rs.html#603-614">source</a><h4 class="code-header">pub fn <a href="#method.find_prefix" class="fn">find_prefix</a><T: <a class="trait" href="trait.IntoCString.html" title="trait git2::IntoCString">IntoCString</a>>(&self, prefix: T) -> <a class="enum" href="https://doc.rust-lang.org/1.80.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.usize.html">usize</a>, <a class="struct" href="struct.Error.html" title="struct git2::Error">Error</a>></h4></section></summary><div class="docblock"><p>Find the first position of any entries matching a prefix.</p>
|
||
<p>To find the first position of a path inside a given folder, suffix the prefix with a ‘/’.</p>
|
||
</div></details></div></details></div><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Drop-for-Index" class="impl"><a class="src rightside" href="../src/git2/index.rs.html#658-662">source</a><a href="#impl-Drop-for-Index" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.80.0/core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="struct.Index.html" title="struct git2::Index">Index</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.drop" class="method trait-impl"><a class="src rightside" href="../src/git2/index.rs.html#659-661">source</a><a href="#method.drop" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.80.0/core/ops/drop/trait.Drop.html#tymethod.drop" class="fn">drop</a>(&mut self)</h4></section></summary><div class='docblock'>Executes the destructor for this type. <a href="https://doc.rust-lang.org/1.80.0/core/ops/drop/trait.Drop.html#tymethod.drop">Read more</a></div></details></div></details></div><h2 id="synthetic-implementations" class="section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor">§</a></h2><div id="synthetic-implementations-list"><section id="impl-Freeze-for-Index" class="impl"><a href="#impl-Freeze-for-Index" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.80.0/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a> for <a class="struct" href="struct.Index.html" title="struct git2::Index">Index</a></h3></section><section id="impl-RefUnwindSafe-for-Index" class="impl"><a href="#impl-RefUnwindSafe-for-Index" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.80.0/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.Index.html" title="struct git2::Index">Index</a></h3></section><section id="impl-Send-for-Index" class="impl"><a href="#impl-Send-for-Index" class="anchor">§</a><h3 class="code-header">impl !<a class="trait" href="https://doc.rust-lang.org/1.80.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.Index.html" title="struct git2::Index">Index</a></h3></section><section id="impl-Sync-for-Index" class="impl"><a href="#impl-Sync-for-Index" class="anchor">§</a><h3 class="code-header">impl !<a class="trait" href="https://doc.rust-lang.org/1.80.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.Index.html" title="struct git2::Index">Index</a></h3></section><section id="impl-Unpin-for-Index" class="impl"><a href="#impl-Unpin-for-Index" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.80.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.Index.html" title="struct git2::Index">Index</a></h3></section><section id="impl-UnwindSafe-for-Index" class="impl"><a href="#impl-UnwindSafe-for-Index" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.80.0/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.Index.html" title="struct git2::Index">Index</a></h3></section></div><h2 id="blanket-implementations" class="section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor">§</a></h2><div id="blanket-implementations-list"><details class="toggle implementors-toggle"><summary><section id="impl-Any-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.80.0/src/core/any.rs.html#140">source</a><a href="#impl-Any-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.80.0/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T<div class="where">where
|
||
T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.80.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.80.0/src/core/any.rs.html#141">source</a><a href="#method.type_id" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.80.0/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/1.80.0/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.80.0/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.80.0/src/core/borrow.rs.html#208">source</a><a href="#impl-Borrow%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.80.0/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T<div class="where">where
|
||
T: ?<a class="trait" href="https://doc.rust-lang.org/1.80.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.80.0/src/core/borrow.rs.html#210">source</a><a href="#method.borrow" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.80.0/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&T</a></h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.80.0/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.80.0/src/core/borrow.rs.html#216">source</a><a href="#impl-BorrowMut%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.80.0/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T<div class="where">where
|
||
T: ?<a class="trait" href="https://doc.rust-lang.org/1.80.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.80.0/src/core/borrow.rs.html#217">source</a><a href="#method.borrow_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.80.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fn">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&mut T</a></h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.80.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.80.0/src/core/convert/mod.rs.html#765">source</a><a href="#impl-From%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.80.0/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.80.0/src/core/convert/mod.rs.html#768">source</a><a href="#method.from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.80.0/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(t: T) -> T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.80.0/src/core/convert/mod.rs.html#748-750">source</a><a href="#impl-Into%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.80.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T<div class="where">where
|
||
U: <a class="trait" href="https://doc.rust-lang.org/1.80.0/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.80.0/src/core/convert/mod.rs.html#758">source</a><a href="#method.into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.80.0/core/convert/trait.Into.html#tymethod.into" class="fn">into</a>(self) -> U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
|
||
<p>That is, this conversion is whatever the implementation of
|
||
<code><a href="https://doc.rust-lang.org/1.80.0/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for U</code> chooses to do.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.80.0/src/core/convert/mod.rs.html#805-807">source</a><a href="#impl-TryFrom%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.80.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T<div class="where">where
|
||
U: <a class="trait" href="https://doc.rust-lang.org/1.80.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl"><a href="#associatedtype.Error" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.80.0/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.80.0/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.80.0/src/core/convert/mod.rs.html#812">source</a><a href="#method.try_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.80.0/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/1.80.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/1.80.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.80.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.80.0/src/core/convert/mod.rs.html#790-792">source</a><a href="#impl-TryInto%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.80.0/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T<div class="where">where
|
||
U: <a class="trait" href="https://doc.rust-lang.org/1.80.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl"><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.80.0/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/1.80.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.80.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.80.0/src/core/convert/mod.rs.html#797">source</a><a href="#method.try_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.80.0/core/convert/trait.TryInto.html#tymethod.try_into" class="fn">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/1.80.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/1.80.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.80.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details></div><script type="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.80.0/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.80.0/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> |