count total data size for torrent resolved

This commit is contained in:
yggverse 2025-07-09 01:06:33 +03:00
parent 27360c4da1
commit b22695587d
3 changed files with 32 additions and 23 deletions

View file

@ -7,17 +7,17 @@ pub struct Value {
pub time: DateTime<Utc>,
pub node: u64,
// Isolate by applying internal filter on value set
length: Option<u64>,
size: Option<u64>,
name: Option<String>,
}
impl Value {
/// Create new `Self` with current timestamp
pub fn new(node: u64, name: Option<String>, length: Option<u64>) -> Self {
pub fn new(node: u64, size: Option<u64>, name: Option<String>) -> Self {
Self {
time: Utc::now(),
node,
length,
size,
name: filter_name(name),
}
}
@ -26,8 +26,8 @@ impl Value {
self.name.as_ref()
}
/// Get reference to the safely constructed `length` member
pub fn length(&self) -> Option<u64> {
self.length
pub fn size(&self) -> Option<u64> {
self.size
}
}