[][src]Struct coitrees::IntervalNode

pub struct IntervalNode<T, I> where
    T: Clone,
    I: IntWithMax
{ pub first: i32, pub last: i32, pub metadata: T, // some fields omitted }

An interval with associated metadata.

Intervals in COITree are treated as end-inclusive.

Metadata can be an arbitrary type T, but because nodes are stored in contiguous memory, it may be better to store large metadata outside the node and use a pointer or reference for the metadata.

Examples

use coitrees::IntervalNode;

#[derive(Clone)]
struct MyMetadata {
    chrom: String,
    posstrand: bool
}

let some_interval = IntervalNode::<_, usize>::new(
    10, 24000, MyMetadata{chrom: String::from("chr1"), posstrand: false});

assert_eq!(some_interval.len(), 23991);

Fields

first: i32last: i32metadata: T

Implementations

impl<T, I> IntervalNode<T, I> where
    T: Clone,
    I: IntWithMax
[src]

pub fn new(first: i32, last: i32, metadata: T) -> IntervalNode<T, I>[src]

pub fn len(&self) -> i32[src]

Length spanned by the interval. (Interval are end-inclusive.)

Trait Implementations

impl<T: Clone, I: Clone> Clone for IntervalNode<T, I> where
    T: Clone,
    I: IntWithMax
[src]

Auto Trait Implementations

impl<T, I> RefUnwindSafe for IntervalNode<T, I> where
    I: RefUnwindSafe,
    T: RefUnwindSafe

impl<T, I> Send for IntervalNode<T, I> where
    I: Send,
    T: Send

impl<T, I> Sync for IntervalNode<T, I> where
    I: Sync,
    T: Sync

impl<T, I> Unpin for IntervalNode<T, I> where
    I: Unpin,
    T: Unpin

impl<T, I> UnwindSafe for IntervalNode<T, I> where
    I: UnwindSafe,
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.