Skip to main content

IntoFilter

Trait IntoFilter 

Source
pub trait IntoFilter:
    MemoryPolicy
    + Sized
    + 'static {
    // Provided method
    fn into_filter(self) -> BoxedFilter { ... }
}
Expand description

Adapt a MemoryPolicy into a closure suitable for InMemoryConversationMemory::with_filter.

Errors raised by the policy are swallowed because with_filter does not propagate failures. Use MemoryPolicy::apply directly when you need to observe policy errors.

Provided Methods§

Source

fn into_filter(self) -> BoxedFilter

Convert this policy into a filter closure.

On policy error, returns the original input unchanged and logs a warning.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<P> IntoFilter for P
where P: MemoryPolicy + 'static,