#[non_exhaustive]pub struct ModerateTextResponse {
pub moderation_categories: Vec<ClassificationCategory>,
pub language_code: String,
pub language_supported: bool,
}Expand description
The document moderation response message.
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.moderation_categories: Vec<ClassificationCategory>Harmful and sensitive categories representing the input document.
language_code: StringThe language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See [Document.language][] field for more details.
language_supported: boolWhether the language is officially supported. The API may still return a response when the language is not supported, but it is on a best effort basis.
Implementations§
Source§impl ModerateTextResponse
impl ModerateTextResponse
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.
Sourcepub fn set_language_supported<T: Into<bool>>(self, v: T) -> Self
pub fn set_language_supported<T: Into<bool>>(self, v: T) -> Self
Sets the value of language_supported.
Sourcepub fn set_moderation_categories<T, V>(self, v: T) -> Self
pub fn set_moderation_categories<T, V>(self, v: T) -> Self
Sets the value of moderation_categories.
Trait Implementations§
Source§impl Clone for ModerateTextResponse
impl Clone for ModerateTextResponse
Source§fn clone(&self) -> ModerateTextResponse
fn clone(&self) -> ModerateTextResponse
Returns a copy 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 ModerateTextResponse
impl Debug for ModerateTextResponse
Source§impl Default for ModerateTextResponse
impl Default for ModerateTextResponse
Source§fn default() -> ModerateTextResponse
fn default() -> ModerateTextResponse
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ModerateTextResponsewhere
ModerateTextResponse: Default,
impl<'de> Deserialize<'de> for ModerateTextResponsewhere
ModerateTextResponse: Default,
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
Source§impl Message for ModerateTextResponse
impl Message for ModerateTextResponse
Source§impl PartialEq for ModerateTextResponse
impl PartialEq for ModerateTextResponse
Source§impl Serialize for ModerateTextResponse
impl Serialize for ModerateTextResponse
impl StructuralPartialEq for ModerateTextResponse
Auto Trait Implementations§
impl Freeze for ModerateTextResponse
impl RefUnwindSafe for ModerateTextResponse
impl Send for ModerateTextResponse
impl Sync for ModerateTextResponse
impl Unpin for ModerateTextResponse
impl UnwindSafe for ModerateTextResponse
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