pub unsafe trait NSURLProtocolClient:
NSObjectProtocol
+ Send
+ Sync {
// Provided methods
fn URLProtocol_wasRedirectedToRequest_redirectResponse(
&self,
protocol: &NSURLProtocol,
request: &NSURLRequest,
redirect_response: &NSURLResponse,
)
where Self: Sized + Message { ... }
fn URLProtocol_cachedResponseIsValid(
&self,
protocol: &NSURLProtocol,
cached_response: &NSCachedURLResponse,
)
where Self: Sized + Message { ... }
fn URLProtocol_didReceiveResponse_cacheStoragePolicy(
&self,
protocol: &NSURLProtocol,
response: &NSURLResponse,
policy: NSURLCacheStoragePolicy,
)
where Self: Sized + Message { ... }
fn URLProtocol_didLoadData(&self, protocol: &NSURLProtocol, data: &NSData)
where Self: Sized + Message { ... }
fn URLProtocolDidFinishLoading(&self, protocol: &NSURLProtocol)
where Self: Sized + Message { ... }
fn URLProtocol_didFailWithError(
&self,
protocol: &NSURLProtocol,
error: &NSError,
)
where Self: Sized + Message { ... }
fn URLProtocol_didReceiveAuthenticationChallenge(
&self,
protocol: &NSURLProtocol,
challenge: &NSURLAuthenticationChallenge,
)
where Self: Sized + Message { ... }
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§
Sourcefn URLProtocol_wasRedirectedToRequest_redirectResponse(
&self,
protocol: &NSURLProtocol,
request: &NSURLRequest,
redirect_response: &NSURLResponse,
)
Available on crate features NSURLRequest
and NSURLResponse
only.
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.
Sourcefn URLProtocol_cachedResponseIsValid(
&self,
protocol: &NSURLProtocol,
cached_response: &NSCachedURLResponse,
)
Available on crate feature NSURLCache
only.
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.
Sourcefn URLProtocol_didReceiveResponse_cacheStoragePolicy(
&self,
protocol: &NSURLProtocol,
response: &NSURLResponse,
policy: NSURLCacheStoragePolicy,
)
Available on crate features NSURLCache
and NSURLResponse
only.
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.
Sourcefn URLProtocol_didLoadData(&self, protocol: &NSURLProtocol, data: &NSData)
Available on crate feature NSData
only.
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.
Sourcefn URLProtocolDidFinishLoading(&self, protocol: &NSURLProtocol)
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.
Sourcefn URLProtocol_didFailWithError(
&self,
protocol: &NSURLProtocol,
error: &NSError,
)
Available on crate feature NSError
only.
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.
Sourcefn URLProtocol_didReceiveAuthenticationChallenge(
&self,
protocol: &NSURLProtocol,
challenge: &NSURLAuthenticationChallenge,
)
Available on crate feature NSURLAuthenticationChallenge
only.
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.
Sourcefn URLProtocol_didCancelAuthenticationChallenge(
&self,
protocol: &NSURLProtocol,
challenge: &NSURLAuthenticationChallenge,
)
Available on crate feature NSURLAuthenticationChallenge
only.
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.