1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/// Returns a [`Class`](crate::objc::Class) reference with the given name.
///
/// The symbol of the class is referenced by adding a `OBJC_CLASS_$_` prefix to
/// `$name`.
/// This will not demangle This does not currently support mangled symbol names.
///
/// # Feature Flag
///
/// This macro is defined in [`objc`](objc/index.html), which requires the
/// **`objc`** [feature flag](index.html#feature-flags).
///
/// # Examples
///
/// The class name can be passed as an identifier or string literal:
///
/// ```rust
/// use fruity::objc::Class;
///
/// let class_a: &Class = fruity::objc_class!(NSObject);
/// let class_b: &Class = fruity::objc_class!("NSObject");
///
/// assert_eq!(class_a, class_b);
/// ```
///
/// If the symbol cannot be be found at link time, an error will occur:
///
/// ```compile_fail
/// # use fruity::objc::Class;
/// let class: &Class = fruity::objc_class!(NSFruity);
/// # println!("{:?}", class.name()); // must be used
/// ```
// A separate macro is used so that only the public argument patterns are showed
// in docs.