pub struct BlockFlags {
pub queries: Option<Vec<Vec<u8>>>,
pub query_ids: Option<Vec<u32>>,
}Expand description
Data about the records in this block
Variable length, use BlockHeader.flags_len to get size
May contain these fields:
queries: Names of the query sequences in the original query file.query_ids: Indexes of the query sequences in the original query file.
If both queries and query_ids are given, they must be in the same order,
ie. the data in both arrays at the same index corresponds to the same
record.
The current implementation of ahda assumes that query_ids is always
present and filled.
Fields§
§queries: Option<Vec<Vec<u8>>>Names of query records in the original query file.
query_ids: Option<Vec<u32>>Indexes of the query records in the original query file.
Implementations§
Source§impl BlockFlags
impl BlockFlags
Sourcepub fn fields_present(&self) -> u16
pub fn fields_present(&self) -> u16
Get the fields_present value to store in this block’s BlockHeader.
§Usage
use ahda::headers::block::BlockFlags;
let mut flags = BlockFlags {
queries: None,
query_ids: None,
};
assert_eq!(flags.fields_present(), 0_u16);
flags.queries = Some(vec![]);
assert_eq!(flags.fields_present(), 1_u16);
flags.query_ids = Some(vec![]);
assert_eq!(flags.fields_present(), 3_u16);
flags.queries = None;
assert_eq!(flags.fields_present(), 2_u16);Trait Implementations§
Source§impl<'__de, __Context> BorrowDecode<'__de, __Context> for BlockFlags
impl<'__de, __Context> BorrowDecode<'__de, __Context> for BlockFlags
Source§fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>(
decoder: &mut __D,
) -> Result<Self, DecodeError>
fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>( decoder: &mut __D, ) -> Result<Self, DecodeError>
Attempt to decode this type with the given BorrowDecode.
Source§impl Clone for BlockFlags
impl Clone for BlockFlags
Source§fn clone(&self) -> BlockFlags
fn clone(&self) -> BlockFlags
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BlockFlags
impl Debug for BlockFlags
Source§impl<__Context> Decode<__Context> for BlockFlags
impl<__Context> Decode<__Context> for BlockFlags
Source§impl Encode for BlockFlags
impl Encode for BlockFlags
Source§impl PartialEq for BlockFlags
impl PartialEq for BlockFlags
impl StructuralPartialEq for BlockFlags
Auto Trait Implementations§
impl Freeze for BlockFlags
impl RefUnwindSafe for BlockFlags
impl Send for BlockFlags
impl Sync for BlockFlags
impl Unpin for BlockFlags
impl UnsafeUnpin for BlockFlags
impl UnwindSafe for BlockFlags
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more