pub struct UrlSource { /* private fields */ }Expand description
URL source element representation.
§Fields and Validations
For more details, see the official documentation.
| Field | Type | Required | Validation |
|---|---|---|---|
| url | String | Yes | N/A |
| text | String | Yes | N/A |
§Example
use slack_messaging::blocks::elements::UrlSource;
let url_source = UrlSource::builder()
.url("https://docs.slack.dev/")
.text("Slack API docs")
.build()?;
let expected = serde_json::json!({
"type": "url",
"url": "https://docs.slack.dev/",
"text": "Slack API docs"
});
let json = serde_json::to_value(url_source).unwrap();
assert_eq!(json, expected);
// If your object has any validation errors, the build method returns Result::Err
let url_source = UrlSource::builder().build();
assert!(url_source.is_err());Implementations§
Source§impl UrlSource
impl UrlSource
Sourcepub fn builder() -> UrlSourceBuilder
pub fn builder() -> UrlSourceBuilder
constract UrlSourceBuilder object.
Trait Implementations§
impl StructuralPartialEq for UrlSource
Auto Trait Implementations§
impl Freeze for UrlSource
impl RefUnwindSafe for UrlSource
impl Send for UrlSource
impl Sync for UrlSource
impl Unpin for UrlSource
impl UnsafeUnpin for UrlSource
impl UnwindSafe for UrlSource
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