#[doc(hidden)]pub enum RCondition {
Error {
message: String,
class: Option<String>,
},
Warning {
message: String,
class: Option<String>,
},
Message {
message: String,
},
Condition {
message: String,
class: Option<String>,
},
}Expand description
Internal panic payload for structured R conditions.
Raised by the error!(), warning!(), message!(), and condition!()
macros via std::panic::panic_any. Caught by
with_r_unwind_protect_error_in_r before the generic panic→string path
and forwarded to R as a tagged SEXP with rust_* class layering.
This type is #[doc(hidden)] because users interact with the macros,
not the enum directly.
Variants§
Error
Raised by error!(...) / error!(class = "...", ...).
Warning
Raised by warning!(...) / warning!(class = "...", ...).
Message
Raised by message!(...).
Condition
Raised by condition!(...) / condition!(class = "...", ...).
Implementations§
Source§impl RCondition
impl RCondition
Sourcepub unsafe fn from_tagged_sexp(sexp: SEXP) -> Option<Self>
pub unsafe fn from_tagged_sexp(sexp: SEXP) -> Option<Self>
Reconstruct an RCondition::Error from a tagged SEXP produced by
crate::error_value::make_rust_condition_value.
Returns Some(RCondition) when sexp has class "rust_condition_value" AND
the "__rust_condition__" attribute is TRUE. Returns None for all other
SEXPs (normal return values, R_NilValue, etc.).
Reconstructs the matching variant for each kind: "error"/"panic"/
"result_err"/"none_err"/"other_rust_error" → RCondition::Error;
"warning" → RCondition::Warning; "message" → RCondition::Message;
"condition" → RCondition::Condition. Unknown kinds degrade to
RCondition::Error with the kind string prefixed to the message.
§Safety
Must be called from R’s main thread.
Trait Implementations§
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 56 bytes
Size for each variant:
Error: 48 bytesWarning: 48 bytesMessage: 24 bytesCondition: 48 bytes