pub enum ReturnStrategy {
ReturnSelf,
ChainableMutation,
Direct,
}Expand description
Return handling strategy for class methods.
Determines how the R wrapper function processes and returns the .Call() result.
Each class system generator uses this to produce idiomatic R return code.
Variants§
ReturnSelf
The method returns Self. The wrapper wraps the raw pointer result with
the appropriate class attribute or creates a new class object (e.g.,
R6Class$new(.ptr = result) or structure(result, class = "...")).
ChainableMutation
The method is a &mut self method returning (). The wrapper calls the
.Call() for its side effect and returns the receiver (self/x) for
method chaining (e.g., invisible(self) for R6).
Direct
Default strategy: return the .Call() result directly without wrapping.
Implementations§
Source§impl ReturnStrategy
impl ReturnStrategy
Sourcepub fn for_method(method: &ParsedMethod) -> Self
pub fn for_method(method: &ParsedMethod) -> Self
Determine the return strategy for a parsed method.
- Methods that return
SelfuseReturnSelf &mut selfmethods returning()useChainableMutation- All other methods use
Direct
Trait Implementations§
Source§impl Clone for ReturnStrategy
impl Clone for ReturnStrategy
Source§fn clone(&self) -> ReturnStrategy
fn clone(&self) -> ReturnStrategy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ReturnStrategy
impl Debug for ReturnStrategy
Source§impl Eq for ReturnStrategy
impl Eq for ReturnStrategy
Source§#[doc(hidden)]fn assert_fields_are_eq(&self)
#[doc(hidden)]fn assert_fields_are_eq(&self)
derive_eq_internals)1.0.0 (const: unstable) · Source§#[doc(hidden)]fn assert_receiver_is_total_eq(&self)
#[doc(hidden)]fn assert_receiver_is_total_eq(&self)
implementation detail of #[derive(Eq)]
Source§impl PartialEq for ReturnStrategy
impl PartialEq for ReturnStrategy
Source§fn eq(&self, other: &ReturnStrategy) -> bool
fn eq(&self, other: &ReturnStrategy) -> bool
self and other values to be equal, and is used by ==.impl Copy for ReturnStrategy
impl StructuralPartialEq for ReturnStrategy
impl TrivialClone for ReturnStrategy
Auto Trait Implementations§
impl Freeze for ReturnStrategy
impl RefUnwindSafe for ReturnStrategy
impl Send for ReturnStrategy
impl Sync for ReturnStrategy
impl Unpin for ReturnStrategy
impl UnsafeUnpin for ReturnStrategy
impl UnwindSafe for ReturnStrategy
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,
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 moreimpl<T> Printable for T
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: 1 byte
Size for each variant:
ReturnSelf: 0 bytesChainableMutation: 0 bytesDirect: 0 bytes