pub unsafe trait NSURLSessionTaskDelegate: NSURLSessionDelegate {
// Provided methods
fn URLSession_didCreateTask(
&self,
session: &NSURLSession,
task: &NSURLSessionTask,
)
where Self: Sized + Message { ... }
unsafe fn URLSession_task_willBeginDelayedRequest_completionHandler(
&self,
session: &NSURLSession,
task: &NSURLSessionTask,
request: &NSURLRequest,
completion_handler: &DynBlock<dyn Fn(NSURLSessionDelayedRequestDisposition, *mut NSURLRequest)>,
)
where Self: Sized + Message { ... }
fn URLSession_taskIsWaitingForConnectivity(
&self,
session: &NSURLSession,
task: &NSURLSessionTask,
)
where Self: Sized + Message { ... }
unsafe fn URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler(
&self,
session: &NSURLSession,
task: &NSURLSessionTask,
response: &NSHTTPURLResponse,
request: &NSURLRequest,
completion_handler: &DynBlock<dyn Fn(*mut NSURLRequest)>,
)
where Self: Sized + Message { ... }
unsafe fn URLSession_task_didReceiveChallenge_completionHandler(
&self,
session: &NSURLSession,
task: &NSURLSessionTask,
challenge: &NSURLAuthenticationChallenge,
completion_handler: &DynBlock<dyn Fn(NSURLSessionAuthChallengeDisposition, *mut NSURLCredential)>,
)
where Self: Sized + Message { ... }
unsafe fn URLSession_task_needNewBodyStream(
&self,
session: &NSURLSession,
task: &NSURLSessionTask,
completion_handler: &DynBlock<dyn Fn(*mut NSInputStream)>,
)
where Self: Sized + Message { ... }
unsafe fn URLSession_task_needNewBodyStreamFromOffset_completionHandler(
&self,
session: &NSURLSession,
task: &NSURLSessionTask,
offset: i64,
completion_handler: &DynBlock<dyn Fn(*mut NSInputStream)>,
)
where Self: Sized + Message { ... }
fn URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend(
&self,
session: &NSURLSession,
task: &NSURLSessionTask,
bytes_sent: i64,
total_bytes_sent: i64,
total_bytes_expected_to_send: i64,
)
where Self: Sized + Message { ... }
fn URLSession_task_didReceiveInformationalResponse(
&self,
session: &NSURLSession,
task: &NSURLSessionTask,
response: &NSHTTPURLResponse,
)
where Self: Sized + Message { ... }
fn URLSession_task_didFinishCollectingMetrics(
&self,
session: &NSURLSession,
task: &NSURLSessionTask,
metrics: &NSURLSessionTaskMetrics,
)
where Self: Sized + Message { ... }
fn URLSession_task_didCompleteWithError(
&self,
session: &NSURLSession,
task: &NSURLSessionTask,
error: Option<&NSError>,
)
where Self: Sized + Message { ... }
}Available on crate feature
NSURLSession only.Expand description
Provided Methods§
fn URLSession_didCreateTask( &self, session: &NSURLSession, task: &NSURLSessionTask, )
Sourceunsafe fn URLSession_task_willBeginDelayedRequest_completionHandler(
&self,
session: &NSURLSession,
task: &NSURLSessionTask,
request: &NSURLRequest,
completion_handler: &DynBlock<dyn Fn(NSURLSessionDelayedRequestDisposition, *mut NSURLRequest)>,
)
Available on crate features block2 and NSURLRequest only.
unsafe fn URLSession_task_willBeginDelayedRequest_completionHandler( &self, session: &NSURLSession, task: &NSURLSessionTask, request: &NSURLRequest, completion_handler: &DynBlock<dyn Fn(NSURLSessionDelayedRequestDisposition, *mut NSURLRequest)>, )
block2 and NSURLRequest only.§Safety
completion_handler block must be sendable.
fn URLSession_taskIsWaitingForConnectivity( &self, session: &NSURLSession, task: &NSURLSessionTask, )
Sourceunsafe fn URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler(
&self,
session: &NSURLSession,
task: &NSURLSessionTask,
response: &NSHTTPURLResponse,
request: &NSURLRequest,
completion_handler: &DynBlock<dyn Fn(*mut NSURLRequest)>,
)
Available on crate features block2 and NSURLRequest and NSURLResponse only.
unsafe fn URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler( &self, session: &NSURLSession, task: &NSURLSessionTask, response: &NSHTTPURLResponse, request: &NSURLRequest, completion_handler: &DynBlock<dyn Fn(*mut NSURLRequest)>, )
block2 and NSURLRequest and NSURLResponse only.§Safety
completion_handler block must be sendable.
Sourceunsafe fn URLSession_task_didReceiveChallenge_completionHandler(
&self,
session: &NSURLSession,
task: &NSURLSessionTask,
challenge: &NSURLAuthenticationChallenge,
completion_handler: &DynBlock<dyn Fn(NSURLSessionAuthChallengeDisposition, *mut NSURLCredential)>,
)
Available on crate features block2 and NSURLAuthenticationChallenge and NSURLCredential only.
unsafe fn URLSession_task_didReceiveChallenge_completionHandler( &self, session: &NSURLSession, task: &NSURLSessionTask, challenge: &NSURLAuthenticationChallenge, completion_handler: &DynBlock<dyn Fn(NSURLSessionAuthChallengeDisposition, *mut NSURLCredential)>, )
block2 and NSURLAuthenticationChallenge and NSURLCredential only.§Safety
completion_handler block must be sendable.
Sourceunsafe fn URLSession_task_needNewBodyStream(
&self,
session: &NSURLSession,
task: &NSURLSessionTask,
completion_handler: &DynBlock<dyn Fn(*mut NSInputStream)>,
)
Available on crate features block2 and NSStream only.
unsafe fn URLSession_task_needNewBodyStream( &self, session: &NSURLSession, task: &NSURLSessionTask, completion_handler: &DynBlock<dyn Fn(*mut NSInputStream)>, )
block2 and NSStream only.§Safety
completion_handler block must be sendable.
Sourceunsafe fn URLSession_task_needNewBodyStreamFromOffset_completionHandler(
&self,
session: &NSURLSession,
task: &NSURLSessionTask,
offset: i64,
completion_handler: &DynBlock<dyn Fn(*mut NSInputStream)>,
)
Available on crate features block2 and NSStream only.
unsafe fn URLSession_task_needNewBodyStreamFromOffset_completionHandler( &self, session: &NSURLSession, task: &NSURLSessionTask, offset: i64, completion_handler: &DynBlock<dyn Fn(*mut NSInputStream)>, )
block2 and NSStream only.Tells the delegate if a task requires a new body stream starting from the given offset. This may be necessary when resuming a failed upload task.
- Parameter session: The session containing the task that needs a new body stream from the given offset.
- Parameter task: The task that needs a new body stream.
- Parameter offset: The starting offset required for the body stream.
- Parameter completionHandler: A completion handler that your delegate method should call with the new body stream.
§Safety
completion_handler block must be sendable.
fn URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend( &self, session: &NSURLSession, task: &NSURLSessionTask, bytes_sent: i64, total_bytes_sent: i64, total_bytes_expected_to_send: i64, )
fn URLSession_task_didReceiveInformationalResponse( &self, session: &NSURLSession, task: &NSURLSessionTask, response: &NSHTTPURLResponse, )
Available on crate feature
NSURLResponse only.fn URLSession_task_didFinishCollectingMetrics( &self, session: &NSURLSession, task: &NSURLSessionTask, metrics: &NSURLSessionTaskMetrics, )
fn URLSession_task_didCompleteWithError( &self, session: &NSURLSession, task: &NSURLSessionTask, error: Option<&NSError>, )
Available on crate feature
NSError only.Trait Implementations§
impl<T> ImplementedBy<T> for dyn NSURLSessionTaskDelegate
Source§impl ProtocolType for dyn NSURLSessionTaskDelegate
impl ProtocolType for dyn NSURLSessionTaskDelegate
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".