Function list_users

Source
pub async fn list_users(
    pool: &Pool<MySql>,
    page: i64,
    per_page: i64,
) -> Result<Vec<User>>
Expand description

Retrieves all users in the system, ordered by creation time.

This function fetches all user records from the database, with the most recently created users first. It provides a complete view of all users registered in the system.

§Arguments

  • pool - Database connection pool for executing the query

§Returns

  • Ok(Vec<User>) - Successfully retrieved list of users
  • Err(anyhow::Error) - Failed to fetch users

§Use Cases

Common use cases include:

  • Administrative dashboards showing all system users
  • User management interfaces
  • User activity reports and analytics