use color_eyre::eyre::Result; use crate::{context::Context, models::library::Library}; use super::action::Action; pub struct FetchAllLibraries {} impl Action for FetchAllLibraries { type Input = (); type Output = Vec; fn new(_input: Self::Input) -> Self { Self {} } fn describe(&self) -> String { String::from("Fetching all libraries") } async fn execute(&self, ctx: &Context) -> Result { Ok(ctx .client .get_all_libraries() .await? .clone() .into_iter() .map(Into::into) .collect()) } }