Skip to main content

ClaudeCommandSyncExt

Trait ClaudeCommandSyncExt 

Source
pub trait ClaudeCommandSyncExt {
    // Required method
    fn execute_sync(&self, claude: &Claude) -> Result<CommandOutput>;
}
Expand description

Blocking execute_sync for any command that returns CommandOutput.

Most command builders (all except the json-decoding convenience methods) produce CommandOutput — this extension trait gives them a one-line blocking entry point that routes through crate::exec::run_claude_sync.

use claude_wrapper::{Claude, ClaudeCommandSyncExt, VersionCommand};

let claude = Claude::builder().build()?;
let out = VersionCommand::new().execute_sync(&claude)?;
println!("{}", out.stdout);

Commands with custom execute paths (e.g. crate::QueryCommand, which honours retry_policy) override this via an inherent method of the same name — inherent-method resolution wins, so callers don’t need to disambiguate.

Required Methods§

Source

fn execute_sync(&self, claude: &Claude) -> Result<CommandOutput>

Blocking analog of ClaudeCommand::execute for commands producing CommandOutput.

Implementors§

Source§

impl<T> ClaudeCommandSyncExt for T
where T: ClaudeCommand<Output = CommandOutput>,

Available on crate feature sync only.