mirror of
https://codeberg.org/YGGverse/psocks.git
synced 2026-04-01 00:45:27 +00:00
implement (rules) list api
This commit is contained in:
parent
461f838cc0
commit
eeafed077a
4 changed files with 34 additions and 1 deletions
|
|
@ -95,4 +95,13 @@ impl List {
|
|||
pub async fn cache_clean(&self) -> Result<Option<Vec<String>>> {
|
||||
self.cache.clean().await
|
||||
}
|
||||
/// Return active rules (from server memory)
|
||||
pub async fn list(&self) -> Vec<String> {
|
||||
self.index
|
||||
.read()
|
||||
.await
|
||||
.iter()
|
||||
.map(|item| item.to_string())
|
||||
.collect()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue