pub struct Segment { /* private fields */ }Expand description
Segment 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 | Greater than 0 |
§Example
use slack_messaging::blocks::data_visualization::charts::Segment;
let seg = Segment::builder()
.label("Segment A")
.value(100)
.build()?;
let expected = serde_json::json!({
"label": "Segment A",
"value": 100
});
let json = serde_json::to_value(seg).unwrap();
assert_eq!(json, expected);Implementations§
Source§impl Segment
impl Segment
Sourcepub fn builder() -> SegmentBuilder
pub fn builder() -> SegmentBuilder
constract SegmentBuilder object.
Trait Implementations§
impl StructuralPartialEq for Segment
Auto Trait Implementations§
impl Freeze for Segment
impl RefUnwindSafe for Segment
impl Send for Segment
impl Sync for Segment
impl Unpin for Segment
impl UnsafeUnpin for Segment
impl UnwindSafe for Segment
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