Skip to main content

ModelList

Trait ModelList 

Source
pub trait ModelList: OrderedModel {
    // Required method
    fn move_to(
        conn: &mut SqliteConnection,
        id: &Self::Id,
        seq: Option<i32>,
    ) -> QueryResult<usize>;

    // Provided method
    fn move_all_to(
        conn: &mut SqliteConnection,
        ids: &[&Self::Id],
        start_seq: Option<i32>,
    ) -> QueryResult<usize> { ... }
}
Expand description

Reordering of entries within a single collection.

Required Methods§

Source

fn move_to( conn: &mut SqliteConnection, id: &Self::Id, seq: Option<i32>, ) -> QueryResult<usize>

Move one item atomically. None appends.

Provided Methods§

Source

fn move_all_to( conn: &mut SqliteConnection, ids: &[&Self::Id], start_seq: Option<i32>, ) -> QueryResult<usize>

Move distinct entries as a block. All entries must belong to the same collection. Positions refer to the destination after removing the selected entries.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§