pub struct Attributes {
pub pairs: Vec<(String, String)>,
}Expand description
An ordered list of GFF3 attribute key/value pairs.
GFF3 allows multi-valued attributes (comma-separated). We keep the raw value
string as-is; callers that care about multiplicity (e.g. Parent) can split
on commas themselves.
Fields§
§pairs: Vec<(String, String)>Implementations§
Source§impl Attributes
impl Attributes
Sourcepub fn parse_gff3(col: &str) -> Self
pub fn parse_gff3(col: &str) -> Self
Parse a GFF3 attribute column. Empty / “.” columns yield no pairs.
pub fn get(&self, key: &str) -> Option<&str>
Sourcepub fn first(&self, key: &str) -> Option<&str>
pub fn first(&self, key: &str) -> Option<&str>
First value of a potentially multi-valued attribute (split on comma).
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for Attributes
impl Clone for Attributes
Source§fn clone(&self) -> Attributes
fn clone(&self) -> Attributes
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 Attributes
impl Debug for Attributes
Source§impl Default for Attributes
impl Default for Attributes
Source§fn default() -> Attributes
fn default() -> Attributes
Returns the “default value” for a type. Read more
impl Eq for Attributes
Source§impl PartialEq for Attributes
impl PartialEq for Attributes
Source§fn eq(&self, other: &Attributes) -> bool
fn eq(&self, other: &Attributes) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for Attributes
Auto Trait Implementations§
impl Freeze for Attributes
impl RefUnwindSafe for Attributes
impl Send for Attributes
impl Sync for Attributes
impl Unpin for Attributes
impl UnsafeUnpin for Attributes
impl UnwindSafe for Attributes
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