mirror of
https://github.com/edg-l/edlang.git
synced 2024-11-22 16:08:24 +00:00
179 lines
58 KiB
HTML
179 lines
58 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 reference."><title>Reference 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="#">Reference</a></h2><div class="sidebar-elems"><section><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.delete">delete</a></li><li><a href="#method.is_branch">is_branch</a></li><li><a href="#method.is_note">is_note</a></li><li><a href="#method.is_remote">is_remote</a></li><li><a href="#method.is_tag">is_tag</a></li><li><a href="#method.is_valid_name">is_valid_name</a></li><li><a href="#method.kind">kind</a></li><li><a href="#method.name">name</a></li><li><a href="#method.name_bytes">name_bytes</a></li><li><a href="#method.normalize_name">normalize_name</a></li><li><a href="#method.peel">peel</a></li><li><a href="#method.peel_to_blob">peel_to_blob</a></li><li><a href="#method.peel_to_commit">peel_to_commit</a></li><li><a href="#method.peel_to_tag">peel_to_tag</a></li><li><a href="#method.peel_to_tree">peel_to_tree</a></li><li><a href="#method.raw">raw</a></li><li><a href="#method.rename">rename</a></li><li><a href="#method.resolve">resolve</a></li><li><a href="#method.set_target">set_target</a></li><li><a href="#method.shorthand">shorthand</a></li><li><a href="#method.shorthand_bytes">shorthand_bytes</a></li><li><a href="#method.symbolic_set_target">symbolic_set_target</a></li><li><a href="#method.symbolic_target">symbolic_target</a></li><li><a href="#method.symbolic_target_bytes">symbolic_target_bytes</a></li><li><a href="#method.target">target</a></li><li><a href="#method.target_peel">target_peel</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-Drop-for-Reference%3C'repo%3E">Drop</a></li><li><a href="#impl-Eq-for-Reference%3C'repo%3E">Eq</a></li><li><a href="#impl-Ord-for-Reference%3C'repo%3E">Ord</a></li><li><a href="#impl-PartialEq-for-Reference%3C'repo%3E">PartialEq</a></li><li><a href="#impl-PartialOrd-for-Reference%3C'repo%3E">PartialOrd</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Send-for-Reference%3C'repo%3E">!Send</a></li><li><a href="#impl-Sync-for-Reference%3C'repo%3E">!Sync</a></li><li><a href="#impl-Freeze-for-Reference%3C'repo%3E">Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-Reference%3C'repo%3E">RefUnwindSafe</a></li><li><a href="#impl-Unpin-for-Reference%3C'repo%3E">Unpin</a></li><li><a href="#impl-UnwindSafe-for-Reference%3C'repo%3E">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="#">Reference</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/reference.rs.html#30-33">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>pub struct Reference<'repo> { <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-References">reference</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-Reference%3C'repo%3E" class="impl"><a class="src rightside" href="../src/git2/reference.rs.html#46-407">source</a><a href="#impl-Reference%3C'repo%3E" class="anchor">§</a><h3 class="code-header">impl<'repo> <a class="struct" href="struct.Reference.html" title="struct git2::Reference">Reference</a><'repo></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.is_valid_name" class="method"><a class="src rightside" href="../src/git2/reference.rs.html#68-80">source</a><h4 class="code-header">pub fn <a href="#method.is_valid_name" class="fn">is_valid_name</a>(refname: &<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.str.html">str</a>) -> <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>Ensure the reference name is well-formed.</p>
|
||
<p>Validation is performed as if <a href="struct.ReferenceFormat#associatedconstant.ALLOW_ONELEVEL"><code>ReferenceFormat::ALLOW_ONELEVEL</code></a>
|
||
was given to <a href="struct.Reference#method.normalize_name"><code>Reference::normalize_name</code></a>. No normalization is
|
||
performed, however.</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>git2::Reference;
|
||
|
||
<span class="macro">assert!</span>(Reference::is_valid_name(<span class="string">"HEAD"</span>));
|
||
<span class="macro">assert!</span>(Reference::is_valid_name(<span class="string">"refs/heads/main"</span>));
|
||
|
||
<span class="comment">// But:
|
||
</span><span class="macro">assert!</span>(!Reference::is_valid_name(<span class="string">"main"</span>));
|
||
<span class="macro">assert!</span>(!Reference::is_valid_name(<span class="string">"refs/heads/*"</span>));
|
||
<span class="macro">assert!</span>(!Reference::is_valid_name(<span class="string">"foo//bar"</span>));</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.normalize_name" class="method"><a class="src rightside" href="../src/git2/reference.rs.html#154-168">source</a><h4 class="code-header">pub fn <a href="#method.normalize_name" class="fn">normalize_name</a>(
|
||
refname: &<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.str.html">str</a>,
|
||
flags: <a class="struct" href="struct.ReferenceFormat.html" title="struct git2::ReferenceFormat">ReferenceFormat</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="https://doc.rust-lang.org/1.80.0/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="struct" href="struct.Error.html" title="struct git2::Error">Error</a>></h4></section></summary><div class="docblock"><p>Normalize reference name and check validity.</p>
|
||
<p>This will normalize the reference name by collapsing runs of adjacent
|
||
slashes between name components into a single slash. It also validates
|
||
the name according to the following rules:</p>
|
||
<ol>
|
||
<li>If <a href="struct.ReferenceFormat#associatedconstant.ALLOW_ONELEVEL"><code>ReferenceFormat::ALLOW_ONELEVEL</code></a> is given, the name may
|
||
contain only capital letters and underscores, and must begin and end
|
||
with a letter. (e.g. “HEAD”, “ORIG_HEAD”).</li>
|
||
<li>The flag <a href="struct.ReferenceFormat#associatedconstant.REFSPEC_SHORTHAND"><code>ReferenceFormat::REFSPEC_SHORTHAND</code></a> has an effect
|
||
only when combined with <a href="struct.ReferenceFormat#associatedconstant.ALLOW_ONELEVEL"><code>ReferenceFormat::ALLOW_ONELEVEL</code></a>. If
|
||
it is given, “shorthand” branch names (i.e. those not prefixed by
|
||
<code>refs/</code>, but consisting of a single word without <code>/</code> separators)
|
||
become valid. For example, “main” would be accepted.</li>
|
||
<li>If <a href="struct.ReferenceFormat#associatedconstant.REFSPEC_PATTERN"><code>ReferenceFormat::REFSPEC_PATTERN</code></a> is given, the name may
|
||
contain a single <code>*</code> in place of a full pathname component (e.g.
|
||
<code>foo/*/bar</code>, <code>foo/bar*</code>).</li>
|
||
<li>Names prefixed with “refs/” can be almost anything. You must avoid
|
||
the characters ‘~’, ‘^’, ‘:’, ‘\’, ‘?’, ‘[’, and ‘*’, and the
|
||
sequences “..” and “@{” which have special meaning to revparse.</li>
|
||
</ol>
|
||
<p>If the reference passes validation, it is returned in normalized form,
|
||
otherwise an <a href="struct.Error"><code>Error</code></a> with <a href="enum.ErrorCode#variant.InvalidSpec"><code>ErrorCode::InvalidSpec</code></a> is returned.</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>git2::{Reference, ReferenceFormat};
|
||
|
||
<span class="macro">assert_eq!</span>(
|
||
Reference::normalize_name(
|
||
<span class="string">"foo//bar"</span>,
|
||
ReferenceFormat::NORMAL
|
||
)
|
||
.unwrap(),
|
||
<span class="string">"foo/bar"</span>.to_owned()
|
||
);
|
||
|
||
<span class="macro">assert_eq!</span>(
|
||
Reference::normalize_name(
|
||
<span class="string">"HEAD"</span>,
|
||
ReferenceFormat::ALLOW_ONELEVEL
|
||
)
|
||
.unwrap(),
|
||
<span class="string">"HEAD"</span>.to_owned()
|
||
);
|
||
|
||
<span class="macro">assert_eq!</span>(
|
||
Reference::normalize_name(
|
||
<span class="string">"refs/heads/*"</span>,
|
||
ReferenceFormat::REFSPEC_PATTERN
|
||
)
|
||
.unwrap(),
|
||
<span class="string">"refs/heads/*"</span>.to_owned()
|
||
);
|
||
|
||
<span class="macro">assert_eq!</span>(
|
||
Reference::normalize_name(
|
||
<span class="string">"main"</span>,
|
||
ReferenceFormat::ALLOW_ONELEVEL | ReferenceFormat::REFSPEC_SHORTHAND
|
||
)
|
||
.unwrap(),
|
||
<span class="string">"main"</span>.to_owned()
|
||
);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.raw" class="method"><a class="src rightside" href="../src/git2/reference.rs.html#171-173">source</a><h4 class="code-header">pub fn <a href="#method.raw" class="fn">raw</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.pointer.html">*mut </a><a class="enum" href="../libgit2_sys/enum.git_reference.html" title="enum libgit2_sys::git_reference">git_reference</a></h4></section></summary><div class="docblock"><p>Get access to the underlying raw pointer.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.delete" class="method"><a class="src rightside" href="../src/git2/reference.rs.html#182-187">source</a><h4 class="code-header">pub fn <a href="#method.delete" class="fn">delete</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>Delete an existing reference.</p>
|
||
<p>This method works for both direct and symbolic references. The reference
|
||
will be immediately removed on disk.</p>
|
||
<p>This function will return an error if the reference has changed from the
|
||
time it was looked up.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.is_branch" class="method"><a class="src rightside" href="../src/git2/reference.rs.html#190-192">source</a><h4 class="code-header">pub fn <a href="#method.is_branch" class="fn">is_branch</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>Check if a reference is a local branch.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.is_note" class="method"><a class="src rightside" href="../src/git2/reference.rs.html#195-197">source</a><h4 class="code-header">pub fn <a href="#method.is_note" class="fn">is_note</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>Check if a reference is a note.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.is_remote" class="method"><a class="src rightside" href="../src/git2/reference.rs.html#200-202">source</a><h4 class="code-header">pub fn <a href="#method.is_remote" class="fn">is_remote</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>Check if a reference is a remote tracking branch</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.is_tag" class="method"><a class="src rightside" href="../src/git2/reference.rs.html#205-207">source</a><h4 class="code-header">pub fn <a href="#method.is_tag" class="fn">is_tag</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>Check if a reference is a tag</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.kind" class="method"><a class="src rightside" href="../src/git2/reference.rs.html#212-214">source</a><h4 class="code-header">pub fn <a href="#method.kind" class="fn">kind</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="enum" href="enum.ReferenceType.html" title="enum git2::ReferenceType">ReferenceType</a>></h4></section></summary><div class="docblock"><p>Get the reference type of a reference.</p>
|
||
<p>If the type is unknown, then <code>None</code> is returned.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.name" class="method"><a class="src rightside" href="../src/git2/reference.rs.html#219-221">source</a><h4 class="code-header">pub fn <a href="#method.name" class="fn">name</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="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.str.html">str</a>></h4></section></summary><div class="docblock"><p>Get the full name of a reference.</p>
|
||
<p>Returns <code>None</code> if the name is not valid utf-8.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.name_bytes" class="method"><a class="src rightside" href="../src/git2/reference.rs.html#224-226">source</a><h4 class="code-header">pub fn <a href="#method.name_bytes" class="fn">name_bytes</a>(&self) -> &[<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.u8.html">u8</a>] <a href="#" class="tooltip" data-notable-ty="&[u8]">ⓘ</a></h4></section></summary><div class="docblock"><p>Get the full name of a reference.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.shorthand" class="method"><a class="src rightside" href="../src/git2/reference.rs.html#234-236">source</a><h4 class="code-header">pub fn <a href="#method.shorthand" class="fn">shorthand</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="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.str.html">str</a>></h4></section></summary><div class="docblock"><p>Get the full shorthand of a reference.</p>
|
||
<p>This will transform the reference name into a name “human-readable”
|
||
version. If no shortname is appropriate, it will return the full name.</p>
|
||
<p>Returns <code>None</code> if the shorthand is not valid utf-8.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.shorthand_bytes" class="method"><a class="src rightside" href="../src/git2/reference.rs.html#239-241">source</a><h4 class="code-header">pub fn <a href="#method.shorthand_bytes" class="fn">shorthand_bytes</a>(&self) -> &[<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.u8.html">u8</a>] <a href="#" class="tooltip" data-notable-ty="&[u8]">ⓘ</a></h4></section></summary><div class="docblock"><p>Get the full shorthand of a reference.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.target" class="method"><a class="src rightside" href="../src/git2/reference.rs.html#247-249">source</a><h4 class="code-header">pub fn <a href="#method.target" class="fn">target</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="struct.Oid.html" title="struct git2::Oid">Oid</a>></h4></section></summary><div class="docblock"><p>Get the OID pointed to by a direct reference.</p>
|
||
<p>Only available if the reference is direct (i.e. an object id reference,
|
||
not a symbolic one).</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.target_peel" class="method"><a class="src rightside" href="../src/git2/reference.rs.html#255-257">source</a><h4 class="code-header">pub fn <a href="#method.target_peel" class="fn">target_peel</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="struct.Oid.html" title="struct git2::Oid">Oid</a>></h4></section></summary><div class="docblock"><p>Return the peeled OID target of this reference.</p>
|
||
<p>This peeled OID only applies to direct references that point to a hard
|
||
Tag object: it is the result of peeling such Tag.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.symbolic_target" class="method"><a class="src rightside" href="../src/git2/reference.rs.html#263-266">source</a><h4 class="code-header">pub fn <a href="#method.symbolic_target" class="fn">symbolic_target</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="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.str.html">str</a>></h4></section></summary><div class="docblock"><p>Get full name to the reference pointed to by a symbolic reference.</p>
|
||
<p>May return <code>None</code> if the reference is either not symbolic or not a
|
||
valid utf-8 string.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.symbolic_target_bytes" class="method"><a class="src rightside" href="../src/git2/reference.rs.html#271-273">source</a><h4 class="code-header">pub fn <a href="#method.symbolic_target_bytes" class="fn">symbolic_target_bytes</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="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.u8.html">u8</a>]></h4></section></summary><div class="docblock"><p>Get full name to the reference pointed to by a symbolic reference.</p>
|
||
<p>Only available if the reference is symbolic.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.resolve" class="method"><a class="src rightside" href="../src/git2/reference.rs.html#282-288">source</a><h4 class="code-header">pub fn <a href="#method.resolve" class="fn">resolve</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.Reference.html" title="struct git2::Reference">Reference</a><'repo>, <a class="struct" href="struct.Error.html" title="struct git2::Error">Error</a>></h4></section></summary><div class="docblock"><p>Resolve a symbolic reference to a direct reference.</p>
|
||
<p>This method iteratively peels a symbolic reference until it resolves to
|
||
a direct reference to an OID.</p>
|
||
<p>If a direct reference is passed as an argument, a copy of that
|
||
reference is returned.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.peel" class="method"><a class="src rightside" href="../src/git2/reference.rs.html#294-300">source</a><h4 class="code-header">pub fn <a href="#method.peel" class="fn">peel</a>(&self, kind: <a class="enum" href="enum.ObjectType.html" title="enum git2::ObjectType">ObjectType</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.Object.html" title="struct git2::Object">Object</a><'repo>, <a class="struct" href="struct.Error.html" title="struct git2::Error">Error</a>></h4></section></summary><div class="docblock"><p>Peel a reference to an object</p>
|
||
<p>This method recursively peels the reference until it reaches
|
||
an object of the specified type.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.peel_to_blob" class="method"><a class="src rightside" href="../src/git2/reference.rs.html#306-308">source</a><h4 class="code-header">pub fn <a href="#method.peel_to_blob" class="fn">peel_to_blob</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.Blob.html" title="struct git2::Blob">Blob</a><'repo>, <a class="struct" href="struct.Error.html" title="struct git2::Error">Error</a>></h4></section></summary><div class="docblock"><p>Peel a reference to a blob</p>
|
||
<p>This method recursively peels the reference until it reaches
|
||
a blob.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.peel_to_commit" class="method"><a class="src rightside" href="../src/git2/reference.rs.html#314-318">source</a><h4 class="code-header">pub fn <a href="#method.peel_to_commit" class="fn">peel_to_commit</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.Commit.html" title="struct git2::Commit">Commit</a><'repo>, <a class="struct" href="struct.Error.html" title="struct git2::Error">Error</a>></h4></section></summary><div class="docblock"><p>Peel a reference to a commit</p>
|
||
<p>This method recursively peels the reference until it reaches
|
||
a commit.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.peel_to_tree" class="method"><a class="src rightside" href="../src/git2/reference.rs.html#324-326">source</a><h4 class="code-header">pub fn <a href="#method.peel_to_tree" class="fn">peel_to_tree</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.Tree.html" title="struct git2::Tree">Tree</a><'repo>, <a class="struct" href="struct.Error.html" title="struct git2::Error">Error</a>></h4></section></summary><div class="docblock"><p>Peel a reference to a tree</p>
|
||
<p>This method recursively peels the reference until it reaches
|
||
a tree.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.peel_to_tag" class="method"><a class="src rightside" href="../src/git2/reference.rs.html#332-334">source</a><h4 class="code-header">pub fn <a href="#method.peel_to_tag" class="fn">peel_to_tag</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.Tag.html" title="struct git2::Tag">Tag</a><'repo>, <a class="struct" href="struct.Error.html" title="struct git2::Error">Error</a>></h4></section></summary><div class="docblock"><p>Peel a reference to a tag</p>
|
||
<p>This method recursively peels the reference until it reaches
|
||
a tag.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.rename" class="method"><a class="src rightside" href="../src/git2/reference.rs.html#342-357">source</a><h4 class="code-header">pub fn <a href="#method.rename" class="fn">rename</a>(
|
||
&mut self,
|
||
new_name: &<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.str.html">str</a>,
|
||
force: <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.bool.html">bool</a>,
|
||
msg: &<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.str.html">str</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.Reference.html" title="struct git2::Reference">Reference</a><'repo>, <a class="struct" href="struct.Error.html" title="struct git2::Error">Error</a>></h4></section></summary><div class="docblock"><p>Rename an existing reference.</p>
|
||
<p>This method works for both direct and symbolic references.</p>
|
||
<p>If the force flag is not enabled, and there’s already a reference with
|
||
the given name, the renaming will fail.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_target" class="method"><a class="src rightside" href="../src/git2/reference.rs.html#365-377">source</a><h4 class="code-header">pub fn <a href="#method.set_target" class="fn">set_target</a>(
|
||
&mut self,
|
||
id: <a class="struct" href="struct.Oid.html" title="struct git2::Oid">Oid</a>,
|
||
reflog_msg: &<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.str.html">str</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.Reference.html" title="struct git2::Reference">Reference</a><'repo>, <a class="struct" href="struct.Error.html" title="struct git2::Error">Error</a>></h4></section></summary><div class="docblock"><p>Conditionally create a new reference with the same name as the given
|
||
reference but a different OID target. The reference must be a direct
|
||
reference, otherwise this will fail.</p>
|
||
<p>The new reference will be written to disk, overwriting the given
|
||
reference.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.symbolic_set_target" class="method"><a class="src rightside" href="../src/git2/reference.rs.html#392-406">source</a><h4 class="code-header">pub fn <a href="#method.symbolic_set_target" class="fn">symbolic_set_target</a>(
|
||
&mut self,
|
||
target: &<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.str.html">str</a>,
|
||
reflog_msg: &<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.str.html">str</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.Reference.html" title="struct git2::Reference">Reference</a><'repo>, <a class="struct" href="struct.Error.html" title="struct git2::Error">Error</a>></h4></section></summary><div class="docblock"><p>Create a new reference with the same name as the given reference but a
|
||
different symbolic target. The reference must be a symbolic reference,
|
||
otherwise this will fail.</p>
|
||
<p>The new reference will be written to disk, overwriting the given
|
||
reference.</p>
|
||
<p>The target name will be checked for validity. See
|
||
<a href="struct.Repository.html#method.reference_symbolic" title="method git2::Repository::reference_symbolic"><code>Repository::reference_symbolic</code></a> for rules about valid names.</p>
|
||
<p>The message for the reflog will be ignored if the reference does not
|
||
belong in the standard set (HEAD, branches and remote-tracking
|
||
branches) and it does not have a reflog.</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-Reference%3C'repo%3E" class="impl"><a class="src rightside" href="../src/git2/reference.rs.html#442-446">source</a><a href="#impl-Drop-for-Reference%3C'repo%3E" class="anchor">§</a><h3 class="code-header">impl<'repo> <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.Reference.html" title="struct git2::Reference">Reference</a><'repo></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/reference.rs.html#443-445">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><details class="toggle implementors-toggle" open><summary><section id="impl-Ord-for-Reference%3C'repo%3E" class="impl"><a class="src rightside" href="../src/git2/reference.rs.html#415-419">source</a><a href="#impl-Ord-for-Reference%3C'repo%3E" class="anchor">§</a><h3 class="code-header">impl<'repo> <a class="trait" href="https://doc.rust-lang.org/1.80.0/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="struct" href="struct.Reference.html" title="struct git2::Reference">Reference</a><'repo></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.cmp" class="method trait-impl"><a class="src rightside" href="../src/git2/reference.rs.html#416-418">source</a><a href="#method.cmp" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.80.0/core/cmp/trait.Ord.html#tymethod.cmp" class="fn">cmp</a>(&self, other: &<a class="struct" href="struct.Reference.html" title="struct git2::Reference">Reference</a><'repo>) -> <a class="enum" href="https://doc.rust-lang.org/1.80.0/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></h4></section></summary><div class='docblock'>This method returns an <a href="https://doc.rust-lang.org/1.80.0/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering"><code>Ordering</code></a> between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/1.80.0/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.max" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.21.0">1.21.0</span> · <a class="src" href="https://doc.rust-lang.org/1.80.0/src/core/cmp.rs.html#856-858">source</a></span><a href="#method.max" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.80.0/core/cmp/trait.Ord.html#method.max" class="fn">max</a>(self, other: Self) -> Self<div class="where">where
|
||
Self: <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></h4></section></summary><div class='docblock'>Compares and returns the maximum of two values. <a href="https://doc.rust-lang.org/1.80.0/core/cmp/trait.Ord.html#method.max">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.min" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.21.0">1.21.0</span> · <a class="src" href="https://doc.rust-lang.org/1.80.0/src/core/cmp.rs.html#877-879">source</a></span><a href="#method.min" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.80.0/core/cmp/trait.Ord.html#method.min" class="fn">min</a>(self, other: Self) -> Self<div class="where">where
|
||
Self: <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></h4></section></summary><div class='docblock'>Compares and returns the minimum of two values. <a href="https://doc.rust-lang.org/1.80.0/core/cmp/trait.Ord.html#method.min">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clamp" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.50.0">1.50.0</span> · <a class="src" href="https://doc.rust-lang.org/1.80.0/src/core/cmp.rs.html#903-906">source</a></span><a href="#method.clamp" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.80.0/core/cmp/trait.Ord.html#method.clamp" class="fn">clamp</a>(self, min: Self, max: Self) -> Self<div class="where">where
|
||
Self: <a class="trait" href="https://doc.rust-lang.org/1.80.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/1.80.0/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a>,</div></h4></section></summary><div class='docblock'>Restrict a value to a certain interval. <a href="https://doc.rust-lang.org/1.80.0/core/cmp/trait.Ord.html#method.clamp">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq-for-Reference%3C'repo%3E" class="impl"><a class="src rightside" href="../src/git2/reference.rs.html#421-425">source</a><a href="#impl-PartialEq-for-Reference%3C'repo%3E" class="anchor">§</a><h3 class="code-header">impl<'repo> <a class="trait" href="https://doc.rust-lang.org/1.80.0/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a> for <a class="struct" href="struct.Reference.html" title="struct git2::Reference">Reference</a><'repo></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.eq" class="method trait-impl"><a class="src rightside" href="../src/git2/reference.rs.html#422-424">source</a><a href="#method.eq" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.80.0/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&self, other: &<a class="struct" href="struct.Reference.html" title="struct git2::Reference">Reference</a><'repo>) -> <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
|
||
by <code>==</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.ne" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.80.0/src/core/cmp.rs.html#263">source</a></span><a href="#method.ne" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.80.0/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
|
||
sufficient, and should not be overridden without very good reason.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialOrd-for-Reference%3C'repo%3E" class="impl"><a class="src rightside" href="../src/git2/reference.rs.html#409-413">source</a><a href="#impl-PartialOrd-for-Reference%3C'repo%3E" class="anchor">§</a><h3 class="code-header">impl<'repo> <a class="trait" href="https://doc.rust-lang.org/1.80.0/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a> for <a class="struct" href="struct.Reference.html" title="struct git2::Reference">Reference</a><'repo></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.partial_cmp" class="method trait-impl"><a class="src rightside" href="../src/git2/reference.rs.html#410-412">source</a><a href="#method.partial_cmp" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.80.0/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp" class="fn">partial_cmp</a>(&self, other: &<a class="struct" href="struct.Reference.html" title="struct git2::Reference">Reference</a><'repo>) -> <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="enum" href="https://doc.rust-lang.org/1.80.0/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></h4></section></summary><div class='docblock'>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/1.80.0/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.lt" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.80.0/src/core/cmp.rs.html#1180">source</a></span><a href="#method.lt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.80.0/core/cmp/trait.PartialOrd.html#method.lt" class="fn">lt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/1.80.0/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.le" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.80.0/src/core/cmp.rs.html#1198">source</a></span><a href="#method.le" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.80.0/core/cmp/trait.PartialOrd.html#method.le" class="fn">le</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code>
|
||
operator. <a href="https://doc.rust-lang.org/1.80.0/core/cmp/trait.PartialOrd.html#method.le">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.gt" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.80.0/src/core/cmp.rs.html#1215">source</a></span><a href="#method.gt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.80.0/core/cmp/trait.PartialOrd.html#method.gt" class="fn">gt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a href="https://doc.rust-lang.org/1.80.0/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.ge" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.80.0/src/core/cmp.rs.html#1233">source</a></span><a href="#method.ge" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.80.0/core/cmp/trait.PartialOrd.html#method.ge" class="fn">ge</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Rhs</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code>
|
||
operator. <a href="https://doc.rust-lang.org/1.80.0/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></div></details></div></details><section id="impl-Eq-for-Reference%3C'repo%3E" class="impl"><a class="src rightside" href="../src/git2/reference.rs.html#427">source</a><a href="#impl-Eq-for-Reference%3C'repo%3E" class="anchor">§</a><h3 class="code-header">impl<'repo> <a class="trait" href="https://doc.rust-lang.org/1.80.0/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="struct.Reference.html" title="struct git2::Reference">Reference</a><'repo></h3></section></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-Reference%3C'repo%3E" class="impl"><a href="#impl-Freeze-for-Reference%3C'repo%3E" class="anchor">§</a><h3 class="code-header">impl<'repo> <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.Reference.html" title="struct git2::Reference">Reference</a><'repo></h3></section><section id="impl-RefUnwindSafe-for-Reference%3C'repo%3E" class="impl"><a href="#impl-RefUnwindSafe-for-Reference%3C'repo%3E" class="anchor">§</a><h3 class="code-header">impl<'repo> <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.Reference.html" title="struct git2::Reference">Reference</a><'repo></h3></section><section id="impl-Send-for-Reference%3C'repo%3E" class="impl"><a href="#impl-Send-for-Reference%3C'repo%3E" class="anchor">§</a><h3 class="code-header">impl<'repo> !<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.Reference.html" title="struct git2::Reference">Reference</a><'repo></h3></section><section id="impl-Sync-for-Reference%3C'repo%3E" class="impl"><a href="#impl-Sync-for-Reference%3C'repo%3E" class="anchor">§</a><h3 class="code-header">impl<'repo> !<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.Reference.html" title="struct git2::Reference">Reference</a><'repo></h3></section><section id="impl-Unpin-for-Reference%3C'repo%3E" class="impl"><a href="#impl-Unpin-for-Reference%3C'repo%3E" class="anchor">§</a><h3 class="code-header">impl<'repo> <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.Reference.html" title="struct git2::Reference">Reference</a><'repo></h3></section><section id="impl-UnwindSafe-for-Reference%3C'repo%3E" class="impl"><a href="#impl-UnwindSafe-for-Reference%3C'repo%3E" class="anchor">§</a><h3 class="code-header">impl<'repo> <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.Reference.html" title="struct git2::Reference">Reference</a><'repo></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">{"&[u8]":"<h3>Notable traits for <code>&[<a class=\"primitive\" href=\"https://doc.rust-lang.org/1.80.0/std/primitive.u8.html\">u8</a>]</code></h3><pre><code><div class=\"where\">impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.80.0/std/io/trait.Read.html\" title=\"trait std::io::Read\">Read</a> for &[<a class=\"primitive\" href=\"https://doc.rust-lang.org/1.80.0/std/primitive.u8.html\">u8</a>]</div>"}</script></section></div></main></body></html> |