pub unsafe trait NSURLProtocolClient: NSObjectProtocol {
// Provided methods
unsafe fn URLProtocol_wasRedirectedToRequest_redirectResponse(
&self,
protocol: &NSURLProtocol,
request: &NSURLRequest,
redirect_response: &NSURLResponse,
)
where Self: Sized + Message { ... }
unsafe fn URLProtocol_cachedResponseIsValid(
&self,
protocol: &NSURLProtocol,
cached_response: &NSCachedURLResponse,
)
where Self: Sized + Message { ... }
unsafe fn URLProtocol_didReceiveResponse_cacheStoragePolicy(
&self,
protocol: &NSURLProtocol,
response: &NSURLResponse,
policy: NSURLCacheStoragePolicy,
)
where Self: Sized + Message { ... }
unsafe fn URLProtocol_didLoadData(
&self,
protocol: &NSURLProtocol,
data: &NSData,
)
where Self: Sized + Message { ... }
unsafe fn URLProtocolDidFinishLoading(&self, protocol: &NSURLProtocol)
where Self: Sized + Message { ... }
unsafe fn URLProtocol_didFailWithError(
&self,
protocol: &NSURLProtocol,
error: &NSError,
)
where Self: Sized + Message { ... }
unsafe fn URLProtocol_didReceiveAuthenticationChallenge(
&self,
protocol: &NSURLProtocol,
challenge: &NSURLAuthenticationChallenge,
)
where Self: Sized + Message { ... }
unsafe fn URLProtocol_didCancelAuthenticationChallenge(
&self,
protocol: &NSURLProtocol,
challenge: &NSURLAuthenticationChallenge,
)
where Self: Sized + Message { ... }
}
NSURLProtocol
only.Expand description
NSURLProtocolClient provides the interface to the URL loading system that is intended for use by NSURLProtocol implementors.
See also Apple’s documentation
Provided Methods§
Sourceunsafe fn URLProtocol_wasRedirectedToRequest_redirectResponse(
&self,
protocol: &NSURLProtocol,
request: &NSURLRequest,
redirect_response: &NSURLResponse,
)
Available on crate features NSURLRequest
and NSURLResponse
only.
unsafe fn URLProtocol_wasRedirectedToRequest_redirectResponse( &self, protocol: &NSURLProtocol, request: &NSURLRequest, redirect_response: &NSURLResponse, )
NSURLRequest
and NSURLResponse
only.Indicates to an NSURLProtocolClient that a redirect has occurred.
Parameter protocol
: the NSURLProtocol object sending the message.
Parameter request
: the NSURLRequest to which the protocol implementation
has redirected.
Sourceunsafe fn URLProtocol_cachedResponseIsValid(
&self,
protocol: &NSURLProtocol,
cached_response: &NSCachedURLResponse,
)
Available on crate feature NSURLCache
only.
unsafe fn URLProtocol_cachedResponseIsValid( &self, protocol: &NSURLProtocol, cached_response: &NSCachedURLResponse, )
NSURLCache
only.Indicates to an NSURLProtocolClient that the protocol implementation has examined a cached response and has determined that it is valid.
Parameter protocol
: the NSURLProtocol object sending the message.
Parameter cachedResponse
: the NSCachedURLResponse object that has
examined and is valid.
Sourceunsafe fn URLProtocol_didReceiveResponse_cacheStoragePolicy(
&self,
protocol: &NSURLProtocol,
response: &NSURLResponse,
policy: NSURLCacheStoragePolicy,
)
Available on crate features NSURLCache
and NSURLResponse
only.
unsafe fn URLProtocol_didReceiveResponse_cacheStoragePolicy( &self, protocol: &NSURLProtocol, response: &NSURLResponse, policy: NSURLCacheStoragePolicy, )
NSURLCache
and NSURLResponse
only.Indicates to an NSURLProtocolClient that the protocol implementation has created an NSURLResponse for the current load.
Parameter protocol
: the NSURLProtocol object sending the message.
Parameter response
: the NSURLResponse object the protocol implementation
has created.
Parameter policy
: The NSURLCacheStoragePolicy the protocol
has determined should be used for the given response if the
response is to be stored in a cache.
Sourceunsafe fn URLProtocol_didLoadData(
&self,
protocol: &NSURLProtocol,
data: &NSData,
)
Available on crate feature NSData
only.
unsafe fn URLProtocol_didLoadData( &self, protocol: &NSURLProtocol, data: &NSData, )
NSData
only.Indicates to an NSURLProtocolClient that the protocol implementation has loaded URL data.
The data object must contain only new data loaded since the previous call to this method (if any), not cumulative data for the entire load.
Parameter protocol
: the NSURLProtocol object sending the message.
Parameter data
: URL load data being made available.
Sourceunsafe fn URLProtocolDidFinishLoading(&self, protocol: &NSURLProtocol)
unsafe fn URLProtocolDidFinishLoading(&self, protocol: &NSURLProtocol)
Indicates to an NSURLProtocolClient that the protocol implementation has finished loading successfully.
Parameter protocol
: the NSURLProtocol object sending the message.
Sourceunsafe fn URLProtocol_didFailWithError(
&self,
protocol: &NSURLProtocol,
error: &NSError,
)
Available on crate feature NSError
only.
unsafe fn URLProtocol_didFailWithError( &self, protocol: &NSURLProtocol, error: &NSError, )
NSError
only.Indicates to an NSURLProtocolClient that the protocol implementation has failed to load successfully.
Parameter protocol
: the NSURLProtocol object sending the message.
Parameter error
: The error that caused the load to fail.
Sourceunsafe fn URLProtocol_didReceiveAuthenticationChallenge(
&self,
protocol: &NSURLProtocol,
challenge: &NSURLAuthenticationChallenge,
)
Available on crate feature NSURLAuthenticationChallenge
only.
unsafe fn URLProtocol_didReceiveAuthenticationChallenge( &self, protocol: &NSURLProtocol, challenge: &NSURLAuthenticationChallenge, )
NSURLAuthenticationChallenge
only.Start authentication for the specified request
Parameter protocol
: The protocol object requesting authentication.
Parameter challenge
: The authentication challenge.
The protocol client guarantees that it will answer the request on the same thread that called this method. It may add a default credential to the challenge it issues to the connection delegate, if the protocol did not provide one.
Sourceunsafe fn URLProtocol_didCancelAuthenticationChallenge(
&self,
protocol: &NSURLProtocol,
challenge: &NSURLAuthenticationChallenge,
)
Available on crate feature NSURLAuthenticationChallenge
only.
unsafe fn URLProtocol_didCancelAuthenticationChallenge( &self, protocol: &NSURLProtocol, challenge: &NSURLAuthenticationChallenge, )
NSURLAuthenticationChallenge
only.Cancel authentication for the specified request
Parameter protocol
: The protocol object cancelling authentication.
Parameter challenge
: The authentication challenge.