edlang/bitflags/trait.Bits.html

7 lines
23 KiB
HTML
Raw Normal View History

<!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 bits type that can be used as storage for a flags type."><title>Bits in bitflags - 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="bitflags" 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 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" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../bitflags/index.html">bitflags</a><span class="version">2.6.0</span></h2></div><h2 class="location"><a href="#">Bits</a></h2><div class="sidebar-elems"><section><h3><a href="#required-associated-consts">Required Associated Constants</a></h3><ul class="block"><li><a href="#associatedconstant.ALL">ALL</a></li><li><a href="#associatedconstant.EMPTY">EMPTY</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-Bits-for-i128">i128</a></li><li><a href="#impl-Bits-for-i16">i16</a></li><li><a href="#impl-Bits-for-i32">i32</a></li><li><a href="#impl-Bits-for-i64">i64</a></li><li><a href="#impl-Bits-for-i8">i8</a></li><li><a href="#impl-Bits-for-isize">isize</a></li><li><a href="#impl-Bits-for-u128">u128</a></li><li><a href="#impl-Bits-for-u16">u16</a></li><li><a href="#impl-Bits-for-u32">u32</a></li><li><a href="#impl-Bits-for-u64">u64</a></li><li><a href="#impl-Bits-for-u8">u8</a></li><li><a href="#impl-Bits-for-usize">usize</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 crate bitflags</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>Trait <a href="index.html">bitflags</a>::<wbr><a class="trait" href="#">Bits</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/bitflags/traits.rs.html#320-336">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 Bits: <a class="trait" href="https://doc.rust-lang.org/1.80.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="https://doc.rust-lang.org/1.80.0/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> + <a class="trait" href="https://doc.r
const <a href="#associatedconstant.EMPTY" class="constant">EMPTY</a>: Self;
const <a href="#associatedconstant.ALL" class="constant">ALL</a>: Self;
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A bits type that can be used as storage for a flags type.</p>
</div></details><h2 id="required-associated-consts" class="section-header">Required Associated Constants<a href="#required-associated-consts" class="anchor">§</a></h2><div class="methods"><details class="toggle" open><summary><section id="associatedconstant.EMPTY" class="method"><a class="src rightside" href="../src/bitflags/traits.rs.html#332">source</a><h4 class="code-header">const <a href="#associatedconstant.EMPTY" class="constant">EMPTY</a>: Self</h4></section></summary><div class="docblock"><p>A value with all bits unset.</p>
</div></details><details class="toggle" open><summary><section id="associatedconstant.ALL" class="method"><a class="src rightside" href="../src/bitflags/traits.rs.html#335">source</a><h4 class="code-header">const <a href="#associatedconstant.ALL" class="constant">ALL</a>: Self</h4></section></summary><div class="docblock"><p>A value with all bits set.</p>
</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/1.80.0/reference/items/traits.html#object-safety">object safe</a>.</div><h2 id="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><details class="toggle implementors-toggle"><summary><section id="impl-Bits-for-i8" class="impl"><a class="src rightside" href="../src/bitflags/traits.rs.html#385-392">source</a><a href="#impl-Bits-for-i8" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Bits.html" title="trait bitflags::Bits">Bits</a> for <a class="primitive" href="https://doc.rust-lang.org/1.80.0/core/primitive.i8.html">i8</a></h3></section></summary><div class="impl-items"><section id="associatedconstant.EMPTY-1" class="associatedconstant trait-impl"><a class="src rightside" href="../src/bitflags/traits.rs.html#385-392">source</a><a href="#associatedconstant.EMPTY-1" class="anchor">§</a><h4 class="code-header">const <a href="#associatedconstant.EMPTY" class="constant">EMPTY</a>: <a class="primitive" href="https://doc.rust-lang.org/1.80.0/core/primitive.i8.html">i8</a> = 0i8</h4></section><section id="associatedconstant.ALL-1" class="associatedconstant trait-impl"><a class="src rightside" href="../src/bitflags/traits.rs.html#385-392">source</a><a href="#associatedconstant.ALL-1" class="anchor">§</a><h4 class="code-header">const <a href="#associatedconstant.ALL" class="constant">ALL</a>: <a class="primitive" href="https://doc.rust-lang.org/1.80.0/core/primitive.i8.html">i8</a> = -1i8</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Bits-for-i16" class="impl"><a class="src rightside" href="../src/bitflags/traits.rs.html#385-392">source</a><a href="#impl-Bits-for-i16" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Bits.html" title="trait bitflags::Bits">Bits</a> for <a class="primitive" href="https://doc.rust-lang.org/1.80.0/core/primitive.i16.html">i16</a></h3></section></summary><div class="impl-items"><section id="associatedconstant.EMPTY-2" class="associatedconstant trait-impl"><a class="src rightside" href="../src/bitflags/traits.rs.html#385-392">source</a><a href="#associatedconstant.EMPTY-2" class="anchor">§</a><h4 class="code-header">const <a href="#associatedconstant.EMPTY" class="constant">EMPTY</a>: <a class="primitive" href="https://doc.rust-lang.org/1.80.0/core/primitive.i16.html">i16</a> = 0i16</h4></section><section id="associatedconstant.ALL-2" class="associatedconstant trait-impl"><a class="src rightside" href="../src/bitflags/traits.rs.html#385-392">source</a><a href="#associatedconstant.ALL-2" class="anchor">§</a><h4 class="code-header">const <a href="#associatedconstant.ALL" class="constant">ALL</a>: <a class="primitive" href="https://doc.rust-lang.org/1.80.0/core/primitive.i16.html">i16</a> = -1i16</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Bits-for-i32" class="impl"><a class="src rightside" href="../src/bitflags/traits.rs.html#385-392">source</a><a href="#impl-Bits-for-i32" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Bits.html" title="trait bitflags::Bits">Bits</a> for <a class="primitive" href="https://doc.rust-lang.org/1.80.0/core/primitive.i32.html">i32</a></h3></section></summary><div class="impl-items"><section id="associatedconstant.EMPTY-3" class="associatedconstant trait-impl"><a class="src rightside" href="../src/bitflags/traits.rs.html#385-392">source</a><a href="#associatedconstant.EMPTY-3" class="anchor">§</a><h4 class="code-header">const <a href="#associatedconstant.EMPTY" class="constant">EMPTY</a>: <a class="primitive" href="https://doc.rust-lang.org/1.80.0/core/primitive.i32.html">i32</a> = 0i32</h4></section><section id="associatedconstant.ALL-3" class="associatedconstant trait-impl"><a clas