Mercurial > templog
comparison rust/src/fridge.rs @ 628:e1b5938de122 rust
futures sink? unsure what this was
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Fri, 19 Apr 2019 13:57:40 +0800 |
parents | efcbe0d3afd6 |
children | c57821a60e51 |
comparison
equal
deleted
inserted
replaced
627:d5075136442f | 628:e1b5938de122 |
---|---|
8 use std::mem; | 8 use std::mem; |
9 use std::error::Error; | 9 use std::error::Error; |
10 use std::time::{Duration,Instant}; | 10 use std::time::{Duration,Instant}; |
11 | 11 |
12 use futures::{Future,future,Sink,Stream}; | 12 use futures::{Future,future,Sink,Stream}; |
13 use futures_sink::{Sink}; | |
13 use tokio_core::reactor::{Timeout,Handle}; | 14 use tokio_core::reactor::{Timeout,Handle}; |
14 use futures::sync::{mpsc}; | 15 use futures::sync::{mpsc}; |
15 | 16 |
16 #[cfg(target_os = "linux")] | 17 #[cfg(target_os = "linux")] |
17 use self::sysfs_gpio::{Direction, Pin}; | 18 use self::sysfs_gpio::{Direction, Pin}; |
50 | 51 |
51 type SinkItem = Message; | 52 type SinkItem = Message; |
52 type SinkError = TemplogError; | 53 type SinkError = TemplogError; |
53 | 54 |
54 fn start_send(&mut self, msg: Message) | 55 fn start_send(&mut self, msg: Message) |
55 -> futures::StartSend<Self::SinkItem, Self::SinkError> { | 56 -> Result<(), Self::SinkError> { |
56 self.process_msg(msg); | 57 self.process_msg(msg); |
57 Ok(futures::AsyncSink::Ready) | 58 Ok() |
58 } | 59 } |
59 | 60 |
60 fn poll_complete(&mut self) -> futures::Poll<(), Self::SinkError> { | 61 fn poll_complete(&mut self) -> futures::Poll<(), Self::SinkError> { |
61 Ok(futures::Async::Ready(())) | 62 Ok(futures::Async::Ready(())) |
62 } | 63 } |