mirror of
https://github.com/encounter/rust-sdl2.git
synced 2026-07-10 21:18:41 -07:00
192 lines
82 KiB
HTML
192 lines
82 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="API documentation for the Rust `Rect` struct in crate `sdl2`."><meta name="keywords" content="rust, rustlang, rust-lang, Rect"><title>sdl2::rect::Rect - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../sdl2/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct Rect</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.bottom">bottom</a><a href="#method.bottom_left">bottom_left</a><a href="#method.bottom_right">bottom_right</a><a href="#method.center">center</a><a href="#method.center_on">center_on</a><a href="#method.contains_point">contains_point</a><a href="#method.contains_rect">contains_rect</a><a href="#method.from_center">from_center</a><a href="#method.from_enclose_points">from_enclose_points</a><a href="#method.from_ll">from_ll</a><a href="#method.has_intersection">has_intersection</a><a href="#method.height">height</a><a href="#method.intersect_line">intersect_line</a><a href="#method.intersection">intersection</a><a href="#method.left">left</a><a href="#method.new">new</a><a href="#method.offset">offset</a><a href="#method.raw">raw</a><a href="#method.raw_mut">raw_mut</a><a href="#method.raw_slice">raw_slice</a><a href="#method.reposition">reposition</a><a href="#method.resize">resize</a><a href="#method.right">right</a><a href="#method.set_bottom">set_bottom</a><a href="#method.set_height">set_height</a><a href="#method.set_right">set_right</a><a href="#method.set_width">set_width</a><a href="#method.set_x">set_x</a><a href="#method.set_y">set_y</a><a href="#method.size">size</a><a href="#method.top">top</a><a href="#method.top_left">top_left</a><a href="#method.top_right">top_right</a><a href="#method.union">union</a><a href="#method.width">width</a><a href="#method.x">x</a><a href="#method.y">y</a></div><a class="sidebar-title" href="#deref-methods">Methods from Deref<Target=SDL_Rect></a><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-AsMut%3CSDL_Rect%3E">AsMut<SDL_Rect></a><a href="#impl-AsRef%3CSDL_Rect%3E">AsRef<SDL_Rect></a><a href="#impl-BitAnd%3CRect%3E">BitAnd<Rect></a><a href="#impl-BitOr%3CRect%3E">BitOr<Rect></a><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Debug">Debug</a><a href="#impl-Deref">Deref</a><a href="#impl-DerefMut">DerefMut</a><a href="#impl-Eq">Eq</a><a href="#impl-From%3C(i32%2C%20i32%2C%20u32%2C%20u32)%3E">From<(i32, i32, u32, u32)></a><a href="#impl-From%3CSDL_Rect%3E">From<SDL_Rect></a><a href="#impl-Hash">Hash</a><a href="#impl-Into%3C(i32%2C%20i32%2C%20u32%2C%20u32)%3E">Into<(i32, i32, u32, u32)></a><a href="#impl-Into%3CSDL_Rect%3E">Into<SDL_Rect></a><a href="#impl-PartialEq%3CRect%3E">PartialEq<Rect></a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><p class='location'><a href='../index.html'>sdl2</a>::<wbr><a href='index.html'>rect</a></p><script>window.sidebarCurrent = {name: 'Rect', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/sdl2/rect.rs.html#69-71' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../index.html'>sdl2</a>::<wbr><a href='index.html'>rect</a>::<wbr><a class="struct" href=''>Rect</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct Rect { /* fields omitted */ }</pre></div><div class='docblock'><p>A (non-empty) rectangle.</p>
|
||
<p>The width and height of a <code>Rect</code> must always be strictly positive (never
|
||
zero). In cases where empty rects may need to represented, it is
|
||
recommended to use <code>Option<Rect></code>, with <code>None</code> representing an empty
|
||
rectangle (see, for example, the output of the
|
||
<a href="#method.intersection"><code>intersection</code></a> method).</p>
|
||
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../src/sdl2/rect.rs.html#100-552' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new' class="method"><code id='new.v'>pub fn <a href='#method.new' class='fnname'>new</a>(x: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, y: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, width: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, height: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -> <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a></code><a class='srclink' href='../../src/sdl2/rect.rs.html#111-119' title='goto source code'>[src]</a></h4><div class='docblock'><p>Creates a new rectangle from the given values.</p>
|
||
<p>The width and height are clamped to ensure that the right and bottom
|
||
sides of the rectangle does not exceed i32::max_value() (the value
|
||
2147483647, the maximal positive size of an i32). This means that the
|
||
rect size will behave oddly if you move it very far to the right or
|
||
downwards on the screen.</p>
|
||
<p><code>Rect</code>s must always be non-empty, so a <code>width</code> and/or <code>height</code> argument
|
||
of 0 will be replaced with 1.</p>
|
||
</div><h4 id='method.from_center' class="method"><code id='from_center.v'>pub fn <a href='#method.from_center' class='fnname'>from_center</a><P>(center: P, width: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, height: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -> <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a> <span class="where fmt-newline">where<br> P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="../../sdl2/rect/struct.Point.html" title="struct sdl2::rect::Point">Point</a>>, </span></code><a class='srclink' href='../../src/sdl2/rect.rs.html#131-142' title='goto source code'>[src]</a></h4><div class='docblock'><p>Creates a new rectangle centered on the given position.</p>
|
||
<p>The width and height are clamped to ensure that the right and bottom
|
||
sides of the rectangle does not exceed i32::max_value() (the value
|
||
2147483647, the maximal positive size of an i32). This means that the
|
||
rect size will behave oddly if you move it very far to the right or
|
||
downwards on the screen.</p>
|
||
<p><code>Rect</code>s must always be non-empty, so a <code>width</code> and/or <code>height</code> argument
|
||
of 0 will be replaced with 1.</p>
|
||
</div><h4 id='method.x' class="method"><code id='x.v'>pub fn <a href='#method.x' class='fnname'>x</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a></code><a class='srclink' href='../../src/sdl2/rect.rs.html#145-147' title='goto source code'>[src]</a></h4><div class='docblock'><p>The horizontal position of this rectangle.</p>
|
||
</div><h4 id='method.y' class="method"><code id='y.v'>pub fn <a href='#method.y' class='fnname'>y</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a></code><a class='srclink' href='../../src/sdl2/rect.rs.html#150-152' title='goto source code'>[src]</a></h4><div class='docblock'><p>The vertical position of this rectangle.</p>
|
||
</div><h4 id='method.width' class="method"><code id='width.v'>pub fn <a href='#method.width' class='fnname'>width</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class='srclink' href='../../src/sdl2/rect.rs.html#155-157' title='goto source code'>[src]</a></h4><div class='docblock'><p>The width of this rectangle.</p>
|
||
</div><h4 id='method.height' class="method"><code id='height.v'>pub fn <a href='#method.height' class='fnname'>height</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class='srclink' href='../../src/sdl2/rect.rs.html#160-162' title='goto source code'>[src]</a></h4><div class='docblock'><p>The height of this rectangle.</p>
|
||
</div><h4 id='method.size' class="method"><code id='size.v'>pub fn <a href='#method.size' class='fnname'>size</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code><a class='srclink' href='../../src/sdl2/rect.rs.html#165-167' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the width and height of this rectangle.</p>
|
||
</div><h4 id='method.set_x' class="method"><code id='set_x.v'>pub fn <a href='#method.set_x' class='fnname'>set_x</a>(&mut self, x: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>)</code><a class='srclink' href='../../src/sdl2/rect.rs.html#171-173' title='goto source code'>[src]</a></h4><div class='docblock'><p>Sets the horizontal position of this rectangle to the given value,
|
||
clamped to be less than or equal to i32::max_value() / 2.</p>
|
||
</div><h4 id='method.set_y' class="method"><code id='set_y.v'>pub fn <a href='#method.set_y' class='fnname'>set_y</a>(&mut self, y: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>)</code><a class='srclink' href='../../src/sdl2/rect.rs.html#177-179' title='goto source code'>[src]</a></h4><div class='docblock'><p>Sets the vertical position of this rectangle to the given value,
|
||
clamped to be less than or equal to i32::max_value() / 2.</p>
|
||
</div><h4 id='method.set_width' class="method"><code id='set_width.v'>pub fn <a href='#method.set_width' class='fnname'>set_width</a>(&mut self, width: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>)</code><a class='srclink' href='../../src/sdl2/rect.rs.html#186-188' title='goto source code'>[src]</a></h4><div class='docblock'><p>Sets the width of this rectangle to the given value,
|
||
clamped to be less than or equal to i32::max_value() / 2.</p>
|
||
<p><code>Rect</code>s must always be non-empty, so a <code>width</code> argument of 0 will be
|
||
replaced with 1.</p>
|
||
</div><h4 id='method.set_height' class="method"><code id='set_height.v'>pub fn <a href='#method.set_height' class='fnname'>set_height</a>(&mut self, height: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>)</code><a class='srclink' href='../../src/sdl2/rect.rs.html#195-197' title='goto source code'>[src]</a></h4><div class='docblock'><p>Sets the height of this rectangle to the given value,
|
||
clamped to be less than or equal to i32::max_value() / 2.</p>
|
||
<p><code>Rect</code>s must always be non-empty, so a <code>height</code> argument of 0 will be
|
||
replaced with 1.</p>
|
||
</div><h4 id='method.left' class="method"><code id='left.v'>pub fn <a href='#method.left' class='fnname'>left</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a></code><a class='srclink' href='../../src/sdl2/rect.rs.html#200-202' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the x-position of the left side of this rectangle.</p>
|
||
</div><h4 id='method.right' class="method"><code id='right.v'>pub fn <a href='#method.right' class='fnname'>right</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a></code><a class='srclink' href='../../src/sdl2/rect.rs.html#205-207' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the x-position of the right side of this rectangle.</p>
|
||
</div><h4 id='method.top' class="method"><code id='top.v'>pub fn <a href='#method.top' class='fnname'>top</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a></code><a class='srclink' href='../../src/sdl2/rect.rs.html#210-212' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the y-position of the top side of this rectangle.</p>
|
||
</div><h4 id='method.bottom' class="method"><code id='bottom.v'>pub fn <a href='#method.bottom' class='fnname'>bottom</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a></code><a class='srclink' href='../../src/sdl2/rect.rs.html#215-217' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the y-position of the bottom side of this rectangle.</p>
|
||
</div><h4 id='method.center' class="method"><code id='center.v'>pub fn <a href='#method.center' class='fnname'>center</a>(&self) -> <a class="struct" href="../../sdl2/rect/struct.Point.html" title="struct sdl2::rect::Point">Point</a></code><a class='srclink' href='../../src/sdl2/rect.rs.html#231-235' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the center position of this rectangle.</p>
|
||
<p>Note that if the width or height is not a multiple of two,
|
||
the center will be rounded down.</p>
|
||
<h1 id="example" class="section-header"><a href="#example">Example</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">use</span> <span class="ident">sdl2</span>::<span class="ident">rect</span>::{<span class="ident">Rect</span>,<span class="ident">Point</span>};
|
||
<span class="kw">let</span> <span class="ident">rect</span> <span class="op">=</span> <span class="ident">Rect</span>::<span class="ident">new</span>(<span class="number">1</span>,<span class="number">0</span>,<span class="number">2</span>,<span class="number">3</span>);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Point</span>::<span class="ident">new</span>(<span class="number">2</span>,<span class="number">1</span>),<span class="ident">rect</span>.<span class="ident">center</span>());</pre></div>
|
||
</div><h4 id='method.top_left' class="method"><code id='top_left.v'>pub fn <a href='#method.top_left' class='fnname'>top_left</a>(&self) -> <a class="struct" href="../../sdl2/rect/struct.Point.html" title="struct sdl2::rect::Point">Point</a></code><a class='srclink' href='../../src/sdl2/rect.rs.html#246-248' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the top-left corner of this rectangle.</p>
|
||
<h1 id="example-1" class="section-header"><a href="#example-1">Example</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">use</span> <span class="ident">sdl2</span>::<span class="ident">rect</span>::{<span class="ident">Rect</span>, <span class="ident">Point</span>};
|
||
<span class="kw">let</span> <span class="ident">rect</span> <span class="op">=</span> <span class="ident">Rect</span>::<span class="ident">new</span>(<span class="number">1</span>, <span class="number">0</span>, <span class="number">2</span>, <span class="number">3</span>);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Point</span>::<span class="ident">new</span>(<span class="number">1</span>, <span class="number">0</span>), <span class="ident">rect</span>.<span class="ident">top_left</span>());</pre></div>
|
||
</div><h4 id='method.top_right' class="method"><code id='top_right.v'>pub fn <a href='#method.top_right' class='fnname'>top_right</a>(&self) -> <a class="struct" href="../../sdl2/rect/struct.Point.html" title="struct sdl2::rect::Point">Point</a></code><a class='srclink' href='../../src/sdl2/rect.rs.html#259-261' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the top-right corner of this rectangle.</p>
|
||
<h1 id="example-2" class="section-header"><a href="#example-2">Example</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">use</span> <span class="ident">sdl2</span>::<span class="ident">rect</span>::{<span class="ident">Rect</span>, <span class="ident">Point</span>};
|
||
<span class="kw">let</span> <span class="ident">rect</span> <span class="op">=</span> <span class="ident">Rect</span>::<span class="ident">new</span>(<span class="number">1</span>, <span class="number">0</span>, <span class="number">2</span>, <span class="number">3</span>);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Point</span>::<span class="ident">new</span>(<span class="number">3</span>, <span class="number">0</span>), <span class="ident">rect</span>.<span class="ident">top_right</span>());</pre></div>
|
||
</div><h4 id='method.bottom_left' class="method"><code id='bottom_left.v'>pub fn <a href='#method.bottom_left' class='fnname'>bottom_left</a>(&self) -> <a class="struct" href="../../sdl2/rect/struct.Point.html" title="struct sdl2::rect::Point">Point</a></code><a class='srclink' href='../../src/sdl2/rect.rs.html#272-274' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the bottom-left corner of this rectangle.</p>
|
||
<h1 id="example-3" class="section-header"><a href="#example-3">Example</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">use</span> <span class="ident">sdl2</span>::<span class="ident">rect</span>::{<span class="ident">Rect</span>, <span class="ident">Point</span>};
|
||
<span class="kw">let</span> <span class="ident">rect</span> <span class="op">=</span> <span class="ident">Rect</span>::<span class="ident">new</span>(<span class="number">1</span>, <span class="number">0</span>, <span class="number">2</span>, <span class="number">3</span>);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Point</span>::<span class="ident">new</span>(<span class="number">1</span>, <span class="number">3</span>), <span class="ident">rect</span>.<span class="ident">bottom_left</span>());</pre></div>
|
||
</div><h4 id='method.bottom_right' class="method"><code id='bottom_right.v'>pub fn <a href='#method.bottom_right' class='fnname'>bottom_right</a>(&self) -> <a class="struct" href="../../sdl2/rect/struct.Point.html" title="struct sdl2::rect::Point">Point</a></code><a class='srclink' href='../../src/sdl2/rect.rs.html#285-287' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the bottom-right corner of this rectangle.</p>
|
||
<h1 id="example-4" class="section-header"><a href="#example-4">Example</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">use</span> <span class="ident">sdl2</span>::<span class="ident">rect</span>::{<span class="ident">Rect</span>, <span class="ident">Point</span>};
|
||
<span class="kw">let</span> <span class="ident">rect</span> <span class="op">=</span> <span class="ident">Rect</span>::<span class="ident">new</span>(<span class="number">1</span>, <span class="number">0</span>, <span class="number">2</span>, <span class="number">3</span>);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Point</span>::<span class="ident">new</span>(<span class="number">3</span>, <span class="number">3</span>), <span class="ident">rect</span>.<span class="ident">bottom_right</span>());</pre></div>
|
||
</div><h4 id='method.set_right' class="method"><code id='set_right.v'>pub fn <a href='#method.set_right' class='fnname'>set_right</a>(&mut self, right: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>)</code><a class='srclink' href='../../src/sdl2/rect.rs.html#291-293' title='goto source code'>[src]</a></h4><div class='docblock'><p>Sets the position of the right side of this rectangle to the given
|
||
value, clamped to be less than or equal to i32::max_value() / 2.</p>
|
||
</div><h4 id='method.set_bottom' class="method"><code id='set_bottom.v'>pub fn <a href='#method.set_bottom' class='fnname'>set_bottom</a>(&mut self, bottom: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>)</code><a class='srclink' href='../../src/sdl2/rect.rs.html#297-299' title='goto source code'>[src]</a></h4><div class='docblock'><p>Sets the position of the bottom side of this rectangle to the given
|
||
value, clamped to be less than or equal to i32::max_value() / 2.</p>
|
||
</div><h4 id='method.center_on' class="method"><code id='center_on.v'>pub fn <a href='#method.center_on' class='fnname'>center_on</a><P>(&mut self, point: P) <span class="where fmt-newline">where<br> P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, </span></code><a class='srclink' href='../../src/sdl2/rect.rs.html#302-306' title='goto source code'>[src]</a></h4><div class='docblock'><p>Centers the rectangle on the given point.</p>
|
||
</div><h4 id='method.offset' class="method"><code id='offset.v'>pub fn <a href='#method.offset' class='fnname'>offset</a>(&mut self, x: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, y: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>)</code><a class='srclink' href='../../src/sdl2/rect.rs.html#310-331' title='goto source code'>[src]</a></h4><div class='docblock'><p>Move this rect and clamp the positions to prevent over/underflow.
|
||
This also clamps the size to prevent overflow.</p>
|
||
</div><h4 id='method.reposition' class="method"><code id='reposition.v'>pub fn <a href='#method.reposition' class='fnname'>reposition</a><P>(&mut self, point: P) <span class="where fmt-newline">where<br> P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, </span></code><a class='srclink' href='../../src/sdl2/rect.rs.html#334-338' title='goto source code'>[src]</a></h4><div class='docblock'><p>Moves this rect to the given position after clamping the values.</p>
|
||
</div><h4 id='method.resize' class="method"><code id='resize.v'>pub fn <a href='#method.resize' class='fnname'>resize</a>(&mut self, width: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, height: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>)</code><a class='srclink' href='../../src/sdl2/rect.rs.html#341-344' title='goto source code'>[src]</a></h4><div class='docblock'><p>Resizes this rect to the given size after clamping the values.</p>
|
||
</div><h4 id='method.contains_point' class="method"><code id='contains_point.v'>pub fn <a href='#method.contains_point' class='fnname'>contains_point</a><P>(&self, point: P) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br> P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, </span></code><a class='srclink' href='../../src/sdl2/rect.rs.html#365-370' title='goto source code'>[src]</a></h4><div class='docblock'><p>Checks whether this rectangle contains a given point.</p>
|
||
<p>Points along the right and bottom edges are not considered to be inside
|
||
the rectangle; this way, a 1-by-1 rectangle contains only a single
|
||
point. Another way to look at it is that this method returns true if
|
||
and only if the given point would be painted by a call to
|
||
<a href="../render/struct.Renderer.html#method.fill_rect"><code>Renderer::fill_rect</code></a>.</p>
|
||
<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">use</span> <span class="ident">sdl2</span>::<span class="ident">rect</span>::{<span class="ident">Rect</span>, <span class="ident">Point</span>};
|
||
<span class="kw">let</span> <span class="ident">rect</span> <span class="op">=</span> <span class="ident">Rect</span>::<span class="ident">new</span>(<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>);
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">rect</span>.<span class="ident">contains_point</span>(<span class="ident">Point</span>::<span class="ident">new</span>(<span class="number">1</span>, <span class="number">2</span>)));
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">rect</span>.<span class="ident">contains_point</span>(<span class="ident">Point</span>::<span class="ident">new</span>(<span class="number">0</span>, <span class="number">1</span>)));
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">rect</span>.<span class="ident">contains_point</span>(<span class="ident">Point</span>::<span class="ident">new</span>(<span class="number">3</span>, <span class="number">5</span>)));
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">rect</span>.<span class="ident">contains_point</span>(<span class="ident">Point</span>::<span class="ident">new</span>(<span class="number">4</span>, <span class="number">6</span>)));</pre></div>
|
||
</div><h4 id='method.contains_rect' class="method"><code id='contains_rect.v'>pub fn <a href='#method.contains_rect' class='fnname'>contains_rect</a>(&self, other: <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/sdl2/rect.rs.html#388-391' title='goto source code'>[src]</a></h4><div class='docblock'><p>Checks whether this rectangle completely contains another rectangle.</p>
|
||
<p>This method returns true if and only if every point contained by
|
||
<code>other</code> is also contained by <code>self</code>; in other words, if the
|
||
intersection of <code>self</code> and <code>other</code> is equal to <code>other</code>.</p>
|
||
<h1 id="examples-1" class="section-header"><a href="#examples-1">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">use</span> <span class="ident">sdl2</span>::<span class="ident">rect</span>::<span class="ident">Rect</span>;
|
||
<span class="kw">let</span> <span class="ident">rect</span> <span class="op">=</span> <span class="ident">Rect</span>::<span class="ident">new</span>(<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>);
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">rect</span>.<span class="ident">contains_rect</span>(<span class="ident">rect</span>));
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">rect</span>.<span class="ident">contains_rect</span>(<span class="ident">Rect</span>::<span class="ident">new</span>(<span class="number">3</span>, <span class="number">3</span>, <span class="number">1</span>, <span class="number">1</span>)));
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">rect</span>.<span class="ident">contains_rect</span>(<span class="ident">Rect</span>::<span class="ident">new</span>(<span class="number">2</span>, <span class="number">1</span>, <span class="number">1</span>, <span class="number">1</span>)));
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">rect</span>.<span class="ident">contains_rect</span>(<span class="ident">Rect</span>::<span class="ident">new</span>(<span class="number">3</span>, <span class="number">3</span>, <span class="number">2</span>, <span class="number">1</span>)));</pre></div>
|
||
</div><h4 id='method.raw' class="method"><code id='raw.v'>pub fn <a href='#method.raw' class='fnname'>raw</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*const </a><a class="struct" href="../../sdl2_sys/struct.SDL_Rect.html" title="struct sdl2_sys::SDL_Rect">SDL_Rect</a></code><a class='srclink' href='../../src/sdl2/rect.rs.html#394-396' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the underlying C Rect.</p>
|
||
</div><h4 id='method.raw_mut' class="method"><code id='raw_mut.v'>pub fn <a href='#method.raw_mut' class='fnname'>raw_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a><a class="struct" href="../../sdl2_sys/struct.SDL_Rect.html" title="struct sdl2_sys::SDL_Rect">SDL_Rect</a></code><a class='srclink' href='../../src/sdl2/rect.rs.html#398-400' title='goto source code'>[src]</a></h4><h4 id='method.raw_slice' class="method"><code id='raw_slice.v'>pub fn <a href='#method.raw_slice' class='fnname'>raw_slice</a>(slice: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a><a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*const </a><a class="struct" href="../../sdl2_sys/struct.SDL_Rect.html" title="struct sdl2_sys::SDL_Rect">SDL_Rect</a></code><a class='srclink' href='../../src/sdl2/rect.rs.html#402-404' title='goto source code'>[src]</a></h4><h4 id='method.from_ll' class="method"><code id='from_ll.v'>pub fn <a href='#method.from_ll' class='fnname'>from_ll</a>(raw: <a class="struct" href="../../sdl2_sys/struct.SDL_Rect.html" title="struct sdl2_sys::SDL_Rect">SDL_Rect</a>) -> <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a></code><a class='srclink' href='../../src/sdl2/rect.rs.html#406-408' title='goto source code'>[src]</a></h4><h4 id='method.from_enclose_points' class="method"><code id='from_enclose_points.v'>pub fn <a href='#method.from_enclose_points' class='fnname'>from_enclose_points</a><R: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a>>>>(<br> points: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a><a class="struct" href="../../sdl2/rect/struct.Point.html" title="struct sdl2::rect::Point">Point</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br> clipping_rect: R<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a>> <span class="where fmt-newline">where<br> R: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a>>>, </span></code><a class='srclink' href='../../src/sdl2/rect.rs.html#413-447' title='goto source code'>[src]</a></h4><div class='docblock'><p>Calculate a minimal rectangle enclosing a set of points.
|
||
If a clipping rectangle is given, only points that are within it will be
|
||
considered.</p>
|
||
</div><h4 id='method.has_intersection' class="method"><code id='has_intersection.v'>pub fn <a href='#method.has_intersection' class='fnname'>has_intersection</a>(&self, other: <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/sdl2/rect.rs.html#463-467' title='goto source code'>[src]</a></h4><div class='docblock'><p>Determines whether two rectangles intersect.</p>
|
||
<p>Rectangles that share an edge but don't actually overlap are not
|
||
considered to intersect.</p>
|
||
<h1 id="examples-2" class="section-header"><a href="#examples-2">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">use</span> <span class="ident">sdl2</span>::<span class="ident">rect</span>::<span class="ident">Rect</span>;
|
||
<span class="kw">let</span> <span class="ident">rect</span> <span class="op">=</span> <span class="ident">Rect</span>::<span class="ident">new</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">5</span>, <span class="number">5</span>);
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">rect</span>.<span class="ident">has_intersection</span>(<span class="ident">rect</span>));
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">rect</span>.<span class="ident">has_intersection</span>(<span class="ident">Rect</span>::<span class="ident">new</span>(<span class="number">2</span>, <span class="number">2</span>, <span class="number">5</span>, <span class="number">5</span>)));
|
||
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">rect</span>.<span class="ident">has_intersection</span>(<span class="ident">Rect</span>::<span class="ident">new</span>(<span class="number">5</span>, <span class="number">0</span>, <span class="number">5</span>, <span class="number">5</span>)));</pre></div>
|
||
</div><h4 id='method.intersection' class="method"><code id='intersection.v'>pub fn <a href='#method.intersection' class='fnname'>intersection</a>(&self, other: <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a>></code><a class='srclink' href='../../src/sdl2/rect.rs.html#487-500' title='goto source code'>[src]</a></h4><div class='docblock'><p>Calculates the intersection of two rectangles.</p>
|
||
<p>Returns <code>None</code> if the two rectangles don't intersect. Rectangles that
|
||
share an edge but don't actually overlap are not considered to
|
||
intersect.</p>
|
||
<p>The bitwise AND operator <code>&</code> can also be used.</p>
|
||
<h1 id="examples-3" class="section-header"><a href="#examples-3">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">use</span> <span class="ident">sdl2</span>::<span class="ident">rect</span>::<span class="ident">Rect</span>;
|
||
<span class="kw">let</span> <span class="ident">rect</span> <span class="op">=</span> <span class="ident">Rect</span>::<span class="ident">new</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">5</span>, <span class="number">5</span>);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">rect</span>.<span class="ident">intersection</span>(<span class="ident">rect</span>), <span class="prelude-val">Some</span>(<span class="ident">rect</span>));
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">rect</span>.<span class="ident">intersection</span>(<span class="ident">Rect</span>::<span class="ident">new</span>(<span class="number">2</span>, <span class="number">2</span>, <span class="number">5</span>, <span class="number">5</span>)),
|
||
<span class="prelude-val">Some</span>(<span class="ident">Rect</span>::<span class="ident">new</span>(<span class="number">2</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">3</span>)));
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">rect</span>.<span class="ident">intersection</span>(<span class="ident">Rect</span>::<span class="ident">new</span>(<span class="number">5</span>, <span class="number">0</span>, <span class="number">5</span>, <span class="number">5</span>)), <span class="prelude-val">None</span>);</pre></div>
|
||
</div><h4 id='method.union' class="method"><code id='union.v'>pub fn <a href='#method.union' class='fnname'>union</a>(&self, other: <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a>) -> <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a></code><a class='srclink' href='../../src/sdl2/rect.rs.html#516-528' title='goto source code'>[src]</a></h4><div class='docblock'><p>Calculates the union of two rectangles (i.e. the smallest rectangle
|
||
that contains both).</p>
|
||
<p>The bitwise OR operator <code>|</code> can also be used.</p>
|
||
<h1 id="examples-4" class="section-header"><a href="#examples-4">Examples</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">use</span> <span class="ident">sdl2</span>::<span class="ident">rect</span>::<span class="ident">Rect</span>;
|
||
<span class="kw">let</span> <span class="ident">rect</span> <span class="op">=</span> <span class="ident">Rect</span>::<span class="ident">new</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">5</span>, <span class="number">5</span>);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">rect</span>.<span class="ident">union</span>(<span class="ident">rect</span>), <span class="ident">rect</span>);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">rect</span>.<span class="ident">union</span>(<span class="ident">Rect</span>::<span class="ident">new</span>(<span class="number">2</span>, <span class="number">2</span>, <span class="number">5</span>, <span class="number">5</span>)), <span class="ident">Rect</span>::<span class="ident">new</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">7</span>, <span class="number">7</span>));
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">rect</span>.<span class="ident">union</span>(<span class="ident">Rect</span>::<span class="ident">new</span>(<span class="number">5</span>, <span class="number">0</span>, <span class="number">5</span>, <span class="number">5</span>)), <span class="ident">Rect</span>::<span class="ident">new</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">10</span>, <span class="number">5</span>));</pre></div>
|
||
</div><h4 id='method.intersect_line' class="method"><code id='intersect_line.v'>pub fn <a href='#method.intersect_line' class='fnname'>intersect_line</a>(&self, start: <a class="struct" href="../../sdl2/rect/struct.Point.html" title="struct sdl2::rect::Point">Point</a>, end: <a class="struct" href="../../sdl2/rect/struct.Point.html" title="struct sdl2::rect::Point">Point</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="../../sdl2/rect/struct.Point.html" title="struct sdl2::rect::Point">Point</a>, <a class="struct" href="../../sdl2/rect/struct.Point.html" title="struct sdl2::rect::Point">Point</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>></code><a class='srclink' href='../../src/sdl2/rect.rs.html#532-551' title='goto source code'>[src]</a></h4><div class='docblock'><p>Calculates the intersection of a rectangle and a line segment and
|
||
returns the points of their intersection.</p>
|
||
</div></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-AsMut%3CSDL_Rect%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsMut.html" title="trait core::convert::AsMut">AsMut</a><<a class="struct" href="../../sdl2_sys/struct.SDL_Rect.html" title="struct sdl2_sys::SDL_Rect">SDL_Rect</a>> for <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a></code><a href='#impl-AsMut%3CSDL_Rect%3E' class='anchor'></a><a class='srclink' href='../../src/sdl2/rect.rs.html#613-617' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.as_mut' class="method hidden"><code id='as_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.AsMut.html#tymethod.as_mut' class='fnname'>as_mut</a>(&mut self) -> &mut <a class="struct" href="../../sdl2_sys/struct.SDL_Rect.html" title="struct sdl2_sys::SDL_Rect">SDL_Rect</a></code><a class='srclink' href='../../src/sdl2/rect.rs.html#614-616' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id='impl-AsRef%3CSDL_Rect%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="struct" href="../../sdl2_sys/struct.SDL_Rect.html" title="struct sdl2_sys::SDL_Rect">SDL_Rect</a>> for <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a></code><a href='#impl-AsRef%3CSDL_Rect%3E' class='anchor'></a><a class='srclink' href='../../src/sdl2/rect.rs.html#607-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.as_ref' class="method hidden"><code id='as_ref.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html#tymethod.as_ref' class='fnname'>as_ref</a>(&self) -> &<a class="struct" href="../../sdl2_sys/struct.SDL_Rect.html" title="struct sdl2_sys::SDL_Rect">SDL_Rect</a></code><a class='srclink' href='../../src/sdl2/rect.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id='impl-BitAnd%3CRect%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/bit/trait.BitAnd.html" title="trait core::ops::bit::BitAnd">BitAnd</a><<a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a>> for <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a></code><a href='#impl-BitAnd%3CRect%3E' class='anchor'></a><a class='srclink' href='../../src/sdl2/rect.rs.html#620-623' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output' class="type"><code id='Output.t'>type <a href='https://doc.rust-lang.org/nightly/core/ops/bit/trait.BitAnd.html#associatedtype.Output' class="type">Output</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a>></code></h4><div class='docblock'><p>The resulting type after applying the <code>&</code> operator.</p>
|
||
</div><h4 id='method.bitand' class="method hidden"><code id='bitand.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/bit/trait.BitAnd.html#tymethod.bitand' class='fnname'>bitand</a>(self, rhs: <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a>></code><a class='srclink' href='../../src/sdl2/rect.rs.html#622' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>&</code> operation.</p>
|
||
</div></div><h3 id='impl-BitOr%3CRect%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/bit/trait.BitOr.html" title="trait core::ops::bit::BitOr">BitOr</a><<a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a>> for <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a></code><a href='#impl-BitOr%3CRect%3E' class='anchor'></a><a class='srclink' href='../../src/sdl2/rect.rs.html#626-629' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Output-1' class="type"><code id='Output.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/ops/bit/trait.BitOr.html#associatedtype.Output' class="type">Output</a> = <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a></code></h4><div class='docblock'><p>The resulting type after applying the <code>|</code> operator.</p>
|
||
</div><h4 id='method.bitor' class="method hidden"><code id='bitor.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/bit/trait.BitOr.html#tymethod.bitor' class='fnname'>bitor</a>(self, rhs: <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a>) -> <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a></code><a class='srclink' href='../../src/sdl2/rect.rs.html#628' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the <code>|</code> operation.</p>
|
||
</div></div><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../src/sdl2/rect.rs.html#68' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a></code><a class='srclink' href='../../src/sdl2/rect.rs.html#68' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
||
</div><h4 id='method.clone_from' class="method hidden"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
|
||
</div></div><h3 id='impl-Copy' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a></code><a href='#impl-Copy' class='anchor'></a><a class='srclink' href='../../src/sdl2/rect.rs.html#68' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../src/sdl2/rect.rs.html#73-78' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, fmt: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Error.html" title="struct core::fmt::Error">Error</a>></code><a class='srclink' href='../../src/sdl2/rect.rs.html#74-77' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
|
||
</div></div><h3 id='impl-Deref' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a></code><a href='#impl-Deref' class='anchor'></a><a class='srclink' href='../../src/sdl2/rect.rs.html#554-567' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Target' class="type"><code id='Target.t'>type <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target' class="type">Target</a> = <a class="struct" href="../../sdl2_sys/struct.SDL_Rect.html" title="struct sdl2_sys::SDL_Rect">SDL_Rect</a></code></h4><div class='docblock'><p>The resulting type after dereferencing.</p>
|
||
</div><h4 id='method.deref' class="method"><code id='deref.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref' class='fnname'>deref</a>(&self) -> &<a class="struct" href="../../sdl2_sys/struct.SDL_Rect.html" title="struct sdl2_sys::SDL_Rect">SDL_Rect</a></code><a class='srclink' href='../../src/sdl2/rect.rs.html#564-566' title='goto source code'>[src]</a></h4><div class='docblock'><h1 id="example-5" class="section-header"><a href="#example-5">Example</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">use</span> <span class="ident">sdl2</span>::<span class="ident">rect</span>::<span class="ident">Rect</span>;
|
||
<span class="kw">let</span> <span class="ident">rect</span> <span class="op">=</span> <span class="ident">Rect</span>::<span class="ident">new</span>(<span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>);
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="number">2</span>, <span class="ident">rect</span>.<span class="ident">x</span>);</pre></div>
|
||
</div></div><h3 id='impl-DerefMut' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.DerefMut.html" title="trait core::ops::deref::DerefMut">DerefMut</a> for <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a></code><a href='#impl-DerefMut' class='anchor'></a><a class='srclink' href='../../src/sdl2/rect.rs.html#569-581' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.deref_mut' class="method"><code id='deref_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.DerefMut.html#tymethod.deref_mut' class='fnname'>deref_mut</a>(&mut self) -> &mut <a class="struct" href="../../sdl2_sys/struct.SDL_Rect.html" title="struct sdl2_sys::SDL_Rect">SDL_Rect</a></code><a class='srclink' href='../../src/sdl2/rect.rs.html#578-580' title='goto source code'>[src]</a></h4><div class='docblock'><h1 id="example-6" class="section-header"><a href="#example-6">Example</a></h1>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">use</span> <span class="ident">sdl2</span>::<span class="ident">rect</span>::<span class="ident">Rect</span>;
|
||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">rect</span> <span class="op">=</span> <span class="ident">Rect</span>::<span class="ident">new</span>(<span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>);
|
||
<span class="ident">rect</span>.<span class="ident">x</span> <span class="op">=</span> <span class="number">60</span>;
|
||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="number">60</span>, <span class="ident">rect</span>.<span class="ident">x</span>);</pre></div>
|
||
</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a></code><a href='#impl-Eq' class='anchor'></a><a class='srclink' href='../../src/sdl2/rect.rs.html#89' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-From%3C(i32%2C%20i32%2C%20u32%2C%20u32)%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>> for <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a></code><a href='#impl-From%3C(i32%2C%20i32%2C%20u32%2C%20u32)%3E' class='anchor'></a><a class='srclink' href='../../src/sdl2/rect.rs.html#601-605' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code id='from.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>((x, y, width, height): <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>) -> <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a></code><a class='srclink' href='../../src/sdl2/rect.rs.html#602-604' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id='impl-From%3CSDL_Rect%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="../../sdl2_sys/struct.SDL_Rect.html" title="struct sdl2_sys::SDL_Rect">SDL_Rect</a>> for <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a></code><a href='#impl-From%3CSDL_Rect%3E' class='anchor'></a><a class='srclink' href='../../src/sdl2/rect.rs.html#595-599' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(raw: <a class="struct" href="../../sdl2_sys/struct.SDL_Rect.html" title="struct sdl2_sys::SDL_Rect">SDL_Rect</a>) -> <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a></code><a class='srclink' href='../../src/sdl2/rect.rs.html#596-598' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id='impl-Hash' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> for <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a></code><a href='#impl-Hash' class='anchor'></a><a class='srclink' href='../../src/sdl2/rect.rs.html#91-98' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.hash' class="method hidden"><code id='hash.v'>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash' class='fnname'>hash</a><H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>>(&self, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>H)</code><a class='srclink' href='../../src/sdl2/rect.rs.html#92-97' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds this value into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash">Read more</a></p>
|
||
</div><h4 id='method.hash_slice' class="method hidden"><code id='hash_slice.v'>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice' class='fnname'>hash_slice</a><H>(data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[Self]</a>, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>H) <span class="where fmt-newline">where<br> H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>, </span></code><span class='since' title='Stable since Rust version 1.3.0'>1.3.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#194-201' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice">Read more</a></p>
|
||
</div></div><h3 id='impl-Into%3C(i32%2C%20i32%2C%20u32%2C%20u32)%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>> for <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a></code><a href='#impl-Into%3C(i32%2C%20i32%2C%20u32%2C%20u32)%3E' class='anchor'></a><a class='srclink' href='../../src/sdl2/rect.rs.html#589-593' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into-1' class="method hidden"><code id='into.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code><a class='srclink' href='../../src/sdl2/rect.rs.html#590-592' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id='impl-Into%3CSDL_Rect%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="../../sdl2_sys/struct.SDL_Rect.html" title="struct sdl2_sys::SDL_Rect">SDL_Rect</a>> for <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a></code><a href='#impl-Into%3CSDL_Rect%3E' class='anchor'></a><a class='srclink' href='../../src/sdl2/rect.rs.html#583-587' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> <a class="struct" href="../../sdl2_sys/struct.SDL_Rect.html" title="struct sdl2_sys::SDL_Rect">SDL_Rect</a></code><a class='srclink' href='../../src/sdl2/rect.rs.html#584-586' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id='impl-PartialEq%3CRect%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a>> for <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a></code><a href='#impl-PartialEq%3CRect%3E' class='anchor'></a><a class='srclink' href='../../src/sdl2/rect.rs.html#80-87' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code id='eq.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/sdl2/rect.rs.html#81-86' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
|
||
</div><h4 id='method.ne' class="method hidden"><code id='ne.v'><span class="docblock attributes">#[must_use]</span>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#215-217' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
|
||
</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../sdl2/rect/struct.Rect.html" title="struct sdl2::rect::Rect">Rect</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||
</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#565-569' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-2' class="method hidden"><code id='from.v-2'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#566-568' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#554-561' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into-2' class="method hidden"><code id='into.v-2'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#558-560' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
|
||
</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
|
||
</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
|
||
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
|
||
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#602-611' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#608-610' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588-597' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#594-596' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "sdl2";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html> |