rust_macios/appkit/
ns_layout_anchor.rs1use objc::{msg_send, sel, sel_impl};
2
3use crate::{
4 object,
5 objective_c_runtime::{
6 macros::interface_impl,
7 traits::{FromId, PNSObject},
8 },
9};
10
11use super::NSLayoutConstraint;
12
13object! {
14 unsafe pub struct NSLayoutAnchor;
16}
17
18#[interface_impl(NSObject)]
19impl NSLayoutAnchor {
20 #[method]
25 pub fn constraint_equal_to_anchor<A>(&self, anchor: A) -> NSLayoutConstraint
26 where
27 A: INSLayoutAnchor,
28 {
29 unsafe {
30 NSLayoutConstraint::from_id(msg_send![self.m_self(), constraintEqualToAnchor: anchor])
31 }
32 }
33}