Struct napchart::Napchart [−][src]
A napchart, as seen on https://napchart.com/
Fields
title: Option<String>
description: Option<String>
shape: ChartShape
lanes: 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.
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
impl RefUnwindSafe for Napchart
impl Send for Napchart
impl Sync for Napchart
impl Unpin for Napchart
impl UnwindSafe for Napchart
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,