PathName

Struct PathName 

Source
#[repr(C)]
pub struct PathName { pub sample: u32, pub contig: u32, pub phase: u32, pub fragment: u32, }
Expand description

A structured path name relative to Metadata.

Each path name in the same metadata structure must be unique. A path name has four components: sample, contig, phase (haplotype), and fragment (count).

  • Samples correspond to sample identifiers in the metadata.
  • Contigs correspond to contig identifiers in the metadata.
  • Each (sample, phase) combination corresponds to a haplotype in the metadata.
  • Fragment field can be used as a fragment index for fragments from the sequence identified by (sample, contig, phase). It can also be used as the starting offset of the fragment in the corresponding sequence.

See also FullPathName for a stand-alone structure that contains the same information.

Fields§

§sample: u32

Sample identifier.

§contig: u32

Contig identifier.

§phase: u32

Phase / haplotype identifier.

§fragment: u32

Fragment identifier / running count.

Implementations§

Source§

impl PathName

Source

pub fn new() -> Self

Returns a new path name with all components set to 0.

Source

pub fn from_fields( sample: usize, contig: usize, phase: usize, fragment: usize, ) -> Self

Returns a path name with the given values in each field.

Source

pub fn sample(&self) -> usize

Returns the sample identifier.

Source

pub fn contig(&self) -> usize

Returns the contig identifier.

Source

pub fn phase(&self) -> usize

Returns the phase / haplotype identifier.

Source

pub fn fragment(&self) -> usize

Returns the fragment identifier / running count.

Trait Implementations§

Source§

impl Clone for PathName

Source§

fn clone(&self) -> PathName

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PathName

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PathName

Source§

fn default() -> PathName

Returns the “default value” for a type. Read more
Source§

impl Hash for PathName

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for PathName

Source§

fn eq(&self, other: &PathName) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serializable for PathName

Source§

fn elements() -> usize

Returns the number of elements needed for serializing the type.
Source§

impl Copy for PathName

Source§

impl Eq for PathName

Source§

impl StructuralPartialEq for PathName

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<V> Serialize for V
where V: Serializable,

Source§

fn serialize_header<T>(&self, _: &mut T) -> Result<(), Error>
where T: Write,

Serializes the header to the writer. Read more
Source§

fn serialize_body<T>(&self, writer: &mut T) -> Result<(), Error>
where T: Write,

Serializes the body to the writer. Read more
Source§

fn load<T>(reader: &mut T) -> Result<V, Error>
where T: Read,

Loads the struct from the reader. Read more
Source§

fn size_in_elements(&self) -> usize

Returns the size of the serialized struct in u64 elements. Read more
Source§

fn serialize<T>(&self, writer: &mut T) -> Result<(), Error>
where T: Write,

Serializes the struct to the writer. Read more
Source§

fn size_in_bytes(&self) -> usize

Returns the size of the serialized struct in bytes. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.