#[repr(C)]pub struct CGRect {
pub x: f64,
pub y: f64,
pub width: f64,
pub height: f64,
}Expand description
CGRect representation
Represents a rectangle with origin (x, y) and dimensions (width, height).
§Examples
use screencapturekit::cg::CGRect;
let rect = CGRect::new(10.0, 20.0, 100.0, 200.0);
assert_eq!(rect.x, 10.0);
assert_eq!(rect.width, 100.0);
assert_eq!(rect.max_x(), 110.0);Fields§
§x: f64§y: f64§width: f64§height: f64Implementations§
Source§impl CGRect
impl CGRect
Sourcepub const fn new(x: f64, y: f64, width: f64, height: f64) -> Self
pub const fn new(x: f64, y: f64, width: f64, height: f64) -> Self
Create a new rectangle
§Examples
use screencapturekit::cg::CGRect;
let rect = CGRect::new(0.0, 0.0, 1920.0, 1080.0);
assert_eq!(rect.width, 1920.0);Sourcepub const fn zero() -> Self
pub const fn zero() -> Self
Create a zero-sized rectangle at origin
§Examples
use screencapturekit::cg::CGRect;
let rect = CGRect::zero();
assert!(rect.is_null());Sourcepub const fn with_origin_and_size(origin: CGPoint, size: CGSize) -> Self
pub const fn with_origin_and_size(origin: CGPoint, size: CGSize) -> Self
Create a rect with origin and size
pub fn is_empty(&self) -> bool
Trait Implementations§
impl Copy for CGRect
impl Eq for CGRect
impl StructuralPartialEq for CGRect
Auto Trait Implementations§
impl Freeze for CGRect
impl RefUnwindSafe for CGRect
impl Send for CGRect
impl Sync for CGRect
impl Unpin for CGRect
impl UnwindSafe for CGRect
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more