execute

Function execute 

Source
pub fn execute(
    params: impl CmdParameters,
) -> Result<FlameshotOutput, FlameshotError>
Expand description

Executes a flameshot cli command with the specified params

Examples found in repository?
examples/save_full_screenshot.rs (line 11)
5pub fn main() {
6    /// We select one of the 3 main param types and use the builder method to
7    /// customize the cli arguments, it includes all flameshot cli args.
8    let params = FullArgs::builder().path("screenshot.png").build();
9    /// This operation can error, it can error because of OS problems
10    /// or Flameshot problems.
11    let output = flameshot::execute(params).unwrap();
12}
More examples
Hide additional examples
examples/save_gui_screenshot.rs (line 15)
5pub fn main() {
6    /// We select one of the 3 main param types and use the builder method to
7    /// customize the cli arguments, it includes all flameshot cli args.
8    let params = GuiArgs::builder()
9        .path("screenshot.png")
10        .accept_on_select()
11        //.region((100, 100, 100, 100)) // just to show how one could use region param
12        .build();
13    /// This operation can error, it can error because of OS problems
14    /// or Flameshot problems.
15    let output = flameshot::execute(params).unwrap();
16}