[][src]Trait handlegraph::pathhandlegraph::embedded_paths::MutableGraphPaths

pub trait MutableGraphPaths: GraphPaths {
    fn create_path(&mut self, name: &[u8], circular: bool) -> Option<PathId>;
fn destroy_path(&mut self, id: PathId) -> bool;
fn path_append_step(
        &mut self,
        id: PathId,
        handle: Handle
    ) -> Option<Self::StepIx>;
fn path_prepend_step(
        &mut self,
        id: PathId,
        handle: Handle
    ) -> Option<Self::StepIx>;
fn path_insert_step_after(
        &mut self,
        id: PathId,
        index: Self::StepIx,
        handle: Handle
    ) -> Option<Self::StepIx>;
fn path_remove_step(
        &mut self,
        id: PathId,
        index: Self::StepIx
    ) -> Option<Self::StepIx>;
fn path_flip_step(
        &mut self,
        id: PathId,
        index: Self::StepIx
    ) -> Option<Self::StepIx>;
fn path_rewrite_segment(
        &mut self,
        id: PathId,
        from: Self::StepIx,
        to: Self::StepIx,
        new_segment: &[Handle]
    ) -> Option<(Self::StepIx, Self::StepIx)>;
fn path_set_circularity(&mut self, id: PathId, circular: bool) -> Option<()>; }

A handlegraph with embedded paths that can be created, destroyed, and otherwise manipulated.

Required methods

fn create_path(&mut self, name: &[u8], circular: bool) -> Option<PathId>[src]

Create a new path with the given name and return its PathId. Returns None if the path already exists in the graph.

fn destroy_path(&mut self, id: PathId) -> bool[src]

Destroy the path with the given id. Returns true if the path was destroyed, false if the path did not exist or couldn't be destroyed.

fn path_append_step(
    &mut self,
    id: PathId,
    handle: Handle
) -> Option<Self::StepIx>
[src]

Append a step on the given handle to the end of path id, if the path exists. Returns the index of the new step.

fn path_prepend_step(
    &mut self,
    id: PathId,
    handle: Handle
) -> Option<Self::StepIx>
[src]

Prepend a step on the given handle to the beginning of path id, if the path exists. Returns the index of the new step.

fn path_insert_step_after(
    &mut self,
    id: PathId,
    index: Self::StepIx,
    handle: Handle
) -> Option<Self::StepIx>
[src]

Insert a step on the given handle into path id, after the step at index. Returns the index of the new step if it was successfully inserted, or None if either the path or the step does not exist.

fn path_remove_step(
    &mut self,
    id: PathId,
    index: Self::StepIx
) -> Option<Self::StepIx>
[src]

Remove the step at index from path id. Returns the index of the removed step if it existed and was removed.

fn path_flip_step(
    &mut self,
    id: PathId,
    index: Self::StepIx
) -> Option<Self::StepIx>
[src]

Flip the orientation of the handle on step at index on path id, if it exists.

fn path_rewrite_segment(
    &mut self,
    id: PathId,
    from: Self::StepIx,
    to: Self::StepIx,
    new_segment: &[Handle]
) -> Option<(Self::StepIx, Self::StepIx)>
[src]

Replace the steps starting from the step at from (inclusive) until the step to (exclusive) with steps on the Handles in new_segment. Returns a pair where the first entry is the pointer to the step corresponding to the first handle in new_segment, and the second entry, the step corresponding to the last handle.

Depending on the graph implementation, if to denotes a step beyond the path, all steps beginning at from will be removed and replaced. If new_segment is empty, the range will simply be deleted, contracting the path. In that case, which pointers are returned depend on the implementation.

The step from must come before to in the path, but it's up to implementations to choose how to handle it if that's not the case -- potentially panicking.

fn path_set_circularity(&mut self, id: PathId, circular: bool) -> Option<()>[src]

Set the circularity of path id.

Loading content...

Implementors

impl MutableGraphPaths for HashGraph[src]

impl MutableGraphPaths for PackedGraph[src]

Loading content...