aboutsummaryrefslogtreecommitdiff
path: root/common/src/api.rs
blob: 709e4070d481551de59a29a7b45cdba15f58825e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
    This file is part of jellything (https://codeberg.org/metamuffin/jellything)
    which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
    Copyright (C) 2026 metamuffin <metamuffin.org>
*/

use jellyobject::{Object, Tag};
use std::borrow::Cow;
use std::collections::BTreeMap;

#[derive(Debug)]
pub struct Nku<'a> {
    pub node: Cow<'a, Object>,
    pub userdata: Cow<'a, Object>,
    pub role: Option<Cow<'a, str>>,
    pub child_count: u64,
}

pub struct Stats {
    pub all: StatsBin,
    pub by_kind: BTreeMap<Tag, StatsBin>,
}

pub struct StatsBin {
    pub count: usize,
    pub sum_duration: f64,
    pub max_duration: f64,
    pub max_duration_node: String,
    pub sum_size: u64,
    pub max_size: u64,
    pub max_size_node: String,
}

#[derive(Debug, Clone)]
pub struct NodeFilter {
    pub kind: Option<Tag>,
}