pub struct AxisConfig { /* private fields */ }Expand description
Axis Config representation.
§Fields and Validations
For more details, see the official documentation.
| Field | Type | Required | Validation |
|---|---|---|---|
| categories | Vec<String> | Yes | Each category label has a maximum of 20 characters |
| x_label | String | No | Max length: 50 characters |
| y_label | String | No | Max length: 50 characters |
§Example
use slack_messaging::blocks::data_visualization::charts::AxisConfig;
let config = AxisConfig::builder()
.categories(vec!["Mon", "Tue", "Wed", "Thu", "Fri"])
.x_label("Days of the Week")
.y_label("Sales")
.build()?;
let expected = serde_json::json!({
"categories": ["Mon", "Tue", "Wed", "Thu", "Fri"],
"x_label": "Days of the Week",
"y_label": "Sales"
});
let json = serde_json::to_value(config).unwrap();
assert_eq!(json, expected);Implementations§
Source§impl AxisConfig
impl AxisConfig
Sourcepub fn builder() -> AxisConfigBuilder
pub fn builder() -> AxisConfigBuilder
constract AxisConfigBuilder object.
Trait Implementations§
Source§impl Clone for AxisConfig
impl Clone for AxisConfig
Source§fn clone(&self) -> AxisConfig
fn clone(&self) -> AxisConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AxisConfig
impl Debug for AxisConfig
Source§impl PartialEq for AxisConfig
impl PartialEq for AxisConfig
Source§fn eq(&self, other: &AxisConfig) -> bool
fn eq(&self, other: &AxisConfig) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for AxisConfig
impl Serialize for AxisConfig
impl StructuralPartialEq for AxisConfig
Auto Trait Implementations§
impl Freeze for AxisConfig
impl RefUnwindSafe for AxisConfig
impl Send for AxisConfig
impl Sync for AxisConfig
impl Unpin for AxisConfig
impl UnsafeUnpin for AxisConfig
impl UnwindSafe for AxisConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more