Struct bytes_stream::TryBytesChunksError
source · pub struct TryBytesChunksError<T, E>(pub T, pub E);Tuple Fields§
§0: T§1: EImplementations§
source§impl<T, E> TryBytesChunksError<T, E>
impl<T, E> TryBytesChunksError<T, E>
sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Returns the buffered data stored before the error.
let stream: stream::Iter<IntoIter<Result<Bytes, &'static str>>> =
stream::iter(vec![
Ok(Bytes::from_static(&[1, 2, 3])),
Ok(Bytes::from_static(&[4, 5, 6])),
Err("failure"),
]);
let mut stream = stream.try_bytes_chunks(4);
assert_eq!(stream.next().await, Some(Ok(Bytes::from_static(&[1, 2, 3, 4]))));
let err = stream.next().await.unwrap().err().unwrap();
assert_eq!(err.into_inner(), Bytes::from_static(&[5, 6]));Trait Implementations§
source§impl<T, E: Debug> Debug for TryBytesChunksError<T, E>
impl<T, E: Debug> Debug for TryBytesChunksError<T, E>
source§impl<T, E: Display> Display for TryBytesChunksError<T, E>
impl<T, E: Display> Display for TryBytesChunksError<T, E>
source§impl<T, E: Debug + Display> Error for TryBytesChunksError<T, E>
impl<T, E: Debug + Display> Error for TryBytesChunksError<T, E>
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl<T: PartialEq, E: PartialEq> PartialEq<TryBytesChunksError<T, E>> for TryBytesChunksError<T, E>
impl<T: PartialEq, E: PartialEq> PartialEq<TryBytesChunksError<T, E>> for TryBytesChunksError<T, E>
source§fn eq(&self, other: &TryBytesChunksError<T, E>) -> bool
fn eq(&self, other: &TryBytesChunksError<T, E>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.