pub fn WriteFileString(
Path: PathBuf,
Content: String,
Create: bool,
Overwrite: bool,
) -> ActionEffect<Arc<dyn FileSystemWriter>, CommonError, ()>Expand description
Creates a convenience effect that writes string content to a file.
This function is a wrapper around WriteFileBytes. It first converts the
provided String into a byte vector (Vec<u8>) and then delegates to the
WriteFileBytes effect constructor. This simplifies call sites that are
working with text data.
§Parameters
Path: ThePathBufof the file to write to.Content: TheStringcontent to be written.Create: Iftrue, the file will be created if it does not exist.Overwrite: Iftrue, an existing file will be overwritten.
§Returns
An ActionEffect that resolves to () on success and requires the
FileSystemWriter capability.