#[non_exhaustive]pub struct Action {
pub title: String,
pub url: String,
}Expand description
A button on a message. Honk never opens the URL; the phone does, when you tap the button.
use honk::{Action, Message};
let msg = Message::new("Maria Tudor asked for a quote")
.action("Reply", "mailto:maria@example.com?subject=Your%20quote")
.action("Call", "tel:+15550134");
assert_eq!(msg.actions[1], Action::new("Call", "tel:+15550134"));Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.title: String1–40 characters, one line, shown as sent.
url: Stringhttps:// (no credentials), mailto:, tel: or sms:, at most 2048 bytes.
Implementations§
Trait Implementations§
impl Eq for Action
impl StructuralPartialEq for Action
Auto Trait Implementations§
impl Freeze for Action
impl RefUnwindSafe for Action
impl Send for Action
impl Sync for Action
impl Unpin for Action
impl UnsafeUnpin for Action
impl UnwindSafe for Action
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