Skip to content

Commit ad6a7d1

Browse files
committed
feat: implement ReadRead, WriteReady for VecDeque<u8>
1 parent e72721f commit ad6a7d1

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

embedded-io/src/impls/vec_deque.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use core::convert::Infallible;
44

55
use alloc::collections::vec_deque::VecDeque;
66

7-
use crate::{BufRead, ErrorType, Read, ReadExactError, Write};
7+
use crate::{BufRead, ErrorType, Read, ReadExactError, ReadReady, Write, WriteReady};
88

99
#[cfg_attr(docsrs, doc(cfg(any(feature = "std", feature = "alloc"))))]
1010
impl ErrorType for VecDeque<u8> {
@@ -88,3 +88,19 @@ impl Write for VecDeque<u8> {
8888
Ok(())
8989
}
9090
}
91+
92+
#[cfg_attr(docsrs, doc(cfg(any(feature = "std", feature = "alloc"))))]
93+
impl ReadReady for VecDeque<u8> {
94+
#[inline]
95+
fn read_ready(&mut self) -> Result<bool, Self::Error> {
96+
Ok(true)
97+
}
98+
}
99+
100+
#[cfg_attr(docsrs, doc(cfg(any(feature = "std", feature = "alloc"))))]
101+
impl WriteReady for VecDeque<u8> {
102+
#[inline]
103+
fn write_ready(&mut self) -> Result<bool, Self::Error> {
104+
Ok(true)
105+
}
106+
}

0 commit comments

Comments
 (0)