Skip to main content

Scoped

Trait Scoped 

Source
pub trait Scoped: Sized {
    // Provided methods
    fn scope(self, transform: impl FnOnce(Self) -> Self) -> Self { ... }
    fn scope_if(
        self,
        condition: bool,
        transform: impl FnOnce(Self) -> Self,
    ) -> Self { ... }
}
Expand description

Fluent application of named scopes to a query.

Provided Methods§

Source

fn scope(self, transform: impl FnOnce(Self) -> Self) -> Self

Apply a scope (a query transformation).

Source

fn scope_if(self, condition: bool, transform: impl FnOnce(Self) -> Self) -> Self

Apply a scope only when condition holds (Rails conditional scope).

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<E: EntityTrait> Scoped for Select<E>

Implementors§