Struct napchart::Napchart [−][src]
A napchart, as seen on https://napchart.com/
Fields
shape: ChartShape
The default shape of the napchart on napchart.com
String tags associated with element colors. These are displayed in the inner area of a napchart, along with the accumulated amount of time each color takes up.
Implementations
impl Napchart
[src]
pub fn add_lane(&mut self) -> &mut ChartLane
[src]
Append a new blank lane to the chart and return a mutable reference to it.
let mut chart = Napchart::default(); let mut lane = chart.add_lane(); assert!(lane.is_empty()); assert_eq!(chart.lanes_len(), 1);
pub fn get_lane(&self, i: usize) -> Option<&ChartLane>
[src]
Get a reference to the given lane, or None if out of bounds.
let mut chart = Napchart::default(); chart.add_lane(); assert!(chart.get_lane(0).is_some()); assert!(chart.get_lane(1).is_none());
pub fn get_lane_mut(&mut self, i: usize) -> Option<&mut ChartLane>
[src]
Get a mutable reference to the given lane, or None if out of bounds.
let mut chart = Napchart::default(); chart.add_lane(); assert!(chart.get_lane_mut(0).is_some()); assert!(chart.get_lane_mut(1).is_none());
pub fn remove_lane(&mut self, i: usize) -> Option<ChartLane>
[src]
Remove the given lane from the chart and return it, or None if out of bounds.
let mut chart = Napchart::default(); chart.add_lane(); let lane = chart.remove_lane(0); assert!(lane.is_some()); assert_eq!(chart.lanes_len(), 0);
pub fn lanes_len(&self) -> usize
[src]
Get the total number of lanes in the chart.
let mut chart = Napchart::default(); assert_eq!(chart.lanes_len(), 0); chart.add_lane(); assert_eq!(chart.lanes_len(), 1); chart.add_lane(); assert_eq!(chart.lanes_len(), 2); chart.remove_lane(1); chart.remove_lane(0); assert_eq!(chart.lanes_len(), 0);
pub fn upload(&self) -> UploadBuilder<'_>
[src]
Create an UploadBuilder with a reference to this chart.
let client = BlockingClient::default(); let chart = Napchart::default(); let upload: napchart::api::UploadBuilder = chart.upload().title("My Cool Chart"); assert!(client.create_snapshot(upload).is_ok());
impl Napchart
[src]
Builder functions to create new napcharts.
let chart = Napchart::default() .lanes(3) .shape(ChartShape::Wide); assert_eq!(chart.lanes_len(), 3); assert_eq!(chart.shape, ChartShape::Wide);
pub fn shape(self, shape: ChartShape) -> Self
[src]
Return Napchart with shape set.
let chart = Napchart::default(); assert_eq!(chart.shape, ChartShape::Circle); let wide_chart = Napchart::default().shape(ChartShape::Wide); assert_eq!(wide_chart.shape, ChartShape::Wide);
pub fn lanes(self, count: usize) -> Self
[src]
Return Napchart with a given number of empty lanes.
let chart = Napchart::default(); assert_eq!(chart.lanes_len(), 0); let chart2 = Napchart::default().lanes(3); assert_eq!(chart2.lanes_len(), 3);
Trait Implementations
impl Clone for Napchart
[src]
impl Debug for Napchart
[src]
impl Default for Napchart
[src]
impl Eq for Napchart
[src]
impl PartialEq<Napchart> for Napchart
[src]
impl StructuralEq 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<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[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>,