Struct bitcoin_primitives::VectorWriter
source · pub struct VectorWriter { /* private fields */ }Expand description
| Minimal stream for overwriting and/or | appending to an existing byte vector | | The referenced vector will grow as necessary |
Implementations§
source§impl VectorWriter
impl VectorWriter
sourcepub fn new(
n_type_in: i32,
n_version_in: i32,
vch_data_in: &mut Vec<u8>,
n_pos_in: usize
) -> Self
pub fn new( n_type_in: i32, n_version_in: i32, vch_data_in: &mut Vec<u8>, n_pos_in: usize ) -> Self
| @param[in] nTypeIn | | Serialization Type | ––––– | @param[in] nVersionIn | | Serialization Version (including | any flags) | ––––– | @param[in] vchDataIn | | Referenced byte vector to overwrite/append | ––––– | @param[in] nPosIn | | Starting position. Vector index where | writes should start. The vector will | initially grow as necessary to max(nPosIn, | vec.size()). So to append, use vec.size(). |
sourcepub fn new_with_args<Args>(
n_type_in: i32,
n_version_in: i32,
vch_data_in: &mut Vec<u8>,
n_pos_in: usize,
args: Args
) -> Self
pub fn new_with_args<Args>( n_type_in: i32, n_version_in: i32, vch_data_in: &mut Vec<u8>, n_pos_in: usize, args: Args ) -> Self
| (other params same as above) | | ———– | @param[in] args | | A list of items to serialize starting | at nPosIn. |
pub fn write(&mut self, pch: *const u8, n_size: usize)
pub fn get_version(&self) -> i32
pub fn get_type(&self) -> i32
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for VectorWriter
impl !Send for VectorWriter
impl !Sync for VectorWriter
impl Unpin for VectorWriter
impl !UnwindSafe for VectorWriter
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