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 { ... }
}
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§
unsafe fn connection_didFailWithError( &self, connection: &NSURLConnection, error: &NSError, )
NSError
only.unsafe fn connectionShouldUseCredentialStorage( &self, connection: &NSURLConnection, ) -> bool
unsafe fn connection_willSendRequestForAuthenticationChallenge( &self, connection: &NSURLConnection, challenge: &NSURLAuthenticationChallenge, )
NSURLAuthenticationChallenge
only.unsafe fn connection_canAuthenticateAgainstProtectionSpace( &self, connection: &NSURLConnection, protection_space: &NSURLProtectionSpace, ) -> bool
NSURLProtectionSpace
only.unsafe fn connection_didReceiveAuthenticationChallenge( &self, connection: &NSURLConnection, challenge: &NSURLAuthenticationChallenge, )
NSURLAuthenticationChallenge
only.unsafe fn connection_didCancelAuthenticationChallenge( &self, connection: &NSURLConnection, challenge: &NSURLAuthenticationChallenge, )
NSURLAuthenticationChallenge
only.