pub trait Saveable: Configurable {
    // Required method
    fn plotable_data(&self) -> String;

    // Provided methods
    fn save(&self) -> Result<&Self, PreexplorerError> { ... }
    fn save_with_id<S: Display>(&self, id: S) -> Result<&Self, PreexplorerError> { ... }
}
Expand description

Allows quick saving.

§Implementation

See traits module level documentation.

Required Methods§

source

fn plotable_data(&self) -> String

Extract the data from the struct.

§Remarks

The data format should be directly readable by gnuplot. Look up gnuplot datafile for more information.

§Warnings

If there is no data, a warning will be printed to io::stderr.

Provided Methods§

source

fn save(&self) -> Result<&Self, PreexplorerError>

Save the data in a file. The directory is target\\preexplorer\\data\\.

§Panics

If the struct has not been given an id, according to the Configurable trait.

§Examples

Correctly identifying before saving.

let mut seq = (0..10).preexplore();
seq.set_id("my_id").save().unwrap();

Incorrectly identifying before saving. This panics.

(0..10).preexplore().save();
source

fn save_with_id<S: Display>(&self, id: S) -> Result<&Self, PreexplorerError>

Save the file with a given id. It does not change the current id to save the data.

§Examples

Quickly saving.

let mut seq = (0..10).preexplore();
seq.save_with_id("quick_test").unwrap();
assert_eq!(seq.id(), None);

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Saveable for SequenceError

source§

impl Saveable for SequenceErrors

source§

impl<T> Saveable for Data<T>
where T: Display + Clone,

source§

impl<T> Saveable for Densities<T>
where T: Display + Clone,

source§

impl<T> Saveable for Density<T>
where T: Display + Clone,

source§

impl<T> Saveable for ProcessError<T>
where T: Display + Clone,

source§

impl<T> Saveable for ProcessErrors<T>
where T: Display + Clone,

source§

impl<T> Saveable for Sequence<T>
where T: Display + Clone,

source§

impl<T> Saveable for SequenceBin<T>
where T: Display + Clone,

source§

impl<T> Saveable for SequenceBins<T>
where T: Display + Clone,

source§

impl<T> Saveable for SequenceViolin<T>
where T: Display + Clone,

source§

impl<T> Saveable for SequenceViolins<T>
where T: Display + Clone,

source§

impl<T> Saveable for Sequences<T>
where T: Display + Clone,

source§

impl<T, S> Saveable for Process<T, S>
where T: Display + Clone, S: Display + Clone,

source§

impl<T, S> Saveable for ProcessBin<T, S>
where T: Display + Clone, S: Display + Clone,

source§

impl<T, S> Saveable for ProcessBins<T, S>
where T: Display + Clone, S: Display + Clone,

source§

impl<T, S> Saveable for ProcessViolin<T, S>
where T: Display + Clone, S: Display + Clone,

source§

impl<T, S> Saveable for ProcessViolins<T, S>
where T: Display + Clone, S: Display + Clone,

source§

impl<T, S> Saveable for Processes<T, S>
where T: Display + Clone, S: Display + Clone,

source§

impl<T, S, U> Saveable for Contour<T, S, U>
where T: Display + Clone, S: Display + Clone, U: Display + Clone,

source§

impl<T, S, U> Saveable for Heatmap<T, S, U>
where T: Display + Clone, S: Display + Clone, U: Display + Clone,

source§

impl<T, S, U> Saveable for Heatmaps<T, S, U>
where T: Display + Clone, S: Display + Clone, U: Display + Clone,