pub struct OutputValidator { /* private fields */ }Expand description
Validates model outputs against an OutputPolicy.
Implementations§
Source§impl OutputValidator
impl OutputValidator
Sourcepub fn new(policy: OutputPolicy) -> Result<Self, Error>
pub fn new(policy: OutputPolicy) -> Result<Self, Error>
Compiles the schema (if any) and checks the allow-list pointers.
Sourcepub fn policy(&self) -> &OutputPolicy
pub fn policy(&self) -> &OutputPolicy
The policy in effect.
Sourcepub fn validate(&self, text: &str) -> OutputReport
pub fn validate(&self, text: &str) -> OutputReport
Validates text.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for OutputValidator
impl !UnwindSafe for OutputValidator
impl Forget for OutputValidator
impl Freeze for OutputValidator
impl Send for OutputValidator
impl Sync for OutputValidator
impl Unpin for OutputValidator
impl UnsafeUnpin for OutputValidator
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