icrate 0.0.1

Bindings to Apple's frameworks
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use crate::common::*;
use crate::Foundation::*;

ns_enum!(
    #[underlying(NSUInteger)]
    pub enum NSURLCredentialPersistence {
        NSURLCredentialPersistenceNone = 0,
        NSURLCredentialPersistenceForSession = 1,
        NSURLCredentialPersistencePermanent = 2,
        NSURLCredentialPersistenceSynchronizable = 3,
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSURLCredential;

    unsafe impl ClassType for NSURLCredential {
        type Super = NSObject;
    }
);

extern_methods!(
    unsafe impl NSURLCredential {
        #[method(persistence)]
        pub unsafe fn persistence(&self) -> NSURLCredentialPersistence;
    }
);

extern_methods!(
    /// NSInternetPassword
    unsafe impl NSURLCredential {
        #[method_id(@__retain_semantics Init initWithUser:password:persistence:)]
        pub unsafe fn initWithUser_password_persistence(
            this: Option<Allocated<Self>>,
            user: &NSString,
            password: &NSString,
            persistence: NSURLCredentialPersistence,
        ) -> Id<Self, Shared>;

        #[method_id(@__retain_semantics Other credentialWithUser:password:persistence:)]
        pub unsafe fn credentialWithUser_password_persistence(
            user: &NSString,
            password: &NSString,
            persistence: NSURLCredentialPersistence,
        ) -> Id<NSURLCredential, Shared>;

        #[method_id(@__retain_semantics Other user)]
        pub unsafe fn user(&self) -> Option<Id<NSString, Shared>>;

        #[method_id(@__retain_semantics Other password)]
        pub unsafe fn password(&self) -> Option<Id<NSString, Shared>>;

        #[method(hasPassword)]
        pub unsafe fn hasPassword(&self) -> bool;
    }
);

extern_methods!(
    /// NSClientCertificate
    unsafe impl NSURLCredential {
        #[method_id(@__retain_semantics Other certificates)]
        pub unsafe fn certificates(&self) -> Id<NSArray, Shared>;
    }
);

extern_methods!(
    /// NSServerTrust
    unsafe impl NSURLCredential {}
);