fn parse(buffer: &mut Buffer<'a>) -> Result<Transaction<'a>, EndOfBufferError> {

        let org_buffer = *buffer;

        let version         = i32::parse(buffer)?;
        let txs_in          = Vec::parse(buffer)?;
        let (txs_out,idxs)  = buffer.parse_vec_with_indices(org_buffer)?;
        let lock_time       = u32::parse(buffer)?;

        Ok(Transaction {
            version:   version,
            txs_in:    txs_in,
            txs_out:   txs_out,
            txs_out_idx: idxs,
            lock_time: lock_time,
            raw:       buffer.consumed_since(org_buffer)

        })
    }
/// Parses the raw bytes into individual fields
/// and perform basic syntax checks
Parses the raw bytes into individual fields
and perform basic syntax checks
Parses the raw bytes into individual fields and perform basic syntax checks
fn parse(buffer: &mut Buffer<'a>) -> Result<Transaction<'a>, EndOfBufferError> {
        let org_buffer = *buffer;
        let version         = i32::parse(buffer)?;
        let txs_in          = Vec::parse(buffer)?;
        let (txs_out,idxs)  = buffer.parse_vec_with_indices(org_buffer)?;
        let lock_time       = u32::parse(buffer)?;
        Ok(Transaction {
            version:   version,
            txs_in:    txs_in,
            txs_out:   txs_out,
            txs_out_idx: idxs,
            lock_time: lock_time,
            raw:       buffer.consumed_since(org_buffer)
        })
    }
fn parse ( buffer : & mut Buffer < ' a > ) -> Result < Transaction < ' a > , EndOfBufferError > { let org_buffer = * buffer ; let version = i32 :: parse ( buffer ) ? ; let txs_in = Vec :: parse ( buffer ) ? ; let ( txs_out , idxs ) = buffer . parse_vec_with_indices ( org_buffer ) ? ; let lock_time = u32 :: parse ( buffer ) ? ; Ok ( Transaction { version : version , txs_in : txs_in , txs_out : txs_out , txs_out_idx : idxs , lock_time : lock_time , raw : buffer . consumed_since ( org_buffer ) } ) }
Parses the raw bytes into individual fields
and perform basic syntax checks
Parses the raw bytes into individual fields and perform basic syntax checks
buffer
&mut Buffer<'a>
buffer
&mut Buffer<'a>