Files
phy/rustix/thread/enum.Capability.html
Orion Kindel 0ce894e6b0 doc
2025-03-18 10:30:23 -05:00

220 lines
53 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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="Linux per-thread capability."><title>Capability in rustix::thread - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.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-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="rustix" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.0 (9fc6b4312 2025-01-07)" data-channel="1.84.0" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc enum"><!--[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="../../rustix/index.html">rustix</a><span class="version">0.38.37</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Capability</a></h2><h3><a href="#variants">Variants</a></h3><ul class="block variant"><li><a href="#variant.AuditControl" title="AuditControl">AuditControl</a></li><li><a href="#variant.AuditRead" title="AuditRead">AuditRead</a></li><li><a href="#variant.AuditWrite" title="AuditWrite">AuditWrite</a></li><li><a href="#variant.BerkeleyPacketFilters" title="BerkeleyPacketFilters">BerkeleyPacketFilters</a></li><li><a href="#variant.BlockSuspend" title="BlockSuspend">BlockSuspend</a></li><li><a href="#variant.ChangeOwnership" title="ChangeOwnership">ChangeOwnership</a></li><li><a href="#variant.CheckpointRestore" title="CheckpointRestore">CheckpointRestore</a></li><li><a href="#variant.DACOverride" title="DACOverride">DACOverride</a></li><li><a href="#variant.DACReadSearch" title="DACReadSearch">DACReadSearch</a></li><li><a href="#variant.FileOwner" title="FileOwner">FileOwner</a></li><li><a href="#variant.FileSetID" title="FileSetID">FileSetID</a></li><li><a href="#variant.IPCLock" title="IPCLock">IPCLock</a></li><li><a href="#variant.IPCOwner" title="IPCOwner">IPCOwner</a></li><li><a href="#variant.Kill" title="Kill">Kill</a></li><li><a href="#variant.Lease" title="Lease">Lease</a></li><li><a href="#variant.LinuxImmutable" title="LinuxImmutable">LinuxImmutable</a></li><li><a href="#variant.MACAdmin" title="MACAdmin">MACAdmin</a></li><li><a href="#variant.MACOverride" title="MACOverride">MACOverride</a></li><li><a href="#variant.MakeNode" title="MakeNode">MakeNode</a></li><li><a href="#variant.NetAdmin" title="NetAdmin">NetAdmin</a></li><li><a href="#variant.NetBindService" title="NetBindService">NetBindService</a></li><li><a href="#variant.NetBroadcast" title="NetBroadcast">NetBroadcast</a></li><li><a href="#variant.NetRaw" title="NetRaw">NetRaw</a></li><li><a href="#variant.PerformanceMonitoring" title="PerformanceMonitoring">PerformanceMonitoring</a></li><li><a href="#variant.SetFileCapabilities" title="SetFileCapabilities">SetFileCapabilities</a></li><li><a href="#variant.SetGroupID" title="SetGroupID">SetGroupID</a></li><li><a href="#variant.SetPermittedCapabilities" title="SetPermittedCapabilities">SetPermittedCapabilities</a></li><li><a href="#variant.SetUserID" title="SetUserID">SetUserID</a></li><li><a href="#variant.SystemAdmin" title="SystemAdmin">SystemAdmin</a></li><li><a href="#variant.SystemBoot" title="SystemBoot">SystemBoot</a></li><li><a href="#variant.SystemChangeRoot" title="SystemChangeRoot">SystemChangeRoot</a></li><li><a href="#variant.SystemLog" title="SystemLog">SystemLog</a></li><li><a href="#variant.SystemModule" title="SystemModule">SystemModule</a></li><li><a href="#variant.SystemNice" title="SystemNice">SystemNice</a></li><li><a href="#variant.SystemProcessAccounting" title="SystemProcessAccounting">SystemProcessAccounting</a></li><li><a href="#variant.SystemProcessTrace" title="SystemProcessTrace">SystemProcessTrace</a></li><li><a href="#variant.SystemRawIO" title="SystemRawIO">SystemRawIO</a></li><li><a href="#variant.SystemResource" title="SystemResource">SystemResource</a></li><li><a href="#variant.SystemTTYConfig" title="SystemTTYConfig">SystemTTYConfig</a></li><li><a href="#variant.SystemTime" title="SystemTime">SystemTime</a></li><li><a href="#variant.WakeAlarm" title="WakeAlarm">WakeAlarm</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-Clone-for-Capability" title="Clone">Clone</a></li><li><a href="#impl-Copy-for-Capability" title="Copy">Copy</a></li><li><a href="#impl-Debug-for-Capability" title="Debug">Debug</a></li><li><a href="#impl-Eq-for-Capability" title="Eq">Eq</a></li><li><a href="#impl-PartialEq-for-Capability" title="PartialEq">PartialEq</a></li><li><a href="#impl-StructuralPartialEq-for-Capability" title="StructuralPartialEq">StructuralPartialEq</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Freeze-for-Capability" title="Freeze">Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-Capability" title="RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send-for-Capability" title="Send">Send</a></li><li><a href="#impl-Sync-for-Capability" title="Sync">Sync</a></li><li><a href="#impl-Unpin-for-Capability" title="Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe-for-Capability" title="UnwindSafe">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" title="Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-T" title="Borrow&#60;T&#62;">Borrow&#60;T&#62;</a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T" title="BorrowMut&#60;T&#62;">BorrowMut&#60;T&#62;</a></li><li><a href="#impl-CloneToUninit-for-T" title="CloneToUninit">CloneToUninit</a></li><li><a href="#impl-From%3CT%3E-for-T" title="From&#60;T&#62;">From&#60;T&#62;</a></li><li><a href="#impl-Into%3CU%3E-for-T" title="Into&#60;U&#62;">Into&#60;U&#62;</a></li><li><a href="#impl-ToOwned-for-T" title="ToOwned">ToOwned</a></li><li><a href="#impl-TryFrom%3CU%3E-for-T" title="TryFrom&#60;U&#62;">TryFrom&#60;U&#62;</a></li><li><a href="#impl-TryInto%3CU%3E-for-T" title="TryInto&#60;U&#62;">TryInto&#60;U&#62;</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In rustix::<wbr>thread</a></h2></div></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"><span class="rustdoc-breadcrumbs"><a href="../index.html">rustix</a>::<wbr><a href="index.html">thread</a></span><h1>Enum <span class="enum">Capability</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/rustix/thread/prctl.rs.html#184-384">Source</a> </span></div><pre class="rust item-decl"><code><div class="code-attribute">#[repr(u32)]</div>pub enum Capability {
<details class="toggle type-contents-toggle"><summary class="hideme"><span>Show 41 variants</span></summary> ChangeOwnership = 0,
DACOverride = 1,
DACReadSearch = 2,
FileOwner = 3,
FileSetID = 4,
Kill = 5,
SetGroupID = 6,
SetUserID = 7,
SetPermittedCapabilities = 8,
LinuxImmutable = 9,
NetBindService = 10,
NetBroadcast = 11,
NetAdmin = 12,
NetRaw = 13,
IPCLock = 14,
IPCOwner = 15,
SystemModule = 16,
SystemRawIO = 17,
SystemChangeRoot = 18,
SystemProcessTrace = 19,
SystemProcessAccounting = 20,
SystemAdmin = 21,
SystemBoot = 22,
SystemNice = 23,
SystemResource = 24,
SystemTime = 25,
SystemTTYConfig = 26,
MakeNode = 27,
Lease = 28,
AuditWrite = 29,
AuditControl = 30,
SetFileCapabilities = 31,
MACOverride = 32,
MACAdmin = 33,
SystemLog = 34,
WakeAlarm = 35,
BlockSuspend = 36,
AuditRead = 37,
PerformanceMonitoring = 38,
BerkeleyPacketFilters = 39,
CheckpointRestore = 40,
</details>}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Linux per-thread capability.</p>
</div></details><h2 id="variants" class="variants section-header">Variants<a href="#variants" class="anchor">§</a></h2><div class="variants"><section id="variant.ChangeOwnership" class="variant"><a href="#variant.ChangeOwnership" class="anchor">§</a><h3 class="code-header">ChangeOwnership = 0</h3></section><div class="docblock"><p>In a system with the <code>_POSIX_CHOWN_RESTRICTED</code> option defined, this
overrides the restriction of changing file ownership and group
ownership.</p>
</div><section id="variant.DACOverride" class="variant"><a href="#variant.DACOverride" class="anchor">§</a><h3 class="code-header">DACOverride = 1</h3></section><div class="docblock"><p>Override all DAC access, including ACL execute access if <code>_POSIX_ACL</code>
is defined. Excluding DAC access covered by
<a href="enum.Capability.html#variant.LinuxImmutable" title="variant rustix::thread::Capability::LinuxImmutable"><code>Capability::LinuxImmutable</code></a>.</p>
</div><section id="variant.DACReadSearch" class="variant"><a href="#variant.DACReadSearch" class="anchor">§</a><h3 class="code-header">DACReadSearch = 2</h3></section><div class="docblock"><p>Overrides all DAC restrictions regarding read and search on files and
directories, including ACL restrictions if <code>_POSIX_ACL</code> is defined.
Excluding DAC access covered by <a href="enum.Capability.html#variant.LinuxImmutable" title="variant rustix::thread::Capability::LinuxImmutable"><code>Capability::LinuxImmutable</code></a>.</p>
</div><section id="variant.FileOwner" class="variant"><a href="#variant.FileOwner" class="anchor">§</a><h3 class="code-header">FileOwner = 3</h3></section><div class="docblock"><p>Overrides all restrictions about allowed operations on files, where
file owner ID must be equal to the user ID, except where
<a href="enum.Capability.html#variant.FileSetID" title="variant rustix::thread::Capability::FileSetID"><code>Capability::FileSetID</code></a> is applicable. It doesnt override MAC
and DAC restrictions.</p>
</div><section id="variant.FileSetID" class="variant"><a href="#variant.FileSetID" class="anchor">§</a><h3 class="code-header">FileSetID = 4</h3></section><div class="docblock"><p>Overrides the following restrictions that the effective user ID shall
match the file owner ID when setting the <code>S_ISUID</code> and <code>S_ISGID</code>
bits on that file; that the effective group ID (or one of the
supplementary group IDs) shall match the file owner ID when setting the
<code>S_ISGID</code> bit on that file; that the <code>S_ISUID</code> and <code>S_ISGID</code> bits are
cleared on successful return from <code>chown</code> (not implemented).</p>
</div><section id="variant.Kill" class="variant"><a href="#variant.Kill" class="anchor">§</a><h3 class="code-header">Kill = 5</h3></section><div class="docblock"><p>Overrides the restriction that the real or effective user ID of a
process sending a signal must match the real or effective user ID of
the process receiving the signal.</p>
</div><section id="variant.SetGroupID" class="variant"><a href="#variant.SetGroupID" class="anchor">§</a><h3 class="code-header">SetGroupID = 6</h3></section><div class="docblock"><p>Allows <code>setgid</code> manipulation. Allows <code>setgroups</code>. Allows forged gids on
socket credentials passing.</p>
</div><section id="variant.SetUserID" class="variant"><a href="#variant.SetUserID" class="anchor">§</a><h3 class="code-header">SetUserID = 7</h3></section><div class="docblock"><p>Allows <code>set*uid</code> manipulation (including fsuid). Allows forged pids on
socket credentials passing.</p>
</div><section id="variant.SetPermittedCapabilities" class="variant"><a href="#variant.SetPermittedCapabilities" class="anchor">§</a><h3 class="code-header">SetPermittedCapabilities = 8</h3></section><div class="docblock"><p>Without VFS support for capabilities:</p>
<ul>
<li>Transfer any capability in your permitted set to any pid.</li>
<li>remove any capability in your permitted set from any pid. With VFS
support for capabilities (neither of above, but)</li>
<li>Add any capability from currents capability bounding set to the
current process inheritable set.</li>
<li>Allow taking bits out of capability bounding set.</li>
<li>Allow modification of the securebits for a process.</li>
</ul>
</div><section id="variant.LinuxImmutable" class="variant"><a href="#variant.LinuxImmutable" class="anchor">§</a><h3 class="code-header">LinuxImmutable = 9</h3></section><div class="docblock"><p>Allow modification of <code>S_IMMUTABLE</code> and <code>S_APPEND</code> file attributes.</p>
</div><section id="variant.NetBindService" class="variant"><a href="#variant.NetBindService" class="anchor">§</a><h3 class="code-header">NetBindService = 10</h3></section><div class="docblock"><p>Allows binding to TCP/UDP sockets below 1024. Allows binding to ATM
VCIs below 32.</p>
</div><section id="variant.NetBroadcast" class="variant"><a href="#variant.NetBroadcast" class="anchor">§</a><h3 class="code-header">NetBroadcast = 11</h3></section><div class="docblock"><p>Allow broadcasting, listen to multicast.</p>
</div><section id="variant.NetAdmin" class="variant"><a href="#variant.NetAdmin" class="anchor">§</a><h3 class="code-header">NetAdmin = 12</h3></section><div class="docblock"><p>Allow interface configuration. Allow administration of IP firewall,
masquerading and accounting. Allow setting debug option on sockets.
Allow modification of routing tables. Allow setting arbitrary
process / process group ownership on sockets. Allow binding to any
address for transparent proxying (also via <a href="enum.Capability.html#variant.NetRaw" title="variant rustix::thread::Capability::NetRaw"><code>Capability::NetRaw</code></a>).
Allow setting TOS (type of service). Allow setting promiscuous
mode. Allow clearing driver statistics. Allow multicasting. Allow
read/write of device-specific registers. Allow activation of ATM
control sockets.</p>
</div><section id="variant.NetRaw" class="variant"><a href="#variant.NetRaw" class="anchor">§</a><h3 class="code-header">NetRaw = 13</h3></section><div class="docblock"><p>Allow use of <code>RAW</code> sockets. Allow use of <code>PACKET</code> sockets. Allow
binding to any address for transparent proxying (also via
<a href="enum.Capability.html#variant.NetAdmin" title="variant rustix::thread::Capability::NetAdmin"><code>Capability::NetAdmin</code></a>).</p>
</div><section id="variant.IPCLock" class="variant"><a href="#variant.IPCLock" class="anchor">§</a><h3 class="code-header">IPCLock = 14</h3></section><div class="docblock"><p>Allow locking of shared memory segments. Allow mlock and mlockall
(which doesnt really have anything to do with IPC).</p>
</div><section id="variant.IPCOwner" class="variant"><a href="#variant.IPCOwner" class="anchor">§</a><h3 class="code-header">IPCOwner = 15</h3></section><div class="docblock"><p>Override IPC ownership checks.</p>
</div><section id="variant.SystemModule" class="variant"><a href="#variant.SystemModule" class="anchor">§</a><h3 class="code-header">SystemModule = 16</h3></section><div class="docblock"><p>Insert and remove kernel modules - modify kernel without limit.</p>
</div><section id="variant.SystemRawIO" class="variant"><a href="#variant.SystemRawIO" class="anchor">§</a><h3 class="code-header">SystemRawIO = 17</h3></section><div class="docblock"><p>Allow ioperm/iopl access. Allow sending USB messages to any device via
<code>/dev/bus/usb</code>.</p>
</div><section id="variant.SystemChangeRoot" class="variant"><a href="#variant.SystemChangeRoot" class="anchor">§</a><h3 class="code-header">SystemChangeRoot = 18</h3></section><div class="docblock"><p>Allow use of <code>chroot</code>.</p>
</div><section id="variant.SystemProcessTrace" class="variant"><a href="#variant.SystemProcessTrace" class="anchor">§</a><h3 class="code-header">SystemProcessTrace = 19</h3></section><div class="docblock"><p>Allow <code>ptrace</code> of any process.</p>
</div><section id="variant.SystemProcessAccounting" class="variant"><a href="#variant.SystemProcessAccounting" class="anchor">§</a><h3 class="code-header">SystemProcessAccounting = 20</h3></section><div class="docblock"><p>Allow configuration of process accounting.</p>
</div><section id="variant.SystemAdmin" class="variant"><a href="#variant.SystemAdmin" class="anchor">§</a><h3 class="code-header">SystemAdmin = 21</h3></section><div class="docblock"><p>Allow configuration of the secure attention key. Allow administration
of the random device. Allow examination and configuration of disk
quotas. Allow setting the domainname. Allow setting the hostname.
Allow <code>mount</code> and <code>umount</code>, setting up new smb connection.
Allow some autofs root ioctls. Allow nfsservctl. Allow
<code>VM86_REQUEST_IRQ</code>. Allow to read/write pci config on alpha. Allow
<code>irix_prctl</code> on mips (setstacksize). Allow flushing all cache on
m68k (<code>sys_cacheflush</code>). Allow removing semaphores. Used instead of
<a href="enum.Capability.html#variant.ChangeOwnership" title="variant rustix::thread::Capability::ChangeOwnership"><code>Capability::ChangeOwnership</code></a> to “chown” IPC message queues,
semaphores and shared memory. Allow locking/unlocking of shared
memory segment. Allow turning swap on/off. Allow forged pids on
socket credentials passing. Allow setting readahead and
flushing buffers on block devices. Allow setting geometry in floppy
driver. Allow turning DMA on/off in <code>xd</code> driver. Allow
administration of md devices (mostly the above, but some
extra ioctls). Allow tuning the ide driver. Allow access to the nvram
device. Allow administration of <code>apm_bios</code>, serial and bttv (TV)
device. Allow manufacturer commands in isdn CAPI support driver.
Allow reading non-standardized portions of pci configuration space.
Allow DDI debug ioctl on sbpcd driver. Allow setting up serial ports.
Allow sending raw qic-117 commands. Allow enabling/disabling tagged
queuing on SCSI controllers and sending arbitrary SCSI commands.
Allow setting encryption key on loopback filesystem. Allow setting
zone reclaim policy. Allow everything under
<a href="enum.Capability.html#variant.BerkeleyPacketFilters" title="variant rustix::thread::Capability::BerkeleyPacketFilters"><code>Capability::BerkeleyPacketFilters</code></a> and
<a href="enum.Capability.html#variant.PerformanceMonitoring" title="variant rustix::thread::Capability::PerformanceMonitoring"><code>Capability::PerformanceMonitoring</code></a> for backward compatibility.</p>
</div><section id="variant.SystemBoot" class="variant"><a href="#variant.SystemBoot" class="anchor">§</a><h3 class="code-header">SystemBoot = 22</h3></section><div class="docblock"><p>Allow use of <code>reboot</code>.</p>
</div><section id="variant.SystemNice" class="variant"><a href="#variant.SystemNice" class="anchor">§</a><h3 class="code-header">SystemNice = 23</h3></section><div class="docblock"><p>Allow raising priority and setting priority on other (different UID)
processes. Allow use of FIFO and round-robin (realtime) scheduling
on own processes and setting the scheduling algorithm used by
another process. Allow setting cpu affinity on other processes.
Allow setting realtime ioprio class. Allow setting ioprio class on
other processes.</p>
</div><section id="variant.SystemResource" class="variant"><a href="#variant.SystemResource" class="anchor">§</a><h3 class="code-header">SystemResource = 24</h3></section><div class="docblock"><p>Override resource limits. Set resource limits. Override quota limits.
Override reserved space on ext2 filesystem. Modify data journaling
mode on ext3 filesystem (uses journaling resources). NOTE: ext2
honors fsuid when checking for resource overrides, so you can
override using fsuid too. Override size restrictions on IPC message
queues. Allow more than 64hz interrupts from the real-time clock.
Override max number of consoles on console allocation. Override max
number of keymaps. Control memory reclaim behavior.</p>
</div><section id="variant.SystemTime" class="variant"><a href="#variant.SystemTime" class="anchor">§</a><h3 class="code-header">SystemTime = 25</h3></section><div class="docblock"><p>Allow manipulation of system clock. Allow <code>irix_stime</code> on mips. Allow
setting the real-time clock.</p>
</div><section id="variant.SystemTTYConfig" class="variant"><a href="#variant.SystemTTYConfig" class="anchor">§</a><h3 class="code-header">SystemTTYConfig = 26</h3></section><div class="docblock"><p>Allow configuration of tty devices. Allow <code>vhangup</code> of tty.</p>
</div><section id="variant.MakeNode" class="variant"><a href="#variant.MakeNode" class="anchor">§</a><h3 class="code-header">MakeNode = 27</h3></section><div class="docblock"><p>Allow the privileged aspects of <code>mknod</code>.</p>
</div><section id="variant.Lease" class="variant"><a href="#variant.Lease" class="anchor">§</a><h3 class="code-header">Lease = 28</h3></section><div class="docblock"><p>Allow taking of leases on files.</p>
</div><section id="variant.AuditWrite" class="variant"><a href="#variant.AuditWrite" class="anchor">§</a><h3 class="code-header">AuditWrite = 29</h3></section><div class="docblock"><p>Allow writing the audit log via unicast netlink socket.</p>
</div><section id="variant.AuditControl" class="variant"><a href="#variant.AuditControl" class="anchor">§</a><h3 class="code-header">AuditControl = 30</h3></section><div class="docblock"><p>Allow configuration of audit via unicast netlink socket.</p>
</div><section id="variant.SetFileCapabilities" class="variant"><a href="#variant.SetFileCapabilities" class="anchor">§</a><h3 class="code-header">SetFileCapabilities = 31</h3></section><div class="docblock"><p>Set or remove capabilities on files. Map <code>uid=0</code> into a child user
namespace.</p>
</div><section id="variant.MACOverride" class="variant"><a href="#variant.MACOverride" class="anchor">§</a><h3 class="code-header">MACOverride = 32</h3></section><div class="docblock"><p>Override MAC access. The base kernel enforces no MAC policy. An LSM may
enforce a MAC policy, and if it does and it chooses to implement
capability based overrides of that policy, this is the capability
it should use to do so.</p>
</div><section id="variant.MACAdmin" class="variant"><a href="#variant.MACAdmin" class="anchor">§</a><h3 class="code-header">MACAdmin = 33</h3></section><div class="docblock"><p>Allow MAC configuration or state changes. The base kernel requires no
MAC configuration. An LSM may enforce a MAC policy, and if it does
and it chooses to implement capability based
checks on modifications to that policy or the data required to maintain
it, this is the capability it should use to do so.</p>
</div><section id="variant.SystemLog" class="variant"><a href="#variant.SystemLog" class="anchor">§</a><h3 class="code-header">SystemLog = 34</h3></section><div class="docblock"><p>Allow configuring the kernels <code>syslog</code> (<code>printk</code> behaviour).</p>
</div><section id="variant.WakeAlarm" class="variant"><a href="#variant.WakeAlarm" class="anchor">§</a><h3 class="code-header">WakeAlarm = 35</h3></section><div class="docblock"><p>Allow triggering something that will wake the system.</p>
</div><section id="variant.BlockSuspend" class="variant"><a href="#variant.BlockSuspend" class="anchor">§</a><h3 class="code-header">BlockSuspend = 36</h3></section><div class="docblock"><p>Allow preventing system suspends.</p>
</div><section id="variant.AuditRead" class="variant"><a href="#variant.AuditRead" class="anchor">§</a><h3 class="code-header">AuditRead = 37</h3></section><div class="docblock"><p>Allow reading the audit log via multicast netlink socket.</p>
</div><section id="variant.PerformanceMonitoring" class="variant"><a href="#variant.PerformanceMonitoring" class="anchor">§</a><h3 class="code-header">PerformanceMonitoring = 38</h3></section><div class="docblock"><p>Allow system performance and observability privileged operations using
<code>perf_events</code>, <code>i915_perf</code> and other kernel subsystems.</p>
</div><section id="variant.BerkeleyPacketFilters" class="variant"><a href="#variant.BerkeleyPacketFilters" class="anchor">§</a><h3 class="code-header">BerkeleyPacketFilters = 39</h3></section><div class="docblock"><p>This capability allows the following BPF operations:</p>
<ul>
<li>Creating all types of BPF maps</li>
<li>Advanced verifier features
<ul>
<li>Indirect variable access</li>
<li>Bounded loops</li>
<li>BPF to BPF function calls</li>
<li>Scalar precision tracking</li>
<li>Larger complexity limits</li>
<li>Dead code elimination</li>
<li>And potentially other features</li>
</ul>
</li>
<li>Loading BPF Type Format (BTF) data</li>
<li>Retrieve <code>xlated</code> and JITed code of BPF programs</li>
<li>Use <code>bpf_spin_lock</code> helper</li>
</ul>
<p><a href="enum.Capability.html#variant.PerformanceMonitoring" title="variant rustix::thread::Capability::PerformanceMonitoring"><code>Capability::PerformanceMonitoring</code></a> relaxes the verifier checks
further:</p>
<ul>
<li>BPF progs can use of pointer-to-integer conversions</li>
<li>speculation attack hardening measures are bypassed</li>
<li><code>bpf_probe_read</code> to read arbitrary kernel memory is allowed</li>
<li><code>bpf_trace_printk</code> to print kernel memory is allowed</li>
</ul>
<p><a href="enum.Capability.html#variant.SystemAdmin" title="variant rustix::thread::Capability::SystemAdmin"><code>Capability::SystemAdmin</code></a> is required to use <code>bpf_probe_write_user</code>.</p>
<p><a href="enum.Capability.html#variant.SystemAdmin" title="variant rustix::thread::Capability::SystemAdmin"><code>Capability::SystemAdmin</code></a> is required to iterate system-wide loaded
programs, maps, links, and BTFs, and convert their IDs to file
descriptors.</p>
<p><a href="enum.Capability.html#variant.PerformanceMonitoring" title="variant rustix::thread::Capability::PerformanceMonitoring"><code>Capability::PerformanceMonitoring</code></a> and
<a href="enum.Capability.html#variant.BerkeleyPacketFilters" title="variant rustix::thread::Capability::BerkeleyPacketFilters"><code>Capability::BerkeleyPacketFilters</code></a> are required to load tracing
programs. <a href="enum.Capability.html#variant.NetAdmin" title="variant rustix::thread::Capability::NetAdmin"><code>Capability::NetAdmin</code></a> and
<a href="enum.Capability.html#variant.BerkeleyPacketFilters" title="variant rustix::thread::Capability::BerkeleyPacketFilters"><code>Capability::BerkeleyPacketFilters</code></a> are required to load
networking programs.</p>
</div><section id="variant.CheckpointRestore" class="variant"><a href="#variant.CheckpointRestore" class="anchor">§</a><h3 class="code-header">CheckpointRestore = 40</h3></section><div class="docblock"><p>Allow checkpoint/restore related operations. Allow PID selection during
<code>clone3</code>. Allow writing to <code>ns_last_pid</code>.</p>
</div></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-Clone-for-Capability" class="impl"><a class="src rightside" href="../../src/rustix/thread/prctl.rs.html#182">Source</a><a href="#impl-Clone-for-Capability" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="enum.Capability.html" title="enum rustix::thread::Capability">Capability</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.clone" class="method trait-impl"><a class="src rightside" href="../../src/rustix/thread/prctl.rs.html#182">Source</a><a href="#method.clone" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html#tymethod.clone" class="fn">clone</a>(&amp;self) -&gt; <a class="enum" href="enum.Capability.html" title="enum rustix::thread::Capability">Capability</a></h4></section></summary><div class='docblock'>Returns a copy of the value. <a href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html#tymethod.clone">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clone_from" 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.84.0/src/core/clone.rs.html#174">Source</a></span><a href="#method.clone_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html#method.clone_from" class="fn">clone_from</a>(&amp;mut self, source: &amp;Self)</h4></section></summary><div class='docblock'>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html#method.clone_from">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Debug-for-Capability" class="impl"><a class="src rightside" href="../../src/rustix/thread/prctl.rs.html#182">Source</a><a href="#impl-Debug-for-Capability" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="enum.Capability.html" title="enum rustix::thread::Capability">Capability</a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl"><a class="src rightside" href="../../src/rustix/thread/prctl.rs.html#182">Source</a><a href="#method.fmt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/fmt/trait.Debug.html#tymethod.fmt" class="fn">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.84.0/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.84.0/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.84.0/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-PartialEq-for-Capability" class="impl"><a class="src rightside" href="../../src/rustix/thread/prctl.rs.html#182">Source</a><a href="#impl-PartialEq-for-Capability" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a> for <a class="enum" href="enum.Capability.html" title="enum rustix::thread::Capability">Capability</a></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/rustix/thread/prctl.rs.html#182">Source</a><a href="#method.eq" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/cmp/trait.PartialEq.html#tymethod.eq" class="fn">eq</a>(&amp;self, other: &amp;<a class="enum" href="enum.Capability.html" title="enum rustix::thread::Capability">Capability</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>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.84.0/src/core/cmp.rs.html#261">Source</a></span><a href="#method.ne" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/cmp/trait.PartialEq.html#method.ne" class="fn">ne</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.reference.html">&amp;Rhs</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Tests for <code>!=</code>. The default implementation is almost always sufficient,
and should not be overridden without very good reason.</div></details></div></details><section id="impl-Copy-for-Capability" class="impl"><a class="src rightside" href="../../src/rustix/thread/prctl.rs.html#182">Source</a><a href="#impl-Copy-for-Capability" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="enum" href="enum.Capability.html" title="enum rustix::thread::Capability">Capability</a></h3></section><section id="impl-Eq-for-Capability" class="impl"><a class="src rightside" href="../../src/rustix/thread/prctl.rs.html#182">Source</a><a href="#impl-Eq-for-Capability" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="enum" href="enum.Capability.html" title="enum rustix::thread::Capability">Capability</a></h3></section><section id="impl-StructuralPartialEq-for-Capability" class="impl"><a class="src rightside" href="../../src/rustix/thread/prctl.rs.html#182">Source</a><a href="#impl-StructuralPartialEq-for-Capability" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="enum" href="enum.Capability.html" title="enum rustix::thread::Capability">Capability</a></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-Capability" class="impl"><a href="#impl-Freeze-for-Capability" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a> for <a class="enum" href="enum.Capability.html" title="enum rustix::thread::Capability">Capability</a></h3></section><section id="impl-RefUnwindSafe-for-Capability" class="impl"><a href="#impl-RefUnwindSafe-for-Capability" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="enum.Capability.html" title="enum rustix::thread::Capability">Capability</a></h3></section><section id="impl-Send-for-Capability" class="impl"><a href="#impl-Send-for-Capability" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="enum.Capability.html" title="enum rustix::thread::Capability">Capability</a></h3></section><section id="impl-Sync-for-Capability" class="impl"><a href="#impl-Sync-for-Capability" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="enum.Capability.html" title="enum rustix::thread::Capability">Capability</a></h3></section><section id="impl-Unpin-for-Capability" class="impl"><a href="#impl-Unpin-for-Capability" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="enum.Capability.html" title="enum rustix::thread::Capability">Capability</a></h3></section><section id="impl-UnwindSafe-for-Capability" class="impl"><a href="#impl-UnwindSafe-for-Capability" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="enum" href="enum.Capability.html" title="enum rustix::thread::Capability">Capability</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.84.0/src/core/any.rs.html#138">Source</a><a href="#impl-Any-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.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.84.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.84.0/src/core/any.rs.html#139">Source</a><a href="#method.type_id" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.84.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.84.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.84.0/src/core/borrow.rs.html#209">Source</a><a href="#impl-Borrow%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T<div class="where">where
T: ?<a class="trait" href="https://doc.rust-lang.org/1.84.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.84.0/src/core/borrow.rs.html#211">Source</a><a href="#method.borrow" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.reference.html">&amp;T</a></h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.84.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.84.0/src/core/borrow.rs.html#217">Source</a><a href="#impl-BorrowMut%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T<div class="where">where
T: ?<a class="trait" href="https://doc.rust-lang.org/1.84.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.84.0/src/core/borrow.rs.html#218">Source</a><a href="#method.borrow_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fn">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.reference.html">&amp;mut T</a></h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.84.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-CloneToUninit-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/clone.rs.html#273">Source</a><a href="#impl-CloneToUninit-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/clone/trait.CloneToUninit.html" title="trait core::clone::CloneToUninit">CloneToUninit</a> for T<div class="where">where
T: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.clone_to_uninit" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/clone.rs.html#275">Source</a><a href="#method.clone_to_uninit" class="anchor">§</a><h4 class="code-header">unsafe fn <a href="https://doc.rust-lang.org/1.84.0/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit" class="fn">clone_to_uninit</a>(&amp;self, dst: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>)</h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>clone_to_uninit</code>)</span></div></span><div class='docblock'>Performs copy-assignment from <code>self</code> to <code>dst</code>. <a href="https://doc.rust-lang.org/1.84.0/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit">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.84.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&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; 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.84.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.84.0/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(t: T) -&gt; 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.84.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&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T<div class="where">where
U: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,</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.84.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.84.0/core/convert/trait.Into.html#tymethod.into" class="fn">into</a>(self) -&gt; 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.84.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for U</code> chooses to do.</p>
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-ToOwned-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/alloc/borrow.rs.html#82-84">Source</a><a href="#impl-ToOwned-for-T" class="anchor">§</a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.0/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T<div class="where">where
T: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Owned" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/alloc/borrow.rs.html#86">Source</a><a href="#associatedtype.Owned" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.0/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="associatedtype">Owned</a> = T</h4></section></summary><div class='docblock'>The resulting type after obtaining ownership.</div></details><details class="toggle method-toggle" open><summary><section id="method.to_owned" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/alloc/borrow.rs.html#87">Source</a><a href="#method.to_owned" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fn">to_owned</a>(&amp;self) -&gt; T</h4></section></summary><div class='docblock'>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/1.84.0/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clone_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/alloc/borrow.rs.html#91">Source</a><a href="#method.clone_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fn">clone_into</a>(&amp;self, target: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.reference.html">&amp;mut T</a>)</h4></section></summary><div class='docblock'>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/1.84.0/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></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.84.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&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T<div class="where">where
U: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#809">Source</a><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.84.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.84.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.84.0/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</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.84.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&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T<div class="where">where
U: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#794">Source</a><a href="#associatedtype.Error" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.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.84.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.84.0/core/convert/trait.TryInto.html#tymethod.try_into" class="fn">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details></div></section></div></main></body></html>