Trait NSURLConnectionDownloadDelegate

Source
pub unsafe trait NSURLConnectionDownloadDelegate: NSURLConnectionDelegate {
    // Provided methods
    unsafe fn connection_didWriteData_totalBytesWritten_expectedTotalBytes(
        &self,
        connection: &NSURLConnection,
        bytes_written: c_longlong,
        total_bytes_written: c_longlong,
        expected_total_bytes: c_longlong,
    )
       where Self: Sized + Message { ... }
    unsafe fn connectionDidResumeDownloading_totalBytesWritten_expectedTotalBytes(
        &self,
        connection: &NSURLConnection,
        total_bytes_written: c_longlong,
        expected_total_bytes: c_longlong,
    )
       where Self: Sized + Message { ... }
    unsafe fn connectionDidFinishDownloading_destinationURL(
        &self,
        connection: &NSURLConnection,
        destination_url: &NSURL,
    )
       where Self: Sized + Message { ... }
}
Available on crate feature NSURLConnection only.
Expand description

Delegate methods used to perform resource downloads directly to a disk file. All the methods are optional with the exception of connectionDidFinishDownloading:destinationURL: which must be implemented in order to inform the delegate of the location of the finished download. This delegate and download implementation is currently only available on iOS 5.0 or later.

connection:didWriteData:totalBytesWritten:expectedTotalBytes: provides progress information about the state of the download, the number of bytes written since the last delegate callback, the total number of bytes written to disk and the total number of bytes that are expected (or 0 if this is unknown.)

connectionDidResumeDownloading:totalBytesWritten:expectedTotalBytes: is called when the connection is able to resume an in progress download. This may happen due to a connection or network failure.

connectionDidFinishDownloading:destinationURL: is a terminal event which indicates the completion of a download and provides the location of the file. The file will be located in the applications cache directory and is guaranteed to exist for the duration of the delegate callback. The implication is that the delegate should copy or move the download to a more persistent location if desired.

See also Apple’s documentation

Provided Methods§

Source

unsafe fn connection_didWriteData_totalBytesWritten_expectedTotalBytes( &self, connection: &NSURLConnection, bytes_written: c_longlong, total_bytes_written: c_longlong, expected_total_bytes: c_longlong, )
where Self: Sized + Message,

Source

unsafe fn connectionDidResumeDownloading_totalBytesWritten_expectedTotalBytes( &self, connection: &NSURLConnection, total_bytes_written: c_longlong, expected_total_bytes: c_longlong, )
where Self: Sized + Message,

Source

unsafe fn connectionDidFinishDownloading_destinationURL( &self, connection: &NSURLConnection, destination_url: &NSURL, )
where Self: Sized + Message,

Available on crate feature NSURL only.

Trait Implementations§

Source§

impl ProtocolType for dyn NSURLConnectionDownloadDelegate

Source§

const NAME: &'static str = "NSURLConnectionDownloadDelegate"

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 NSURLConnectionDownloadDelegate

Implementations on Foreign Types§

Source§

impl<T> NSURLConnectionDownloadDelegate for ProtocolObject<T>

Implementors§