#[non_exhaustive]pub struct AnnotatedMessagePart {
pub text: String,
pub entity_type: String,
pub formatted_value: Option<Value>,
/* private fields */
}Available on crate features
conversations or participants only.Expand description
Represents a part of a message possibly annotated with an entity. The part can be an entity or purely a part of the message between two entities or message start/end.
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.text: StringA part of a message possibly annotated with an entity.
entity_type: StringThe Dialogflow system entity type of this message part. If this is empty, Dialogflow could not annotate the phrase part with a system entity.
formatted_value: Option<Value>The Dialogflow system entity formatted value
of
this message part. For example for a system entity of type
@sys.unit-currency, this may contain:
Implementations§
Source§impl AnnotatedMessagePart
impl AnnotatedMessagePart
pub fn new() -> Self
Sourcepub fn set_entity_type<T: Into<String>>(self, v: T) -> Self
pub fn set_entity_type<T: Into<String>>(self, v: T) -> Self
Sets the value of entity_type.
§Example
ⓘ
let x = AnnotatedMessagePart::new().set_entity_type("example");Sourcepub fn set_formatted_value<T>(self, v: T) -> Self
pub fn set_formatted_value<T>(self, v: T) -> Self
Sets the value of formatted_value.
§Example
ⓘ
use wkt::Value;
let x = AnnotatedMessagePart::new().set_formatted_value(Value::default()/* use setters */);Sourcepub fn set_or_clear_formatted_value<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_formatted_value<T>(self, v: Option<T>) -> Self
Sets or clears the value of formatted_value.
§Example
ⓘ
use wkt::Value;
let x = AnnotatedMessagePart::new().set_or_clear_formatted_value(Some(Value::default()/* use setters */));
let x = AnnotatedMessagePart::new().set_or_clear_formatted_value(None::<Value>);Trait Implementations§
Source§impl Clone for AnnotatedMessagePart
impl Clone for AnnotatedMessagePart
Source§fn clone(&self) -> AnnotatedMessagePart
fn clone(&self) -> AnnotatedMessagePart
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 AnnotatedMessagePart
impl Debug for AnnotatedMessagePart
Source§impl Default for AnnotatedMessagePart
impl Default for AnnotatedMessagePart
Source§fn default() -> AnnotatedMessagePart
fn default() -> AnnotatedMessagePart
Returns the “default value” for a type. Read more
Source§impl Message for AnnotatedMessagePart
impl Message for AnnotatedMessagePart
Source§impl PartialEq for AnnotatedMessagePart
impl PartialEq for AnnotatedMessagePart
impl StructuralPartialEq for AnnotatedMessagePart
Auto Trait Implementations§
impl Freeze for AnnotatedMessagePart
impl RefUnwindSafe for AnnotatedMessagePart
impl Send for AnnotatedMessagePart
impl Sync for AnnotatedMessagePart
impl Unpin for AnnotatedMessagePart
impl UnwindSafe for AnnotatedMessagePart
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