more log refactor
This commit is contained in:
@@ -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>> {
|
||||
|
Reference in New Issue
Block a user