pub struct MessageActionsProps {Show 20 fields
pub message_id: String,
pub label: String,
pub copy_value: Option<String>,
pub on_copy: Option<Callback<String, bool>>,
pub copy_label: String,
pub copied_label: String,
pub copy_error_label: String,
pub retry: bool,
pub retry_label: String,
pub show_feedback: bool,
pub feedback: Option<Option<MessageFeedback>>,
pub default_feedback: Option<MessageFeedback>,
pub positive_label: String,
pub negative_label: String,
pub disabled: bool,
pub on_retry: Option<EventHandler<MessageRetryDetail>>,
pub on_feedback: Option<EventHandler<MessageFeedbackDetail>>,
pub class: Option<String>,
pub attributes: Vec<Attribute>,
pub children: Element,
}Expand description
Props for MessageActions.
Fields§
§message_id: StringIdentifies the message in retry and feedback requests. Retry and rating stay disabled while it is empty.
label: StringAccessible name of the group. Defaults to Message actions.
copy_value: Option<String>Text the copy button writes to the clipboard. Omit it to leave copy out.
on_copy: Option<Callback<String, bool>>Copies through the app instead of the browser clipboard (see CopyButton::on_copy). Use it
on Dioxus Native, which has no clipboard API.
copy_label: StringAccessible name of the copy button. Defaults to Copy.
copied_label: StringAccessible name of the copy button after a copy. Defaults to Copied.
copy_error_label: StringAccessible name of the copy button after a failure. Defaults to Could not copy.
retry: boolShows a retry button that requests a new response.
retry_label: StringAccessible name of the retry button. Defaults to Retry.
show_feedback: boolShows the good and bad response pair. Defaults to true.
feedback: Option<Option<MessageFeedback>>Controlled rating: Some(rating), where rating is None when unrated. Omit it to let
the component keep the rating, starting from default_feedback.
default_feedback: Option<MessageFeedback>Initial rating when feedback is not controlled.
positive_label: StringAccessible name of the good response button. Defaults to Good response.
negative_label: StringAccessible name of the bad response button. Defaults to Bad response.
disabled: boolTurns off retry and rating, for example while the answer streams. Copy stays available.
on_retry: Option<EventHandler<MessageRetryDetail>>Called when the person asks for a new response.
on_feedback: Option<EventHandler<MessageFeedbackDetail>>Called with the new rating; its value is None when the person cleared their choice.
class: Option<String>Extra classes appended after the Lumen class.
attributes: Vec<Attribute>Any other <div> or global attribute.
children: ElementExtra actions after the built-in buttons.
Implementations§
Source§impl MessageActionsProps
impl MessageActionsProps
Sourcepub fn builder() -> MessageActionsPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> MessageActionsPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building MessageActionsProps.
On the builder, call .message_id(...), .label(...)(optional), .copy_value(...)(optional), .on_copy(...)(optional), .copy_label(...)(optional), .copied_label(...)(optional), .copy_error_label(...)(optional), .retry(...)(optional), .retry_label(...)(optional), .show_feedback(...)(optional), .feedback(...)(optional), .default_feedback(...)(optional), .positive_label(...)(optional), .negative_label(...)(optional), .disabled(...)(optional), .on_retry(...)(optional), .on_feedback(...)(optional), .class(...)(optional), .attributes(...)(optional), .children(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of MessageActionsProps.
Trait Implementations§
Source§impl Clone for MessageActionsProps
impl Clone for MessageActionsProps
Source§impl PartialEq for MessageActionsProps
impl PartialEq for MessageActionsProps
Source§impl Properties for MessageActionsPropswhere
Self: Clone,
impl Properties for MessageActionsPropswhere
Self: Clone,
Source§type Builder = MessageActionsPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
type Builder = MessageActionsPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Source§fn memoize(&mut self, new: &Self) -> bool
fn memoize(&mut self, new: &Self) -> bool
Source§fn into_vcomponent<M>(
self,
render_fn: impl ComponentFunction<Self, M>,
) -> VComponentwhere
M: 'static,
fn into_vcomponent<M>(
self,
render_fn: impl ComponentFunction<Self, M>,
) -> VComponentwhere
M: 'static,
impl StructuralPartialEq for MessageActionsProps
Auto Trait Implementations§
impl !Freeze for MessageActionsProps
impl !RefUnwindSafe for MessageActionsProps
impl !Send for MessageActionsProps
impl !Sync for MessageActionsProps
impl !UnwindSafe for MessageActionsProps
impl Forget for MessageActionsProps
impl Move for MessageActionsProps
impl Unpin for MessageActionsPropswhere
*const u8 is !null: Unpin,
&'static UnsyncStorage: Unpin,
NonZero<u64>: Unpin,
&'static Location<'static>: Unpin,
Box<dyn FnMut(String) -> bool>: Unpin,
*const RcInner<Runtime> is !null: Unpin,
Box<dyn FnMut(MessageRetryDetail)>: Unpin,
Box<dyn FnMut(MessageFeedbackDetail)>: Unpin,
&'static str: Unpin,
Rc<RefCell<dyn FnMut(Event<dyn Any>)>>: Unpin,
Rc<dyn AnyValue>: Unpin,
Rc<VNodeInner>: Unpin,
Arc<Error>: Unpin,
NonZero<u32>: Unpin,
impl UnsafeUnpin for MessageActionsPropswhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
&'static UnsyncStorage: UnsafeUnpin,
NonZeroU64Inner: UnsafeUnpin,
&'static Location<'static>: UnsafeUnpin,
PhantomData<Option<ExternalListenerCallback<String, bool>>>: UnsafeUnpin,
PhantomData<Option<ExternalListenerCallback<MessageRetryDetail, ()>>>: UnsafeUnpin,
PhantomData<Option<ExternalListenerCallback<MessageFeedbackDetail, ()>>>: UnsafeUnpin,
PhantomData<Attribute>: UnsafeUnpin,
*const RcInner<VNodeInner> is !null: UnsafeUnpin,
PhantomData<RcInner<VNodeInner>>: UnsafeUnpin,
*const ArcInner<Error> is !null: UnsafeUnpin,
PhantomData<ArcInner<Error>>: UnsafeUnpin,
NonZeroU32Inner: UnsafeUnpin,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DependencyElement for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more