Takes any given aux and returns a string representation of it.
(aux: rust_htslib::bam::record::Aux)
| 57 | |
| 58 | /// Takes any given aux and returns a string representation of it. |
| 59 | pub(crate) fn aux_to_string(aux: rust_htslib::bam::record::Aux) -> String { |
| 60 | match aux { |
| 61 | rust_htslib::bam::record::Aux::Char(c) => String::from_utf8(vec![c]).unwrap(), |
| 62 | rust_htslib::bam::record::Aux::I8(i) => i.to_string(), |
| 63 | rust_htslib::bam::record::Aux::U8(i) => i.to_string(), |
| 64 | rust_htslib::bam::record::Aux::I16(i) => i.to_string(), |
| 65 | rust_htslib::bam::record::Aux::U16(i) => i.to_string(), |
| 66 | rust_htslib::bam::record::Aux::I32(i) => i.to_string(), |
| 67 | rust_htslib::bam::record::Aux::U32(i) => i.to_string(), |
| 68 | rust_htslib::bam::record::Aux::Float(i) => i.to_string(), |
| 69 | rust_htslib::bam::record::Aux::Double(i) => i.to_string(), |
| 70 | rust_htslib::bam::record::Aux::String(s) => s.to_owned(), |
| 71 | rust_htslib::bam::record::Aux::HexByteArray(i) => i.to_string(), |
| 72 | rust_htslib::bam::record::Aux::ArrayI8(a) => a.iter().join(","), |
| 73 | rust_htslib::bam::record::Aux::ArrayU8(a) => a.iter().join(","), |
| 74 | rust_htslib::bam::record::Aux::ArrayU16(a) => a.iter().join(","), |
| 75 | rust_htslib::bam::record::Aux::ArrayI16(a) => a.iter().join(","), |
| 76 | rust_htslib::bam::record::Aux::ArrayU32(a) => a.iter().join(","), |
| 77 | rust_htslib::bam::record::Aux::ArrayI32(a) => a.iter().join(","), |
| 78 | rust_htslib::bam::record::Aux::ArrayFloat(a) => a.iter().join(","), |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | #[allow(dead_code)] |
| 83 | pub(crate) fn ellipsis(s: &str, max_len: usize) -> String { |