Struct napchart::Napchart[][src]

pub struct Napchart {
    pub title: Option<String>,
    pub description: Option<String>,
    pub shape: ChartShape,
    pub lanes: Vec<ChartLane>,
    pub color_tags: HashMap<String, String>,
    // some fields omitted
}

A napchart, as seen on https://napchart.com/

Fields

title: Option<String>description: Option<String>shape: ChartShapelanes: Vec<ChartLane>

A vector of all the lanes in the chart. In circular and wide charts, lane 0 is the innermost and smallest. In line charts, lane 0 is at the bottom.

color_tags: HashMap<String, String>

Keys are simple html color names, values are the associated tag.

Implementations

impl Napchart[src]

pub fn get_id(&self) -> Option<&String>[src]

Get the napchart.com ID of this chart, if set. This is set by the “get” and “create_new” api functions.
The ID directly gives you the URL to the napchart, as in https://napchart.com/idcode.

pub fn add_lane(&mut self) -> &mut ChartLane[src]

Append a new blank lane to the chart and returns a mutable reference to it.

pub fn get_lane_mut(&mut self, i: usize) -> Option<&mut ChartLane>[src]

Get a mutable reference to the given lane

impl Napchart[src]

Builder functions to create new napcharts.

let chart = Napchart::default()
                .title("Title1")
                .description("Cool Chart")
                .lanes(3);
assert_eq!(chart.title, Some("Title1".to_string()));
assert_eq!(chart.description, Some("Cool Chart".to_string()));
assert_eq!(chart.lanes.len(), 3);

pub fn title<'a, T: Into<&'a str>>(self, title: T) -> Self[src]

Return Napchart with title set

pub fn description<'a, T: Into<&'a str>>(self, description: T) -> Self[src]

Return Napchart with description set

pub fn shape(self, shape: ChartShape) -> Self[src]

Return Napchart with shape set

pub fn lanes(self, count: usize) -> Self[src]

Return Napchart with a given number of empty lanes

Trait Implementations

impl Clone for Napchart[src]

impl Debug for Napchart[src]

impl Default for Napchart[src]

impl PartialEq<Napchart> for Napchart[src]

impl StructuralPartialEq for Napchart[src]

Auto Trait Implementations

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> Instrument 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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,