pub enum TypeMismatchError {
NullPointer,
InvalidTypeId,
Mismatch {
expected: &'static str,
found: &'static str,
},
Restored {
type_name: &'static str,
package_classes: &'static [&'static str],
package_message: Option<&'static str>,
},
OtherVersion {
type_name: &'static str,
crate_name: &'static str,
saved: &'static str,
current: &'static str,
package_classes: &'static [&'static str],
package_message: Option<&'static str>,
},
}Expand description
Error returned when type checking fails in try_from_sexp_with_error.
The found field in Mismatch contains a &'static str from R’s
interned symbol table, which persists for the R session lifetime.
Variants§
NullPointer
The external pointer’s address was null, and it was not built by
ExternalPtr (R’s new("externalptr"), a cleared pointer).
InvalidTypeId
The prot slot didn’t contain a valid type symbol.
Mismatch
The stored type doesn’t match the expected type.
Fields
Restored
A pointer this version of the crate built, restored from a saved
session without its Rust value (RESTORED_NO_VALUE_CLASS).
Fields
package_classes: &'static [&'static str]The package’s classes for the type
(TypedExternal::RESTORED_ERROR_CLASS).
package_message: Option<&'static str>The package’s message for the type
(TypedExternal::RESTORED_ERROR_MESSAGE).
OtherVersion
A pointer another version of the crate saved
(RESTORED_OTHER_VERSION_CLASS).
Fields
package_classes: &'static [&'static str]The package’s classes for the type
(TypedExternal::RESTORED_ERROR_CLASS).
package_message: Option<&'static str>The package’s message for the type
(TypedExternal::RESTORED_ERROR_MESSAGE).
Implementations§
Source§impl TypeMismatchError
impl TypeMismatchError
Sourcepub fn restored_classes(&self) -> Option<Vec<&'static str>>
pub fn restored_classes(&self) -> Option<Vec<&'static str>>
The condition classes of the error about a restored pointer: the
package’s classes, then the specific class, then RESTORED_CLASS;
None for the other variants.
Trait Implementations§
Source§impl Clone for TypeMismatchError
impl Clone for TypeMismatchError
Source§impl Debug for TypeMismatchError
impl Debug for TypeMismatchError
Source§impl Display for TypeMismatchError
impl Display for TypeMismatchError
Source§impl Error for TypeMismatchError
impl Error for TypeMismatchError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Source§#[doc(hidden)]fn type_id(&self, _: Internal) -> TypeIdwhere
Self: 'static,
#[doc(hidden)]fn type_id(&self, _: Internal) -> TypeIdwhere
Self: 'static,
error_type_id)TypeId of self.1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for TypeMismatchError
impl RefUnwindSafe for TypeMismatchError
impl Send for TypeMismatchError
impl Sync for TypeMismatchError
impl Unpin for TypeMismatchError
impl UnsafeUnpin for TypeMismatchError
impl UnwindSafe for TypeMismatchError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ConsumingFallible for Twhere
T: Clone,
Source§impl<T> RDebug for Twhere
T: Debug,
impl<T> RDebug for Twhere
T: Debug,
Source§impl<T> RError for Twhere
T: Error,
impl<T> RError for Twhere
T: Error,
Source§fn error_message(&self) -> String
fn error_message(&self) -> String
Source§fn error_chain(&self) -> Vec<String>
fn error_chain(&self) -> Vec<String>
Source§fn error_chain_length(&self) -> i32
fn error_chain_length(&self) -> i32
Source§#[doc(hidden)]unsafe extern "C" fn __RError_error_message_shim(
data: *mut c_void,
argc: i32,
argv: *const SEXP,
) -> SEXP
#[doc(hidden)]unsafe extern "C" fn __RError_error_message_shim(
data: *mut c_void,
argc: i32,
argv: *const SEXP,
) -> SEXP
RError::error_message. Read moreSource§impl<T> SizeHint for Twhere
T: ?Sized,
impl<T> SizeHint for Twhere
T: ?Sized,
Source§default fn lower_bound(&self) -> usize
default fn lower_bound(&self) -> usize
core_io_internals)[u8; 12] could return any value between 0 and
12 inclusively as a correct implementation. Read moreSource§impl<T> SizedTypeProperties for T
impl<T> SizedTypeProperties for T
Source§#[doc(hidden)]const SIZE: usize = _
#[doc(hidden)]const SIZE: usize = _
sized_type_properties)Source§#[doc(hidden)]const ALIGN: usize = _
#[doc(hidden)]const ALIGN: usize = _
sized_type_properties)Source§#[doc(hidden)]const ALIGNMENT: Alignment = _
#[doc(hidden)]const ALIGNMENT: Alignment = _
ptr_alignment_type)Source§#[doc(hidden)]const IS_ZST: bool = _
#[doc(hidden)]const IS_ZST: bool = _
sized_type_properties)Source§#[doc(hidden)]const LAYOUT: Layout = _
#[doc(hidden)]const LAYOUT: Layout = _
sized_type_properties)Source§#[doc(hidden)]const MAX_SLICE_LEN: usize = _
#[doc(hidden)]const MAX_SLICE_LEN: usize = _
sized_type_properties)[Self]. Read moreLayout§
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: 104 bytes
Size for each variant:
NullPointer: 0 bytesInvalidTypeId: 0 bytesMismatch: 32 bytesRestored: 48 bytesOtherVersion: 96 bytes