objc2-local-authentication 0.3.2

Bindings to the LocalAuthentication framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// Generic secret
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/localauthentication/lasecret?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct LASecret;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for LASecret {}
);

impl LASecret {
    extern_methods!(
        #[cfg(feature = "block2")]
        /// Fetch stored data if any
        ///
        /// Parameter `handler`: Completion handler invoked with a generic secret stored along with the right or an error if no secret is found or the fetch operation fails.
        ///
        /// # Safety
        ///
        /// `handler` block must be sendable.
        #[unsafe(method(loadDataWithCompletion:))]
        #[unsafe(method_family = none)]
        pub unsafe fn loadDataWithCompletion(
            &self,
            handler: &block2::DynBlock<dyn Fn(*mut NSData, *mut NSError)>,
        );

        /// Clients cannot create
        /// `LASecret`instances directly. They typically obtain them from a
        /// `LAPersistedRight`instance.
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;

        /// Clients cannot create
        /// `LASecret`instances directly. They typically obtain them from a
        /// `LAPersistedRight`instance.
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}