olis_string 0.1.3

Small-string optimization for Rust, aims to replace std::string::String
Documentation
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `UnsafeAssign` trait in crate `lib`."><title>UnsafeAssign in lib::unsafe_field - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-804b98a1284a310a.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="lib" data-themes="" data-resource-suffix="" data-rustdoc-version="1.76.0-nightly (f704f3b93 2023-12-19)" data-channel="nightly" data-search-js="search-2b6ce74ff89ae146.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-305769736d49e732.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-feafe1bb7466e4bd.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><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 trait"><!--[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">&#9776;</button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../lib/index.html">lib</a></h2></div><h2 class="location"><a href="#">UnsafeAssign</a></h2><div class="sidebar-elems"><section><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.get_mut">get_mut</a></li><li><a href="#tymethod.new">new</a></li><li><a href="#tymethod.set">set</a></li></ul><h3><a href="#object-safety">Object Safety</a></h3><h3><a href="#implementors">Implementors</a></h3></section><h2><a href="index.html">In lib::unsafe_field</a></h2></div></nav><div class="sidebar-resizer"></div>
    <main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../../lib/all.html" title="show sidebar"></a></div><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Trait <a href="../index.html">lib</a>::<wbr><a href="index.html">unsafe_field</a>::<wbr><a class="trait" href="#">UnsafeAssign</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../../src/lib/unsafe_field.rs.html#114-135">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><pre class="rust item-decl"><code>pub trait UnsafeAssign&lt;T&gt;<div class="where">where
    Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div>{
    // Required methods
    unsafe fn <a href="#tymethod.new" class="fn">new</a>(value: T) -&gt; Self;
<span class="item-spacer"></span>    unsafe fn <a href="#tymethod.set" class="fn">set</a>(&amp;mut self, value: T);
<span class="item-spacer"></span>    fn <a href="#tymethod.get_mut" class="fn">get_mut</a>(&amp;mut self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/ptr/non_null/struct.NonNull.html" title="struct core::ptr::non_null::NonNull">NonNull</a>&lt;T&gt;;
}</code></pre><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.new" class="method"><a class="src rightside" href="../../src/lib/unsafe_field.rs.html#122">source</a><h4 class="code-header">unsafe fn <a href="#tymethod.new" class="fn">new</a>(value: T) -&gt; Self</h4></section></summary><div class="docblock"><p>Constructs a new <a href="struct.UnsafeField.html" title="struct lib::unsafe_field::UnsafeField"><code>UnsafeField</code></a></p>
<h5 id="safety"><a href="#safety">Safety</a></h5>
<ul>
<li>must uphold all invariants of the field</li>
</ul>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.set" class="method"><a class="src rightside" href="../../src/lib/unsafe_field.rs.html#128">source</a><h4 class="code-header">unsafe fn <a href="#tymethod.set" class="fn">set</a>(&amp;mut self, value: T)</h4></section></summary><div class="docblock"><p>Sets the underyling value to <code>value</code></p>
<h5 id="safety-1"><a href="#safety-1">Safety</a></h5>
<ul>
<li>must uphold all invariants of the field</li>
</ul>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.get_mut" class="method"><a class="src rightside" href="../../src/lib/unsafe_field.rs.html#134">source</a><h4 class="code-header">fn <a href="#tymethod.get_mut" class="fn">get_mut</a>(&amp;mut self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/ptr/non_null/struct.NonNull.html" title="struct core::ptr::non_null::NonNull">NonNull</a>&lt;T&gt;</h4></section></summary><div class="docblock"><p>Gets a raw pointer to the value</p>
<h5 id="safety-2"><a href="#safety-2">Safety</a></h5>
<ul>
<li>msut uphold all invaraints when assigning the pointer</li>
</ul>
</div></details></div><h2 id="object-safety" class="section-header">Object Safety<a href="#object-safety" class="anchor">§</a></h2><div class="object-safety-info">This trait is <b>not</b> <a href="https://doc.rust-lang.org/nightly/reference/items/traits.html#object-safety">object safe</a>.</div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-UnsafeAssign%3CT%3E-for-UnsafeField%3CT,+FIELD_INDEX%3E" class="impl"><a class="src rightside" href="../../src/lib/unsafe_field.rs.html#100-112">source</a><a href="#impl-UnsafeAssign%3CT%3E-for-UnsafeField%3CT,+FIELD_INDEX%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T, const FIELD_INDEX: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>&gt; <a class="trait" href="trait.UnsafeAssign.html" title="trait lib::unsafe_field::UnsafeAssign">UnsafeAssign</a>&lt;T&gt; for <a class="struct" href="struct.UnsafeField.html" title="struct lib::unsafe_field::UnsafeField">UnsafeField</a>&lt;T, FIELD_INDEX&gt;</h3></section></div><script src="../../trait.impl/lib/unsafe_field/trait.UnsafeAssign.js" async></script></section></div></main></body></html>