# gdk::Rectangle - Rust
API documentation for the Rust `Rectangle` struct in crate `gdk`.
Keywords: rust, rustlang, rust-lang, Rectangle

# Struct gdk::Rectangle [−] [src]

    #[repr(C)]
    pub struct Rectangle {
        pub x: i32,
        pub y: i32,
        pub width: i32,
        pub height: i32,
    }

## Fields

`x: i32` `y: i32` `width: i32` `height: i32`

## Methods

### `impl Rectangle`
[src]

#### `fn intersect(&self, other: &Rectangle) -> Option<Rectangle>`

#### `fn union(&self, other: &Rectangle) -> Rectangle`

## Trait Implementations

### `impl Clone for Rectangle`
[src]

#### `fn clone(&self) -> Rectangle`

Returns a copy of the value. Read more

#### `fn clone_from(&mut self, source: &Self)`
1.0.0

Performs copy-assignment from `source`. Read more

### `impl Copy for Rectangle`
[src]

### `impl Debug for Rectangle`
[src]

#### `fn fmt(&self, __arg_0: &mut Formatter) -> Result`

Formats the value using the given formatter.

### `impl PartialEq for Rectangle`
[src]

#### `fn eq(&self, __arg_0: &Rectangle) -> bool`

This method tests for `self` and `other` values to be equal, and is used by `==`. Read more

#### `fn ne(&self, __arg_0: &Rectangle) -> bool`

This method tests for `!=`.

### `impl Eq for Rectangle`
[src]

### `impl Hash for Rectangle`
[src]

#### `fn hash<__H: Hasher>(&self, __arg_0: &mut __H)`

Feeds this value into the given [`Hasher`]. Read more

#### `fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,`
1.3.0

Feeds a slice of this type into the given [`Hasher`]. Read more

### `impl AsRef<RectangleInt> for Rectangle`
[src]

#### `fn as_ref(&self) -> &RectangleInt`

Performs the conversion.

### `impl From<RectangleInt> for Rectangle`
[src]

#### `fn from(r: RectangleInt) -> Rectangle`

Performs the conversion.

### `impl StaticType for Rectangle`
[src]

#### `fn static_type() -> Type`

Returns the type identifier of `Self`.

### `impl<'a> FromValueOptional<'a> for Rectangle`
[src]

#### `unsafe fn from_value_optional(value: &'a Value) -> Option<Self>`

### `impl SetValue for Rectangle`
[src]

#### `unsafe fn set_value(value: &mut Value, this: &Self)`

### `impl SetValueOptional for Rectangle`
[src]

#### `unsafe fn set_value_optional(value: &mut Value, this: Option<&Self>)`

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result
+
  Collapse/expand all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)