1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
use std::error::Error; #[derive(Debug)] pub struct Apk { /// Application package name pub package_name: String, /// Application version code pub version_code: Option<i64>, } pub trait Downloadable { fn download(&self, token: &str, android_id: &str) -> Result<(), Box<Error>>; } /// impl Downloadable for Apk { fn download(&self, token: &str, android_id: &str) -> Result<(), Box<Error>> { dbg!((&self, &token, &android_id)); Ok(()) } }