pub struct ModalElement {
pub callback_id: String,
pub title: String,
pub submit_label: Option<String>,
pub children: Vec<ModalChild>,
pub private_metadata: Option<String>,
pub notify_on_close: bool,
}Expand description
A modal dialog composed of form input elements.
Fields§
§callback_id: StringUnique identifier used to route modal submission callbacks.
title: StringTitle displayed at the top of the modal.
submit_label: Option<String>Optional label for the submit button (defaults to platform default).
children: Vec<ModalChild>Ordered list of child form elements.
private_metadata: Option<String>Optional opaque metadata passed through submission callbacks.
notify_on_close: boolWhen true, the adapter should fire a close/cancel event.
Implementations§
Source§impl ModalElement
impl ModalElement
Sourcepub fn new(callback_id: impl Into<String>, title: impl Into<String>) -> Self
pub fn new(callback_id: impl Into<String>, title: impl Into<String>) -> Self
Create a new modal with the given callback identifier and title.
Sourcepub fn submit_label(self, label: impl Into<String>) -> Self
pub fn submit_label(self, label: impl Into<String>) -> Self
Set the submit button label.
Sourcepub fn text_input(self, input: TextInputElement) -> Self
pub fn text_input(self, input: TextInputElement) -> Self
Append a text input child element.
Sourcepub fn select(self, select: SelectElement) -> Self
pub fn select(self, select: SelectElement) -> Self
Append a select child element.
Sourcepub fn radio_select(self, radio: RadioSelectElement) -> Self
pub fn radio_select(self, radio: RadioSelectElement) -> Self
Append a radio select child element.
Sourcepub fn private_metadata(self, metadata: impl Into<String>) -> Self
pub fn private_metadata(self, metadata: impl Into<String>) -> Self
Set opaque metadata passed through submission callbacks.
Sourcepub fn notify_on_close(self, notify: bool) -> Self
pub fn notify_on_close(self, notify: bool) -> Self
Set whether a close/cancel event should be fired.
Trait Implementations§
Source§impl Clone for ModalElement
impl Clone for ModalElement
Source§fn clone(&self) -> ModalElement
fn clone(&self) -> ModalElement
Returns a duplicate of the value. Read more
1.0.0 · 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 ModalElement
impl Debug for ModalElement
Source§impl<'de> Deserialize<'de> for ModalElement
impl<'de> Deserialize<'de> for ModalElement
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ModalElement
impl RefUnwindSafe for ModalElement
impl Send for ModalElement
impl Sync for ModalElement
impl Unpin for ModalElement
impl UnsafeUnpin for ModalElement
impl UnwindSafe for ModalElement
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