pub struct SendError<T>(pub T);Expand description
Error returned when attempting to send to a full queue.
Contains the value that couldn’t be sent, allowing recovery.
§Examples
use turbo_mpmc::{Queue, SendError};
let queue = Queue::<i32, 4>::new();
// Fill the queue
for i in 0..4 {
queue.try_send(i).unwrap();
}
// Queue is full, get the value back
match queue.try_send(42) {
Err(SendError(value)) => assert_eq!(value, 42),
Ok(_) => panic!("Should have failed"),
}Tuple Fields§
§0: TTrait Implementations§
impl<T: Copy> Copy for SendError<T>
impl<T: Eq> Eq for SendError<T>
impl<T> StructuralPartialEq for SendError<T>
Auto Trait Implementations§
impl<T> Freeze for SendError<T>where
T: Freeze,
impl<T> RefUnwindSafe for SendError<T>where
T: RefUnwindSafe,
impl<T> Send for SendError<T>where
T: Send,
impl<T> Sync for SendError<T>where
T: Sync,
impl<T> Unpin for SendError<T>where
T: Unpin,
impl<T> UnwindSafe for SendError<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more