Skip to main content

Overview

The UserListResponse struct represents the response returned when fetching a paginated list of users.

Definition

pub struct UserListResponse {
    pub data: Vec<User>,
    pub has_more: bool,
}

Fields

data
Vec<User>
required
A vector containing the users for the current page. Each user is represented by a User struct.
has_more
bool
required
Indicates whether there are more users available beyond the current page. Used for pagination.

Usage Example

use wacht::api::users::*;

let options = ListUsersOptions {
    page: Some(1),
    per_page: Some(20),
    search: None,
    is_active: Some(true),
};

let response = fetch_users(Some(options)).await?;

println!("Found {} users", response.data.len());
if response.has_more {
    println!("More users available on next page");
}

for user in response.data {
    println!("User: {} ({})", user.name, user.email);
}

See Also