mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 01:25:27 +00:00
use Cancellable from response
This commit is contained in:
parent
9d45688314
commit
bb4ddbdddd
3 changed files with 15 additions and 14 deletions
|
|
@ -76,6 +76,7 @@ impl Driver {
|
|||
Ok(response) => callback(Response::Download {
|
||||
base: uri.clone(),
|
||||
stream: response.connection.stream(),
|
||||
cancellable: cancellable.clone(),
|
||||
}),
|
||||
Err(e) => callback(Response::Failure(response::Failure::Error {
|
||||
message: e.to_string(),
|
||||
|
|
@ -192,6 +193,7 @@ fn handle_gemini(
|
|||
base,
|
||||
mime,
|
||||
stream: response.connection.stream(),
|
||||
cancellable,
|
||||
})
|
||||
}
|
||||
mime => callback(Response::Failure(response::Failure::Mime {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ pub use failure::Failure;
|
|||
pub use input::Input;
|
||||
|
||||
use gtk::{
|
||||
gio::IOStream,
|
||||
gio::{Cancellable, IOStream},
|
||||
glib::{GString, Uri},
|
||||
};
|
||||
|
||||
|
|
@ -16,6 +16,7 @@ pub enum Response {
|
|||
Download {
|
||||
base: Uri,
|
||||
stream: IOStream,
|
||||
cancellable: Cancellable,
|
||||
},
|
||||
Failure(Failure),
|
||||
Gemtext {
|
||||
|
|
@ -32,5 +33,6 @@ pub enum Response {
|
|||
base: Uri,
|
||||
mime: String,
|
||||
stream: IOStream,
|
||||
cancellable: Cancellable,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue