Skip to main content

PathStartSource

Enum PathStartSource 

Source
pub enum PathStartSource<'a> {
    Index(&'a GBWT, usize),
    Map(HashMap<usize, usize>),
}
Expand description

A structure that determines the GBWT starting positions for paths in a graph.

The starting positions are iterated in order. If a GBWT index is provided, the starting positions are determined from the paths in the index. Otherwise the starting positions for a unidirectional index are computed on the fly.

Variants§

§

Index(&'a GBWT, usize)

A GBWT index of the paths and the next sequence id that has not been iterated.

§

Map(HashMap<usize, usize>)

A map storing the number of paths starting from each node so far.

Implementations§

Source§

impl<'a> PathStartSource<'a>

Source

pub fn new() -> Self

Returns a new source that computes the starting positions on the fly.

Source

pub fn next(&mut self, node_id: usize) -> Option<Pos>

Returns the starting position of the next path.

If the source is a GBWT index, the provided node identifier is ignored. Returns None if the path is empty or all paths in the index have been iterated.

If the source is a map, returns the starting position that would be assigned to the next path starting from the given node. Returns None if the path is empty (if the node identifier is ENDMARKER).

Trait Implementations§

Source§

impl<'a> Default for PathStartSource<'a>

Source§

fn default() -> Self

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

impl<'a> From<&'a GBWT> for PathStartSource<'a>

Source§

fn from(index: &'a GBWT) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'a> Freeze for PathStartSource<'a>

§

impl<'a> RefUnwindSafe for PathStartSource<'a>

§

impl<'a> Send for PathStartSource<'a>

§

impl<'a> Sync for PathStartSource<'a>

§

impl<'a> Unpin for PathStartSource<'a>

§

impl<'a> UnsafeUnpin for PathStartSource<'a>

§

impl<'a> UnwindSafe for PathStartSource<'a>

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> 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<T> Same for T

Source§

type Output = T

Should always be Self
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.