Skip to main content

Modifiable

Trait Modifiable 

Source
pub trait Modifiable: Sized {
    // Required method
    fn parts_mut(&mut self) -> &mut SqlParts;

    // Provided methods
    fn order(self, column: &str, direction: OrderDirection) -> Self { ... }
    fn order_with_nulls(
        self,
        column: &str,
        direction: OrderDirection,
        nulls: NullsPosition,
    ) -> Self { ... }
    fn limit(self, count: i64) -> Self { ... }
    fn range(self, from: i64, to: i64) -> Self { ... }
    fn single(self) -> Self { ... }
    fn maybe_single(self) -> Self { ... }
    fn count(self) -> Self { ... }
    fn count_option(self, option: CountOption) -> Self { ... }
}
Expand description

Trait providing modifier methods (order, limit, range, single, count).

Required Methods§

Source

fn parts_mut(&mut self) -> &mut SqlParts

Get a mutable reference to the SQL parts.

Provided Methods§

Source

fn order(self, column: &str, direction: OrderDirection) -> Self

Order by a column.

Source

fn order_with_nulls( self, column: &str, direction: OrderDirection, nulls: NullsPosition, ) -> Self

Order by a column with explicit nulls positioning.

Source

fn limit(self, count: i64) -> Self

Limit the number of rows returned.

Source

fn range(self, from: i64, to: i64) -> Self

Set the range of rows to return (offset..offset+limit).

Source

fn single(self) -> Self

Expect exactly one row. Returns error if 0 or >1 rows.

Source

fn maybe_single(self) -> Self

Expect zero or one row. Returns error if >1 rows.

Source

fn count(self) -> Self

Request an exact row count.

Source

fn count_option(self, option: CountOption) -> Self

Request a row count with a specific counting strategy.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§