1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
pub mod errors;
pub mod messages;
use errors::ButtplugError;
use futures::future::{self, BoxFuture};
pub type ButtplugResult = Result<(), ButtplugError>;
pub type ButtplugResultFuture = BoxFuture<'static, ButtplugResult>;
impl<T> From<ButtplugError> for BoxFuture<'static, Result<T, ButtplugError>>
where
T: Send + 'static,
{
fn from(error: ButtplugError) -> BoxFuture<'static, Result<T, ButtplugError>> {
Box::pin(future::ready(Err(error)))
}
}