ble-peripheral-rust 0.2.0

A cross-platform Rust crate for building Bluetooth Low Energy peripherals
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::error::{Error, ErrorType};
use tokio::sync::{mpsc, oneshot};

impl<T> From<mpsc::error::SendError<T>> for Error {
    fn from(err: mpsc::error::SendError<T>) -> Self {
        Error::from_string(err.to_string(), ErrorType::ChannelError)
    }
}

impl From<oneshot::error::RecvError> for Error {
    fn from(err: oneshot::error::RecvError) -> Self {
        Error::from_string(err.to_string(), ErrorType::ChannelError)
    }
}