Skip to main content

RDebug

Trait RDebug 

Source
pub trait RDebug {
    // Required methods
    fn debug_str(&self) -> String;
    fn debug_str_pretty(&self) -> String;

    // Provided methods
#[doc(hidden)]
unsafe extern "C" fn __RDebug_debug_str_shim( data: *mut c_void, argc: i32, argv: *const SEXP, ) -> SEXP where Self: Sized + RDebug { ... }
#[doc(hidden)]
unsafe extern "C" fn __RDebug_debug_str_pretty_shim( data: *mut c_void, argc: i32, argv: *const SEXP, ) -> SEXP where Self: Sized + RDebug { ... } }
Expand description

Adapter trait for std::fmt::Debug.

Provides string representations for debugging and inspection in R. Automatically implemented for any type that implements Debug.

§Methods

  • debug_str() - Returns compact debug string (:? format)
  • debug_str_pretty() - Returns pretty-printed debug string (:#? format)

§Example

ⓘ
#[derive(Debug, ExternalPtr)]
struct Config { name: String, value: i32 }

#[miniextendr]
impl miniextendr_api::adapter_traits::RDebug for Config {}

Required Methods§

Source

fn debug_str(&self) -> String

Get a compact debug string representation.

Source

fn debug_str_pretty(&self) -> String

Get a pretty-printed debug string with indentation.

Provided Methods§

Source

#[doc(hidden)]
unsafe extern "C" fn __RDebug_debug_str_shim( data: *mut c_void, argc: i32, argv: *const SEXP, ) -> SEXP
where Self: Sized + RDebug,

Method shim for RDebug::debug_str.

Converts SEXP arguments, calls the method, and returns SEXP result. Both Rust panics and R longjmps are caught via with_r_unwind_protect.

Source

#[doc(hidden)]
unsafe extern "C" fn __RDebug_debug_str_pretty_shim( data: *mut c_void, argc: i32, argv: *const SEXP, ) -> SEXP
where Self: Sized + RDebug,

Method shim for RDebug::debug_str_pretty.

Converts SEXP arguments, calls the method, and returns SEXP result. Both Rust panics and R longjmps are caught via with_r_unwind_protect.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T: Debug> RDebug for T