pub trait ChartExt: Serialize {
type DS;
// Required methods
fn get_id(&self) -> &str;
fn id(self, id: String) -> Self
where Self: Sized;
fn get_data(&mut self) -> &mut Self::DS;
fn get_options(&mut self) -> &mut ChartOptions;
// Provided methods
fn new(id: impl AsRef<str>) -> Self
where Self: Default { ... }
fn data(self, data: impl Into<Self::DS>) -> Self
where Self: Sized { ... }
fn options(self, options: impl Into<ChartOptions>) -> Self
where Self: Sized { ... }
fn into_json(&self) -> JsValue { ... }
fn into_chart(&self) -> Chart { ... }
fn get_chart_from_id(id: &str) -> Option<Self>
where for<'de> Self: Deserialize<'de> { ... }
}Required Associated Types§
Required Methods§
fn get_id(&self) -> &str
fn id(self, id: String) -> Selfwhere
Self: Sized,
fn get_data(&mut self) -> &mut Self::DS
fn get_options(&mut self) -> &mut ChartOptions
Provided Methods§
fn new(id: impl AsRef<str>) -> Selfwhere
Self: Default,
fn data(self, data: impl Into<Self::DS>) -> Selfwhere
Self: Sized,
fn options(self, options: impl Into<ChartOptions>) -> Selfwhere
Self: Sized,
fn into_json(&self) -> JsValue
fn into_chart(&self) -> Chart
fn get_chart_from_id(id: &str) -> Option<Self>where
for<'de> Self: Deserialize<'de>,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".