|
|
@ -75,13 +75,13 @@ impl<T: IsA<gio::IOStream>> IOStreamAsyncReadWrite<T> { |
|
|
|
/// Create a new `gio::IOStream` adapter
|
|
|
|
/// Create a new `gio::IOStream` adapter
|
|
|
|
fn new(stream: T) -> Result<IOStreamAsyncReadWrite<T>, T> { |
|
|
|
fn new(stream: T) -> Result<IOStreamAsyncReadWrite<T>, T> { |
|
|
|
let write = stream |
|
|
|
let write = stream |
|
|
|
.get_output_stream() |
|
|
|
.output_stream() |
|
|
|
.and_then(|s| s.dynamic_cast::<gio::PollableOutputStream>().ok()) |
|
|
|
.dynamic_cast::<gio::PollableOutputStream>().ok() |
|
|
|
.and_then(|s| s.into_async_write().ok()); |
|
|
|
.and_then(|s| s.into_async_write().ok()); |
|
|
|
|
|
|
|
|
|
|
|
let read = stream |
|
|
|
let read = stream |
|
|
|
.get_input_stream() |
|
|
|
.input_stream() |
|
|
|
.and_then(|s| s.dynamic_cast::<gio::PollableInputStream>().ok()) |
|
|
|
.dynamic_cast::<gio::PollableInputStream>().ok() |
|
|
|
.and_then(|s| s.into_async_read().ok()); |
|
|
|
.and_then(|s| s.into_async_read().ok()); |
|
|
|
|
|
|
|
|
|
|
|
let (read, write) = match (read, write) { |
|
|
|
let (read, write) = match (read, write) { |
|
|
|