We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b24f0d4 commit 73b8257Copy full SHA for 73b8257
1 file changed
src/packed_seq.rs
@@ -1371,6 +1371,21 @@ where
1371
}
1372
1373
1374
+impl<const B: usize> PackedSeqVecBase<B>
1375
+where
1376
+ Bits<B>: SupportedBits,
1377
+{
1378
+ /// Creates a `SeqVec` from a vector of packed bytes and a length in bp.
1379
+ ///
1380
+ /// The vector should have at least 16 bytes of padding after `len`.
1381
+ /// Otherwise, the vector will be resized to be padded with zeros.
1382
+ pub fn from_raw_parts(mut seq: Vec<u8>, len: usize) -> Self {
1383
+ assert!(len <= seq.len() * Self::C8);
1384
+ seq.resize(len.div_ceil(Self::C8) + PADDING, 0);
1385
+ Self { seq, len }
1386
+ }
1387
+}
1388
+
1389
impl PackedSeqVecBase<1> {
1390
pub fn with_len(n: usize) -> Self {
1391
Self {
0 commit comments