add more documentation to some actions and configurations

This commit is contained in:
2025-10-19 21:44:05 -07:00
parent 354b5ec130
commit 08da6dd390
7 changed files with 102 additions and 0 deletions

View File

@@ -3,12 +3,15 @@ use anyhow::Result;
use serde::{Deserialize, Serialize};
use std::rc::Rc;
/// The configuration of the print action.
#[derive(Serialize, Deserialize, Default, Clone)]
pub struct PrintConfiguration {
/// The text to print to the console.
#[serde(default)]
pub text: String,
}
/// Executes the print action with the specified `configuration` inside the provided `context`.
pub fn print(context: Rc<SproutContext>, configuration: &PrintConfiguration) -> Result<()> {
println!("{}", context.stamp(&configuration.text));
Ok(())