pub struct Attributes(/* private fields */);
Expand description
GTF record attributes.
Implementations§
Source§impl Attributes
impl Attributes
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns whether there are any entries.
§Examples
use noodles_gtf::record::Attributes;
let attributes = Attributes::default();
assert!(attributes.is_empty());
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the number of entries.
§Examples
use noodles_gtf::record::Attributes;
let attributes = Attributes::default();
assert_eq!(attributes.len(), 0);
Sourcepub fn get<'a>(&'a self, key: &str) -> Option<&'a str>
pub fn get<'a>(&'a self, key: &str) -> Option<&'a str>
Returns the value at the given key.
This returns the first match of the key.
§Examples
use noodles_gtf::record::{attributes::Entry, Attributes};
let attributes = Attributes::from(vec![Entry::new("id", "g0")]);
assert_eq!(attributes.get("id"), Some("g0"));
assert!(attributes.get("source").is_none());
Trait Implementations§
Source§impl AsRef<[Entry]> for Attributes
impl AsRef<[Entry]> for Attributes
Source§impl Clone for Attributes
impl Clone for Attributes
Source§fn clone(&self) -> Attributes
fn clone(&self) -> Attributes
Returns a copy of the value. Read more
1.0.0 · 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
Source§impl Display for Attributes
impl Display for Attributes
Source§impl FromStr for Attributes
impl FromStr for Attributes
Source§impl PartialEq for Attributes
impl PartialEq for Attributes
impl Eq for Attributes
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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.