mirror of
https://github.com/edera-dev/sprout.git
synced 2025-12-19 17:30:17 +00:00
add more documentation to some actions and configurations
This commit is contained in:
@@ -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(())
|
||||
|
||||
Reference in New Issue
Block a user