tuwunel_admin/user/list_users.rs
1use futures::StreamExt;
2use tuwunel_core::Result;
3
4use crate::admin_command;
5
6#[admin_command]
7pub(super) async fn list_users(&self) -> Result {
8 let users: Vec<_> = self
9 .services
10 .users
11 .list_local_users()
12 .map(ToString::to_string)
13 .collect()
14 .await;
15
16 write!(self, "Found {} local user account(s):\n```\n", users.len()).await?;
17 for user in &users {
18 writeln!(self, "{user}").await?;
19 }
20 write!(self, "```").await
21}