struct TraitConst {
ident: Ident,
ty: Type,
}Expand description
Parsed associated constant from a trait impl block.
Trait constants are exposed to R as zero-argument .Call() wrappers
that simply return the constant value.
Fields§
§ident: IdentConstant identifier (e.g., MAX_SIZE).
ty: TypeConstant type (e.g., i32, &str). Used to determine SEXP conversion.
Implementations§
Source§impl TraitConst
impl TraitConst
Sourcefn c_wrapper_ident(&self, type_ident: &Ident, trait_name: &Ident) -> Ident
fn c_wrapper_ident(&self, type_ident: &Ident, trait_name: &Ident) -> Ident
Generates the C wrapper function identifier: C_{Type}__{Trait}__{CONST}.
This is the symbol name registered with R for .Call() access to the constant.
Sourcefn c_wrapper_ident_string(
&self,
type_ident: &Ident,
trait_name: &Ident,
) -> String
fn c_wrapper_ident_string( &self, type_ident: &Ident, trait_name: &Ident, ) -> String
Generates the C wrapper identifier as a String, for use in R-side .Call() generation.
Sourcefn call_method_def_ident(&self, type_ident: &Ident, trait_name: &Ident) -> Ident
fn call_method_def_ident(&self, type_ident: &Ident, trait_name: &Ident) -> Ident
Generates the R_CallMethodDef static identifier: call_method_def_{Type}__{Trait}_{CONST}.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TraitConst
impl RefUnwindSafe for TraitConst
impl !Send for TraitConst
impl !Sync for TraitConst
impl Unpin for TraitConst
impl UnsafeUnpin for TraitConst
impl UnwindSafe for TraitConst
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> 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: 352 bytes