Struct bitcoin_primitives::DataStream
source · pub struct DataStream { /* private fields */ }Expand description
| Double ended buffer combining vector | and stream-like interfaces. >> and | << read and write unformatted data using | the above serialization templates. | | Fills with data in linear time; some | stringstream implementations take | N^2 time. |
Implementations§
source§impl DataStream
impl DataStream
pub fn new(n_type_in: i32, n_version_in: i32) -> Self
pub fn new_with_slice(sp: &[u8], n_type_in: i32, n_version_in: i32) -> Self
pub fn new_with_args<Args>( n_type_in: i32, n_version_in: i32, args: Args ) -> Self
pub fn str_(&self) -> String
pub fn begin(&self) -> Box<dyn Iterator<Item = u8>>
pub fn begin_mut(&mut self) -> Box<dyn Iterator<Item = u8>>
pub fn end(&self) -> Box<dyn Iterator<Item = u8>>
pub fn end_mut(&mut self) -> Box<dyn Iterator<Item = u8>>
pub fn size(&self) -> usize
pub fn empty(&self) -> bool
pub fn resize(&mut self, n: usize, c: Option<u8>)
pub fn reserve(&mut self, n: usize)
pub fn clear(&mut self)
pub fn insert_item( &mut self, it: Box<dyn Iterator<Item = u8>>, x: u8 ) -> Box<dyn Iterator<Item = u8>>
pub fn insert_multi( &mut self, it: Box<dyn Iterator<Item = u8>>, n: usize, x: u8 )
pub fn as_slice(&self) -> &[u8] ⓘ
pub fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
pub fn data_mut(&mut self) -> *mut u8
pub fn data(&self) -> *const u8
pub fn insert_with_iterator_range( &mut self, it: Box<dyn Iterator<Item = u8>>, first: Box<dyn Iterator<Item = u8>>, last: Box<dyn Iterator<Item = u8>> )
pub fn insert_with_pointer_range( &mut self, it: Box<dyn Iterator<Item = u8>>, first: *const u8, last: *const u8 )
pub fn erase( &mut self, it: Box<dyn Iterator<Item = u8>> ) -> Box<dyn Iterator<Item = u8>>
pub fn erase_range( &mut self, first: Box<dyn Iterator<Item = u8>>, last: Box<dyn Iterator<Item = u8>> ) -> Box<dyn Iterator<Item = u8>>
pub fn compact(&mut self)
pub fn rewind(&mut self, n: Option<usize>) -> bool
pub fn eof(&self) -> bool
pub fn rdbuf(&mut self) -> *mut DataStream
pub fn in_avail(&self) -> i32
pub fn set_type(&mut self, n: i32)
pub fn get_type(&self) -> i32
pub fn set_version(&mut self, n: i32)
pub fn get_version(&self) -> i32
pub fn read(&mut self, pch: *mut u8, n_size: usize)
pub fn ignore(&mut self, n_size: i32)
pub fn write(&mut self, pch: *const u8, n_size: usize)
pub fn serialize<Stream>(&self, s: &mut Stream)
Trait Implementations§
source§impl Index<usize> for DataStream
impl Index<usize> for DataStream
source§impl IndexMut<usize> for DataStream
impl IndexMut<usize> for DataStream
source§impl StreamInto for DataStream
impl StreamInto for DataStream
fn stream_into<Item>(&self, rhs: &mut Item)
source§impl StreamItems for DataStream
impl StreamItems for DataStream
Auto Trait Implementations§
impl RefUnwindSafe for DataStream
impl Send for DataStream
impl Sync for DataStream
impl Unpin for DataStream
impl UnwindSafe for DataStream
Blanket Implementations§
§impl<T, U> CastInto<U> for Twhere
U: CastFrom<T>,
impl<T, U> CastInto<U> for Twhere U: CastFrom<T>,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> StaticUpcast<T> for T
impl<T> StaticUpcast<T> for T
§unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>
unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>
Convert type of a const pointer. Read more