Skip to main content

Moderation

Trait Moderation 

Source
pub trait Moderation {
    type Error: Error + Send + Sync + 'static;

    // Required method
    fn moderate(
        &self,
        content: &str,
    ) -> impl Future<Output = Result<ModerationResult, Self::Error>> + Send;
}
Expand description

Trait for content moderation services.

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

The error type returned by moderation operations.

Required Methods§

Source

fn moderate( &self, content: &str, ) -> impl Future<Output = Result<ModerationResult, Self::Error>> + Send

Moderates the provided content and returns a result asynchronously.

§Arguments
  • content - The content to be moderated.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§