no_std support + unpack function
use alloc::string::ToString;
use alloc::vec::Vec;
use core::convert::TryInto;
+use core::ops::Deref;
use crate::io::{Read, Write};
use crate::message;
use crate::private::units::BYTES_PER_WORD;
use crate::{Error, Result};
-use std::ops::Deref;
/// Segments read from a single flat slice of words.
pub struct SliceSegments<'a> {
@@ -124,6 +124,10 @@ impl<T: Deref<Target = [u8]>> BufferSegments<T> {
segment_indices,
})
}
+
+ pub fn to_buffer(self) -> T {
+ self.buffer
+ }
}
impl <T: Deref<Target = [u8]>> message::ReaderSegments for BufferSegments<T> {
