pub struct NativeBorrow {
shape: BorrowShape,
list_depth: usize,
}Expand description
The native vector storage borrowed by a conversion.
Homogeneous containers add list levels; tuples describe each positional field separately. Optional NULLs require no extra level. Owned fields have no descriptor and never participate in alias checks.
Fields§
§shape: BorrowShape§list_depth: usizeImplementations§
Source§impl NativeBorrow
impl NativeBorrow
Sourcepub const fn scalar(sexptype: SEXPTYPE, mutable: bool) -> Self
pub const fn scalar(sexptype: SEXPTYPE, mutable: bool) -> Self
A reference to the only element of a native R vector.
Sourcepub const fn slice(sexptype: SEXPTYPE, mutable: bool) -> Self
pub const fn slice(sexptype: SEXPTYPE, mutable: bool) -> Self
A slice over a native R vector, with empty vectors excluded from conflicts.
Sourcepub const fn tuple(fields: &'static [Option<Self>]) -> Option<Self>
pub const fn tuple(fields: &'static [Option<Self>]) -> Option<Self>
Borrow metadata for a positional R list with exactly this many fields.
Returns None when every field is owned.
Sourcepub const fn either(arms: &'static [Option<Self>; 2]) -> Option<Self>
pub const fn either(arms: &'static [Option<Self>; 2]) -> Option<Self>
Borrow metadata for an Either whose arms convert with arms, left
first. Returns None when neither arm borrows.
The check treats it as the union of the arms, which is sound without
knowing which arm converts. When that union meets another argument, a
generated wrapper prepares the argument
(TryFromSexp::__mx_prepare) to learn
the arm its conversion takes, and checks that arm alone.
Sourcepub const fn choice_or(right: &'static Option<Self>) -> Option<Self>
pub const fn choice_or(right: &'static Option<Self>) -> Option<Self>
Borrow metadata for a match_arg / choices parameter of type
Either<T, R>, where right is R’s: character or factor input goes
to the owned choice T, any other input to R. Returns None when
R borrows nothing.
Sourcepub const fn selects(borrow: Option<Self>) -> bool
pub const fn selects(borrow: Option<Self>) -> bool
Whether borrow is an Either at the argument’s top level: the shape
a generated wrapper prepares to learn which arm converts. An Either
inside a list or tuple is checked against both arms.
Sourcepub const fn in_list(borrow: Option<Self>) -> Option<Self>
pub const fn in_list(borrow: Option<Self>) -> Option<Self>
Forward an element conversion through one R list level.
Sourcefn parts(self) -> &'static [Option<Self>]
fn parts(self) -> &'static [Option<Self>]
The metadata this shape is made of: a tuple’s fields, the arms of an
Either, a choice Either’s other arm. Empty for a leaf.
Sourcefn has_either(self) -> bool
fn has_either(self) -> bool
Whether the check of this metadata takes both arms of an Either
anywhere in it.
Sourcefn conflicts_with(self, other: Self) -> bool
fn conflicts_with(self, other: Self) -> bool
Whether this and other can borrow one R vector, one of them
mutably. Two vectors, the common pair, are compared here; a shape
made of parts goes to the out-of-line Self::parts_conflict_with.
fn parts_conflict_with(self, other: Self) -> bool
Sourcefn needs_internal_check(self) -> bool
fn needs_internal_check(self) -> bool
Whether one argument can borrow one R vector twice, once mutably. A vector at the top level, the common argument, can’t.
fn nested_needs_internal_check(self) -> bool
fn accepts_length(self, length: R_xlen_t) -> bool
Trait Implementations§
Source§impl Clone for NativeBorrow
impl Clone for NativeBorrow
impl Copy for NativeBorrow
Source§impl Debug for NativeBorrow
impl Debug for NativeBorrow
Source§impl Eq for NativeBorrow
impl Eq for NativeBorrow
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 NativeBorrow
impl PartialEq for NativeBorrow
impl StructuralPartialEq for NativeBorrow
impl TrivialClone for NativeBorrow
Auto Trait Implementations§
impl Forget for NativeBorrow
impl Freeze for NativeBorrow
impl RefUnwindSafe for NativeBorrow
impl Send for NativeBorrow
impl Sync for NativeBorrow
impl Unpin for NativeBorrow
impl UnsafeUnpin for NativeBorrow
impl UnwindSafe for NativeBorrow
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,
impl<T> Printable for T
Source§impl<T> RCopy for Twhere
T: Copy,
impl<T> RCopy for Twhere
T: Copy,
Source§impl<T> RDebug for Twhere
T: Debug,
impl<T> RDebug for Twhere
T: Debug,
Source§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: 32 bytes