Struct partial_ref::Ref
source · #[repr(transparent)]pub struct Ref<'a, Target: PartialRefTarget + ?Sized> { /* private fields */ }
Expand description
Trait Implementations
sourceimpl<'a, Target: PartialRefTarget> Clone for Ref<'a, Target>
impl<'a, Target: PartialRefTarget> Clone for Ref<'a, Target>
An empty reference contains no mutable parts and thus is safe to clone.
sourceimpl<'a, Target: PartialRefTarget + ?Sized> PartialRef<'a> for Ref<'a, Target>
impl<'a, Target: PartialRefTarget + ?Sized> PartialRef<'a> for Ref<'a, Target>
An empty reference to a valid target is a valid reference.
sourceunsafe fn from_raw(
ptr: *mut <Self::Target as PartialRefTarget>::RawTarget
) -> Self
unsafe fn from_raw(
ptr: *mut <Self::Target as PartialRefTarget>::RawTarget
) -> Self
Create a partial reference from a raw pointer. Read more
sourcefn get_raw(&self) -> *mut <Self::Target as PartialRefTarget>::RawTarget
fn get_raw(&self) -> *mut <Self::Target as PartialRefTarget>::RawTarget
Access to the underlying raw pointer. Read more
sourcefn borrow<'b, BorrowedRef, SubsetIndex>(&'b mut self) -> BorrowedRefwhere
'a: 'b,
BorrowedRef: PartialRef<'a, Target = Self::Target>,
Self: HasSubset<'a, BorrowedRef, SubsetIndex>,
fn borrow<'b, BorrowedRef, SubsetIndex>(&'b mut self) -> BorrowedRefwhere
'a: 'b,
BorrowedRef: PartialRef<'a, Target = Self::Target>,
Self: HasSubset<'a, BorrowedRef, SubsetIndex>,
Partially re-borrows a partial reference. Read more
sourcefn part<'b, FieldPart, PartIndex, FieldType>(
&'b mut self,
_part: FieldPart
) -> &'a FieldTypewhere
'a: 'b,
FieldType: ?Sized,
FieldPart: Part<PartType = Field<FieldType>>,
Self: PluckConst<'a, FieldPart, PartIndex>,
Self::Target: HasPart<FieldPart> + 'a,
fn part<'b, FieldPart, PartIndex, FieldType>(
&'b mut self,
_part: FieldPart
) -> &'a FieldTypewhere
'a: 'b,
FieldType: ?Sized,
FieldPart: Part<PartType = Field<FieldType>>,
Self: PluckConst<'a, FieldPart, PartIndex>,
Self::Target: HasPart<FieldPart> + 'a,
Access a part of the referenced value. Read more
sourcefn part_mut<'b, FieldPart, PartIndex, FieldType>(
&'b mut self,
_part: FieldPart
) -> &'a mut FieldTypewhere
'a: 'b,
FieldType: ?Sized,
FieldPart: Part<PartType = Field<FieldType>>,
Self: PluckMut<'a, FieldPart, PartIndex>,
Self::Target: HasPart<FieldPart> + 'a,
fn part_mut<'b, FieldPart, PartIndex, FieldType>(
&'b mut self,
_part: FieldPart
) -> &'a mut FieldTypewhere
'a: 'b,
FieldType: ?Sized,
FieldPart: Part<PartType = Field<FieldType>>,
Self: PluckMut<'a, FieldPart, PartIndex>,
Self::Target: HasPart<FieldPart> + 'a,
Mutable access to a part of the referenced value. Read more
sourcefn split_borrow<'b, BorrowedRef, SubsetIndex>(
&'b mut self
) -> (BorrowedRef, Self::Remainder)where
'a: 'b,
BorrowedRef: PartialRef<'a, Target = Self::Target>,
Self: HasSubset<'a, BorrowedRef, SubsetIndex>,
fn split_borrow<'b, BorrowedRef, SubsetIndex>(
&'b mut self
) -> (BorrowedRef, Self::Remainder)where
'a: 'b,
BorrowedRef: PartialRef<'a, Target = Self::Target>,
Self: HasSubset<'a, BorrowedRef, SubsetIndex>,
Partially re-borrows a partial reference, splitting off the remaining parts. Read more
sourcefn split_part<'b, FieldPart, PartIndex, FieldType>(
&'b mut self,
_part: FieldPart
) -> (&'a FieldType, Self::Remainder)where
'a: 'b,
FieldType: ?Sized,
FieldPart: Part<PartType = Field<FieldType>>,
Self: PluckConst<'a, FieldPart, PartIndex>,
Self::Target: HasPart<FieldPart> + 'a,
fn split_part<'b, FieldPart, PartIndex, FieldType>(
&'b mut self,
_part: FieldPart
) -> (&'a FieldType, Self::Remainder)where
'a: 'b,
FieldType: ?Sized,
FieldPart: Part<PartType = Field<FieldType>>,
Self: PluckConst<'a, FieldPart, PartIndex>,
Self::Target: HasPart<FieldPart> + 'a,
Access a part of the referenced value, splitting off the remaining parts. Read more
sourcefn split_part_mut<'b, FieldPart, PartIndex, FieldType>(
&'b mut self,
_part: FieldPart
) -> (&'a mut FieldType, Self::Remainder)where
'a: 'b,
FieldType: ?Sized,
FieldPart: Part<PartType = Field<FieldType>>,
Self: PluckMut<'a, FieldPart, PartIndex>,
Self::Target: HasPart<FieldPart> + 'a,
fn split_part_mut<'b, FieldPart, PartIndex, FieldType>(
&'b mut self,
_part: FieldPart
) -> (&'a mut FieldType, Self::Remainder)where
'a: 'b,
FieldType: ?Sized,
FieldPart: Part<PartType = Field<FieldType>>,
Self: PluckMut<'a, FieldPart, PartIndex>,
Self::Target: HasPart<FieldPart> + 'a,
Mutable access to a part of the referenced value, splitting off the remaining parts. Read more
impl<'a, Target: PartialRefTarget> Copy for Ref<'a, Target>
An empty reference contains no mutable parts and thus is safe to clone.
Auto Trait Implementations
impl<'a, Target: ?Sized> RefUnwindSafe for Ref<'a, Target>where
Target: RefUnwindSafe,
<Target as PartialRefTarget>::RawTarget: RefUnwindSafe,
impl<'a, Target> !Send for Ref<'a, Target>
impl<'a, Target> !Sync for Ref<'a, Target>
impl<'a, Target: ?Sized> Unpin for Ref<'a, Target>
impl<'a, Target> !UnwindSafe for Ref<'a, Target>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Reference, Outer, OuterFieldType, Inner> HasPart<Nested<Outer, Inner>> for Referencewhere
Reference: HasPart<Outer> + ?Sized,
Outer: Part<PartType = Field<OuterFieldType>>,
Inner: Part,
OuterFieldType: HasPart<Inner, RawTarget = OuterFieldType> + PartialRefTarget + ?Sized,
impl<Reference, Outer, OuterFieldType, Inner> HasPart<Nested<Outer, Inner>> for Referencewhere
Reference: HasPart<Outer> + ?Sized,
Outer: Part<PartType = Field<OuterFieldType>>,
Inner: Part,
OuterFieldType: HasPart<Inner, RawTarget = OuterFieldType> + PartialRefTarget + ?Sized,
sourceunsafe fn part_ptr(
ptr: *const <Reference as PartialRefTarget>::RawTarget
) -> <<Inner as Part>::PartType as PartType>::Ptr
unsafe fn part_ptr(
ptr: *const <Reference as PartialRefTarget>::RawTarget
) -> <<Inner as Part>::PartType as PartType>::Ptr
Given a constant pointer to a target, produce a constant pointer to a part of it.
sourceunsafe fn part_ptr_mut(
ptr: *mut <Reference as PartialRefTarget>::RawTarget
) -> <<Inner as Part>::PartType as PartType>::PtrMut
unsafe fn part_ptr_mut(
ptr: *mut <Reference as PartialRefTarget>::RawTarget
) -> <<Inner as Part>::PartType as PartType>::PtrMut
Given a mutable pointer to a target, produce a mutable pointer to a part of it.