pub struct DataPoint { /* private fields */ }Expand description
Data Point representation.
§Fields and Validations
For more details, see the official documentation.
| Field | Type | Required | Validation |
|---|---|---|---|
| label | String | Yes | Max length 20 characters |
| value | Number | Yes | N/A |
§Example
use slack_messaging::blocks::data_visualization::charts::DataPoint;
let point = DataPoint::builder()
.label("Sales")
.value(150)
.build()?;
let expected = serde_json::json!({
"label": "Sales",
"value": 150
});
let json = serde_json::to_value(point).unwrap();
assert_eq!(json, expected);Implementations§
Source§impl DataPoint
impl DataPoint
Sourcepub fn builder() -> DataPointBuilder
pub fn builder() -> DataPointBuilder
constract DataPointBuilder object.
Trait Implementations§
impl StructuralPartialEq for DataPoint
Auto Trait Implementations§
impl Freeze for DataPoint
impl RefUnwindSafe for DataPoint
impl Send for DataPoint
impl Sync for DataPoint
impl Unpin for DataPoint
impl UnsafeUnpin for DataPoint
impl UnwindSafe for DataPoint
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