objc2_map_kit/generated/
MKDirections.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[cfg(all(feature = "MKDirectionsResponse", feature = "block2"))]
12pub type MKDirectionsHandler =
13 *mut block2::DynBlock<dyn Fn(*mut MKDirectionsResponse, *mut NSError)>;
14
15#[cfg(all(feature = "MKDirectionsResponse", feature = "block2"))]
17pub type MKETAHandler = *mut block2::DynBlock<dyn Fn(*mut MKETAResponse, *mut NSError)>;
18
19extern_class!(
20 #[unsafe(super(NSObject))]
22 #[derive(Debug, PartialEq, Eq, Hash)]
23 pub struct MKDirections;
24);
25
26extern_conformance!(
27 unsafe impl NSObjectProtocol for MKDirections {}
28);
29
30impl MKDirections {
31 extern_methods!(
32 #[cfg(feature = "MKDirectionsRequest")]
33 #[unsafe(method(initWithRequest:))]
34 #[unsafe(method_family = init)]
35 pub unsafe fn initWithRequest(
36 this: Allocated<Self>,
37 request: &MKDirectionsRequest,
38 ) -> Retained<Self>;
39
40 #[cfg(all(feature = "MKDirectionsResponse", feature = "block2"))]
41 #[unsafe(method(calculateDirectionsWithCompletionHandler:))]
45 #[unsafe(method_family = none)]
46 pub unsafe fn calculateDirectionsWithCompletionHandler(
47 &self,
48 completion_handler: MKDirectionsHandler,
49 );
50
51 #[cfg(all(feature = "MKDirectionsResponse", feature = "block2"))]
52 #[unsafe(method(calculateETAWithCompletionHandler:))]
56 #[unsafe(method_family = none)]
57 pub unsafe fn calculateETAWithCompletionHandler(&self, completion_handler: MKETAHandler);
58
59 #[unsafe(method(cancel))]
60 #[unsafe(method_family = none)]
61 pub unsafe fn cancel(&self);
62
63 #[unsafe(method(isCalculating))]
64 #[unsafe(method_family = none)]
65 pub unsafe fn isCalculating(&self) -> bool;
66 );
67}
68
69impl MKDirections {
71 extern_methods!(
72 #[unsafe(method(init))]
73 #[unsafe(method_family = init)]
74 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
75
76 #[unsafe(method(new))]
77 #[unsafe(method_family = new)]
78 pub unsafe fn new() -> Retained<Self>;
79 );
80}