Trait NSURLProtocolClient

Source
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 { ... }
}
Available on crate feature 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§

Source

unsafe fn URLProtocol_wasRedirectedToRequest_redirectResponse( &self, protocol: &NSURLProtocol, request: &NSURLRequest, redirect_response: &NSURLResponse, )
where Self: Sized + Message,

Available on crate features 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.

Source

unsafe fn URLProtocol_cachedResponseIsValid( &self, protocol: &NSURLProtocol, cached_response: &NSCachedURLResponse, )
where Self: Sized + Message,

Available on crate feature 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.

Source

unsafe fn URLProtocol_didReceiveResponse_cacheStoragePolicy( &self, protocol: &NSURLProtocol, response: &NSURLResponse, policy: NSURLCacheStoragePolicy, )
where Self: Sized + Message,

Available on crate features 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.

Source

unsafe fn URLProtocol_didLoadData( &self, protocol: &NSURLProtocol, data: &NSData, )
where Self: Sized + Message,

Available on crate feature 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.

Source

unsafe fn URLProtocolDidFinishLoading(&self, protocol: &NSURLProtocol)
where Self: Sized + Message,

Indicates to an NSURLProtocolClient that the protocol implementation has finished loading successfully.

Parameter protocol: the NSURLProtocol object sending the message.

Source

unsafe fn URLProtocol_didFailWithError( &self, protocol: &NSURLProtocol, error: &NSError, )
where Self: Sized + Message,

Available on crate feature 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.

Source

unsafe fn URLProtocol_didReceiveAuthenticationChallenge( &self, protocol: &NSURLProtocol, challenge: &NSURLAuthenticationChallenge, )
where Self: Sized + Message,

Available on crate feature 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.

Source

unsafe fn URLProtocol_didCancelAuthenticationChallenge( &self, protocol: &NSURLProtocol, challenge: &NSURLAuthenticationChallenge, )
where Self: Sized + Message,

Available on crate feature NSURLAuthenticationChallenge only.

Cancel authentication for the specified request

Parameter protocol: The protocol object cancelling authentication.

Parameter challenge: The authentication challenge.

Trait Implementations§

Source§

impl ProtocolType for dyn NSURLProtocolClient

Source§

const NAME: &'static str = "NSURLProtocolClient"

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 NSURLProtocolClient

Implementations on Foreign Types§

Source§

impl<T> NSURLProtocolClient for ProtocolObject<T>

Implementors§