pub struct ChatMessage { /* private fields */ }Expand description
One message of a Chat.
Implementations§
Source§impl ChatMessage
impl ChatMessage
Sourcepub fn assistant_writing(text: Arc<Mutex<String>>) -> Self
pub fn assistant_writing(text: Arc<Mutex<String>>) -> Self
What the assistant is still answering. Whoever answers writes to text, from
any thread, and asks for a rebuild with a UiWaker. While it
is empty, the message shows that it is on its way.
Sourcepub fn media(self, media: ChatMedia) -> Self
pub fn media(self, media: ChatMedia) -> Self
A photo, a document or a recording in the bubble, above the text, which may be empty.
Sourcepub fn card(self, card: impl Fn() -> AnyView + 'static) -> Self
pub fn card(self, card: impl Fn() -> AnyView + 'static) -> Self
Something to act on under the text, such as buttons. It is built each time the message is shown.
Who wrote it.
Trait Implementations§
Source§impl Clone for ChatMessage
impl Clone for ChatMessage
Source§fn clone(&self) -> ChatMessage
fn clone(&self) -> ChatMessage
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 moreAuto Trait Implementations§
impl !RefUnwindSafe for ChatMessage
impl !Send for ChatMessage
impl !Sync for ChatMessage
impl !UnwindSafe for ChatMessage
impl Freeze for ChatMessage
impl Unpin for ChatMessage
impl UnsafeUnpin for ChatMessage
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