sigalign_core/reference/extensions/
label.rs1use super::{
2 Reference,
3 PatternIndex,
4 SequenceStorage,
5};
6
7impl<I, S> Reference<I, S> where
8 I: PatternIndex ,
9 S: SequenceStorage + LabelStorage,
10{
11 pub fn label_of_target(&self, target_index: u32) -> Option<String> {
12 if target_index < self.num_targets() {
13 Some(self.label_of_target_unchecked(target_index))
14 } else {
15 None
16 }
17 }
18 pub fn label_of_target_unchecked(&self, target_index: u32) -> String {
19 self.sequence_storage.label_of_target_unchecked(target_index)
20 }
21}
22
23pub trait LabelStorage {
25 fn label_of_target_unchecked(&self, target_index: u32) -> String;
26}