more log refactor

This commit is contained in:
John Smith
2021-12-17 19:18:25 -05:00
parent 46f8607998
commit 971fa94751
17 changed files with 283 additions and 237 deletions

View File

@@ -1,5 +1,6 @@
use crate::xx::*;
use alloc::collections::VecDeque;
use core::fmt;
#[derive(Debug)]
pub struct Channel<T> {
@@ -58,6 +59,19 @@ pub enum TrySendError<T> {
Disconnected(T),
}
impl<T> fmt::Display for TrySendError<T> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
TrySendError::Full(_) => {
write!(f, "Full")
}
TrySendError::Disconnected(_) => {
write!(f, "Disconnected")
}
}
}
}
impl<T> Sender<T> {
// NOTE: This needs a timeout or you could block a very long time
// pub async fn send(&self, msg: T) -> Result<(), SendError<T>> {