File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,6 +53,24 @@ pub trait BinseqRecord {
5353 Ok ( ( ) )
5454 }
5555
56+ /// Decodes the primary sequence of this record into a newly allocated buffer.
57+ ///
58+ /// Not advised to use this function as it allocates a new buffer every time.
59+ fn decode_s_alloc ( & self ) -> Result < Vec < u8 > > {
60+ let mut buf = Vec :: with_capacity ( self . slen ( ) as usize ) ;
61+ self . decode_s ( & mut buf) ?;
62+ Ok ( buf)
63+ }
64+
65+ /// Decodes the extended sequence of this record into a newly allocated buffer.
66+ ///
67+ /// Not advised to use this function as it allocates a new buffer every time.
68+ fn decode_x_alloc ( & self ) -> Result < Vec < u8 > > {
69+ let mut buf = Vec :: with_capacity ( self . xlen ( ) as usize ) ;
70+ self . decode_x ( & mut buf) ?;
71+ Ok ( buf)
72+ }
73+
5674 /// A convenience function to check if the record is paired.
5775 fn is_paired ( & self ) -> bool {
5876 self . xlen ( ) > 0
You can’t perform that action at this time.
0 commit comments