pub struct OutputPolicy {
pub schema: Option<Value>,
pub allow: Vec<AllowList>,
pub forbid_html: bool,
pub max_bytes: Option<usize>,
}Expand description
What an output must satisfy.
Fields§
§schema: Option<Value>JSON Schema the output must match. When set, the output must be JSON.
allow: Vec<AllowList>Allow-lists for selected fields. Requires the output to be JSON.
forbid_html: boolReject HTML tags in the output (in string values if JSON, else in the raw text).
max_bytes: Option<usize>Maximum size of the output in bytes.
Trait Implementations§
Source§impl Clone for OutputPolicy
impl Clone for OutputPolicy
Source§impl Debug for OutputPolicy
impl Debug for OutputPolicy
Source§impl Default for OutputPolicy
impl Default for OutputPolicy
Source§impl<'de> Deserialize<'de> for OutputPolicywhere
OutputPolicy: Default,
impl<'de> Deserialize<'de> for OutputPolicywhere
OutputPolicy: 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
impl Eq for OutputPolicy
Source§impl PartialEq for OutputPolicy
impl PartialEq for OutputPolicy
Source§impl Serialize for OutputPolicy
impl Serialize for OutputPolicy
impl StructuralPartialEq for OutputPolicy
Auto Trait Implementations§
impl Forget for OutputPolicy
impl Freeze for OutputPolicy
impl RefUnwindSafe for OutputPolicy
impl Send for OutputPolicy
impl Sync for OutputPolicy
impl Unpin for OutputPolicy
impl UnsafeUnpin for OutputPolicy
impl UnwindSafe for OutputPolicy
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.