Struct napchart::ChartElement [−][src]
A single element in a napchart.
Fields
data: ElementData
Additional metadata for the element.
Implementations
impl ChartElement
[src]
pub fn get_position(&self) -> (u16, u16)
[src]
Returns the position of the element as (start, end), where start and end are minutes past midnight.
let mut chart = Napchart::default(); let mut lane = chart.add_lane(); let elem = lane.add_element(0, 60).unwrap(); assert_eq!(elem.get_position(), (0, 60));
pub fn text<T: ToString>(&mut self, text: T) -> &mut Self
[src]
&mut builder function to set the text of an element.
let mut chart = Napchart::default(); let mut lane = chart.add_lane(); let elem = lane.add_element(0, 60).unwrap().text("Hour One"); assert_eq!(elem.data.text, Some(String::from("Hour One")));
pub fn color(&mut self, color: ChartColor) -> &mut Self
[src]
&mut builder function to set the color of an element.
let mut chart = Napchart::default(); let mut lane = chart.add_lane(); let elem = lane.add_element(0, 60).unwrap().color(ChartColor::Blue); assert_eq!(elem.data.color, ChartColor::Blue);
Trait Implementations
impl Clone for ChartElement
[src]
fn clone(&self) -> ChartElement
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ChartElement
[src]
impl Default for ChartElement
[src]
fn default() -> ChartElement
[src]
impl Eq for ChartElement
[src]
impl PartialEq<ChartElement> for ChartElement
[src]
fn eq(&self, other: &ChartElement) -> bool
[src]
fn ne(&self, other: &ChartElement) -> bool
[src]
impl StructuralEq for ChartElement
[src]
impl StructuralPartialEq for ChartElement
[src]
Auto Trait Implementations
impl RefUnwindSafe for ChartElement
impl Send for ChartElement
impl Sync for ChartElement
impl Unpin for ChartElement
impl UnwindSafe for ChartElement
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>,