pub struct RichTextQuote { /* private fields */ }Expand description
Rich text quote element representation.
§Fields and Validations
For more details, see the official documentation.
| Field | Type | Required | Validation |
|---|---|---|---|
| elements | Vec<RichTextElementType> | Yes | N/A |
| border | i64 | No | N/A |
§Example
use slack_messaging::blocks::rich_text::prelude::*;
let quote = RichTextQuote::builder()
.element(
RichTextElementText::builder()
.text("What we need is good examples in our documentation.")
.build()?
)
.border(0)
.build()?;
let expected = serde_json::json!({
"type": "rich_text_quote",
"elements": [
{
"type": "text",
"text": "What we need is good examples in our documentation."
}
],
"border": 0
});
let json = serde_json::to_value(quote).unwrap();
assert_eq!(json, expected);
// If your object has any validation errors, the build method returns Result::Err
let quote = RichTextQuote::builder().build();
assert!(quote.is_err());Implementations§
Source§impl RichTextQuote
impl RichTextQuote
Sourcepub fn builder() -> RichTextQuoteBuilder
pub fn builder() -> RichTextQuoteBuilder
constract RichTextQuoteBuilder object.
Trait Implementations§
Source§impl Clone for RichTextQuote
impl Clone for RichTextQuote
Source§fn clone(&self) -> RichTextQuote
fn clone(&self) -> RichTextQuote
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 RichTextQuote
impl Debug for RichTextQuote
Source§impl From<RichTextQuote> for RichTextSubElement
impl From<RichTextQuote> for RichTextSubElement
Source§fn from(value: RichTextQuote) -> Self
fn from(value: RichTextQuote) -> Self
Converts to this type from the input type.
Source§impl PartialEq for RichTextQuote
impl PartialEq for RichTextQuote
Source§impl Serialize for RichTextQuote
impl Serialize for RichTextQuote
impl StructuralPartialEq for RichTextQuote
Auto Trait Implementations§
impl Freeze for RichTextQuote
impl RefUnwindSafe for RichTextQuote
impl Send for RichTextQuote
impl Sync for RichTextQuote
impl Unpin for RichTextQuote
impl UnsafeUnpin for RichTextQuote
impl UnwindSafe for RichTextQuote
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