Skip to main content

RHashView

Struct RHashView 

Source
#[repr(C)]
pub struct RHashView { pub data: *mut c_void, pub vtable: *const RHashVTable, }
Expand description

Runtime view for objects implementing RHash. Generated from source location line 132, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.

Combines a data pointer with a vtable pointer for method dispatch. Use try_from_sexp to create a view from an R external pointer.

Fields§

§data: *mut c_void

Pointer to the concrete object data.

§vtable: *const RHashVTable

Pointer to the vtable for this trait.

Implementations§

Source§

impl RHashView

Source

pub unsafe fn try_from_sexp(sexp: SEXP) -> Option<Self>

Try to create a view from an R SEXP.

Returns Some(Self) if the object implements this trait, None otherwise.

§Safety
  • sexp must be a valid R external pointer (EXTPTRSXP)
  • Must be called on R’s main thread
Source

pub unsafe fn from_sexp(sexp: SEXP) -> Self

Try to create a view, panicking with error message on failure.

§Safety

Same as try_from_sexp.

Source

pub fn hash(&self) -> i64

Call hash through the vtable.

Trait Implementations§

Source§

impl TraitView for RHashView

Source§

const TAG: mx_tag = TAG_RHASH

The type tag for this trait. Read more
Source§

unsafe fn from_raw_parts(data: *mut c_void, vtable: *const c_void) -> Self

Create a view from raw data and vtable pointers. Read more
Source§

unsafe fn try_from_sexp(sexp: SEXP) -> Option<Self>

Try to create a view from an R SEXP. Read more
Source§

unsafe fn try_from_sexp_or_error( sexp: SEXP, trait_name: &str, ) -> Result<Self, String>

Try to create a view, returning an error message on failure. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.