pub struct Field { /* private fields */ }
Expand description
A VCF record info field.
Implementations
sourceimpl Field
impl Field
sourcepub fn try_from_str(s: &str, infos: &Infos) -> Result<Self, ParseError>
pub fn try_from_str(s: &str, infos: &Infos) -> Result<Self, ParseError>
Parses a raw VCF record info field.
sourcepub fn new(key: Key, value: Option<Value>) -> Self
pub fn new(key: Key, value: Option<Value>) -> Self
Creates a VCF record info field.
Examples
use noodles_vcf::{
header::info::Key,
record::info::{field::Value, Field},
};
let field = Field::new(Key::SamplesWithDataCount, Some(Value::Integer(1)));
sourcepub fn key(&self) -> &Key
pub fn key(&self) -> &Key
Returns the field key.
Examples
use noodles_vcf::{
header::info::Key,
record::info::{field::Value, Field},
};
let field = Field::new(Key::SamplesWithDataCount, Some(Value::Integer(1)));
assert_eq!(field.key(), &Key::SamplesWithDataCount);
sourcepub fn value(&self) -> Option<&Value>
pub fn value(&self) -> Option<&Value>
Returns the field value.
Examples
use noodles_vcf::{
header::info::Key,
record::info::{field::Value, Field},
};
let field = Field::new(Key::SamplesWithDataCount, Some(Value::Integer(1)));
assert_eq!(field.value(), Some(&Value::Integer(1)));
sourcepub fn value_mut(&mut self) -> &mut Option<Value>
pub fn value_mut(&mut self) -> &mut Option<Value>
Returns a mutable reference to the value.
Examples
use noodles_vcf::{
header::info::Key,
record::info::{field::Value, Field},
};
let mut field = Field::new(Key::SamplesWithDataCount, Some(Value::Integer(1)));
*field.value_mut() = Some(Value::Integer(2));
assert_eq!(field.value(), Some(&Value::Integer(2)));
Trait Implementations
impl StructuralPartialEq for Field
Auto Trait Implementations
impl RefUnwindSafe for Field
impl Send for Field
impl Sync for Field
impl Unpin for Field
impl UnwindSafe for Field
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more