Trait NSURLConnectionDelegate

Source
pub unsafe trait NSURLConnectionDelegate: NSObjectProtocol {
    // Provided methods
    unsafe fn connection_didFailWithError(
        &self,
        connection: &NSURLConnection,
        error: &NSError,
    )
       where Self: Sized + Message { ... }
    unsafe fn connectionShouldUseCredentialStorage(
        &self,
        connection: &NSURLConnection,
    ) -> bool
       where Self: Sized + Message { ... }
    unsafe fn connection_willSendRequestForAuthenticationChallenge(
        &self,
        connection: &NSURLConnection,
        challenge: &NSURLAuthenticationChallenge,
    )
       where Self: Sized + Message { ... }
    unsafe fn connection_canAuthenticateAgainstProtectionSpace(
        &self,
        connection: &NSURLConnection,
        protection_space: &NSURLProtectionSpace,
    ) -> bool
       where Self: Sized + Message { ... }
    unsafe fn connection_didReceiveAuthenticationChallenge(
        &self,
        connection: &NSURLConnection,
        challenge: &NSURLAuthenticationChallenge,
    )
       where Self: Sized + Message { ... }
    unsafe fn connection_didCancelAuthenticationChallenge(
        &self,
        connection: &NSURLConnection,
        challenge: &NSURLAuthenticationChallenge,
    )
       where Self: Sized + Message { ... }
}
Available on crate feature NSURLConnection only.
Expand description

Delegate methods that are common to all forms of NSURLConnection. These are all optional. This protocol should be considered a base class for the NSURLConnectionDataDelegate and NSURLConnectionDownloadDelegate protocols.

connection:didFailWithError: will be called at most once, if an error occurs during a resource load. No other callbacks will be made after.

connectionShouldUseCredentialStorage: will be called at most once, before a resource load begins (which means it may be called during construction of the connection.) The delegate should return TRUE if the connection should consult the shared NSURLCredentialStorage in response to authentication challenges. Regardless of the result, the authentication challenge methods may still be called.

connection:willSendRequestForAuthenticationChallenge: is the preferred (Mac OS X 10.7 and iOS 5.0 or later) mechanism for responding to authentication challenges. See <Foundation /NSURLAuthenticationChallenge.h> for more information on dealing with the various types of authentication challenges.

connection:canAuthenticateAgainstProtectionSpace: connection:didReceiveAuthenticationChallenge: connection:didCancelAuthenticationChallenge: are deprecated and new code should adopt connection:willSendRequestForAuthenticationChallenge. The older delegates will still be called for compatibility, but incur more latency in dealing with the authentication challenge.

See also Apple’s documentation

Provided Methods§

Source

unsafe fn connection_didFailWithError( &self, connection: &NSURLConnection, error: &NSError, )
where Self: Sized + Message,

Available on crate feature NSError only.
Source

unsafe fn connectionShouldUseCredentialStorage( &self, connection: &NSURLConnection, ) -> bool
where Self: Sized + Message,

Source

unsafe fn connection_willSendRequestForAuthenticationChallenge( &self, connection: &NSURLConnection, challenge: &NSURLAuthenticationChallenge, )
where Self: Sized + Message,

Available on crate feature NSURLAuthenticationChallenge only.
Source

unsafe fn connection_canAuthenticateAgainstProtectionSpace( &self, connection: &NSURLConnection, protection_space: &NSURLProtectionSpace, ) -> bool
where Self: Sized + Message,

👎Deprecated: Use -connection:willSendRequestForAuthenticationChallenge: instead.
Available on crate feature NSURLProtectionSpace only.
Source

unsafe fn connection_didReceiveAuthenticationChallenge( &self, connection: &NSURLConnection, challenge: &NSURLAuthenticationChallenge, )
where Self: Sized + Message,

👎Deprecated: Use -connection:willSendRequestForAuthenticationChallenge: instead.
Available on crate feature NSURLAuthenticationChallenge only.
Source

unsafe fn connection_didCancelAuthenticationChallenge( &self, connection: &NSURLConnection, challenge: &NSURLAuthenticationChallenge, )
where Self: Sized + Message,

👎Deprecated: Use -connection:willSendRequestForAuthenticationChallenge: instead.
Available on crate feature NSURLAuthenticationChallenge only.

Trait Implementations§

Source§

impl ProtocolType for dyn NSURLConnectionDelegate

Source§

const NAME: &'static str = "NSURLConnectionDelegate"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn NSURLConnectionDelegate

Implementations on Foreign Types§

Source§

impl<T> NSURLConnectionDelegate for ProtocolObject<T>

Implementors§