#[non_exhaustive]pub struct MessageEntry {
pub role: Role,
pub text: String,
pub language_code: String,
pub create_time: Option<Timestamp>,
/* private fields */
}Available on crate features
conversations or generator-evaluations or generators only.Expand description
Represents a message entry of a conversation.
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.role: RoleOptional. Participant role of the message.
text: StringOptional. Transcript content of the message.
language_code: StringOptional. The language of the text. See Language Support for a list of the currently supported language codes.
create_time: Option<Timestamp>Optional. Create time of the message entry.
Implementations§
Source§impl MessageEntry
impl MessageEntry
pub fn new() -> Self
Sourcepub fn set_language_code<T: Into<String>>(self, v: T) -> Self
pub fn set_language_code<T: Into<String>>(self, v: T) -> Self
Sets the value of language_code.
§Example
ⓘ
let x = MessageEntry::new().set_language_code("example");Sourcepub fn set_create_time<T>(self, v: T) -> Self
pub fn set_create_time<T>(self, v: T) -> Self
Sets the value of create_time.
§Example
ⓘ
use wkt::Timestamp;
let x = MessageEntry::new().set_create_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of create_time.
§Example
ⓘ
use wkt::Timestamp;
let x = MessageEntry::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
let x = MessageEntry::new().set_or_clear_create_time(None::<Timestamp>);Trait Implementations§
Source§impl Clone for MessageEntry
impl Clone for MessageEntry
Source§fn clone(&self) -> MessageEntry
fn clone(&self) -> MessageEntry
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 MessageEntry
impl Debug for MessageEntry
Source§impl Default for MessageEntry
impl Default for MessageEntry
Source§fn default() -> MessageEntry
fn default() -> MessageEntry
Returns the “default value” for a type. Read more
Source§impl Message for MessageEntry
impl Message for MessageEntry
Source§impl PartialEq for MessageEntry
impl PartialEq for MessageEntry
impl StructuralPartialEq for MessageEntry
Auto Trait Implementations§
impl Freeze for MessageEntry
impl RefUnwindSafe for MessageEntry
impl Send for MessageEntry
impl Sync for MessageEntry
impl Unpin for MessageEntry
impl UnwindSafe for MessageEntry
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