Trait tcl::interp::CodeToResult

source ·
pub trait CodeToResult
where Self: Into<c_int>,
{ // Provided methods fn code_to_result(self, interp: &Interp) -> Result<(), InterpError> { ... } fn unit_result(self) -> Result<(), ()> { ... } fn is_ok(self) -> bool { ... } }
Expand description

Converts integral error code returned by Tcl’s C API to Rust’s Result type.

Provided Methods§

source

fn code_to_result(self, interp: &Interp) -> Result<(), InterpError>

Converts TCL_ERROR to Err(InterpError), which stores returned Tcl Obj and options.

source

fn unit_result(self) -> Result<(), ()>

Converts TCL_OK to Ok(()), otherwise Err(()).

source

fn is_ok(self) -> bool

Test if it is TCL_OK.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl CodeToResult for c_int

Implementors§