[−][src]Trait partial_ref::HasPart
Implemented when a reference target has a part.
This trait provides methods for unchecked access to a part of a reference target. Implementations for this are automatically created when deriving PartialRefTarget.
Required methods
unsafe fn part_ptr(
ptr: *const Self::RawTarget
) -> <SomePart::PartType as PartType>::Ptr
ptr: *const Self::RawTarget
) -> <SomePart::PartType as PartType>::Ptr
Given a constant pointer to a target, produce a constant pointer to a part of it.
Safety
Implementations may construct a temporary reference to ptr, which thus must be valid.
unsafe fn part_ptr_mut(
ptr: *mut Self::RawTarget
) -> <SomePart::PartType as PartType>::PtrMut
ptr: *mut Self::RawTarget
) -> <SomePart::PartType as PartType>::PtrMut
Given a mutable pointer to a target, produce a mutable pointer to a part of it.
Safety
Implementations may construct a temporary reference to ptr, which thus must be valid.
Implementors
impl<Reference, Outer, OuterFieldType, Inner> HasPart<Nested<Outer, Inner>> for Reference where
Reference: ?Sized,
Reference: HasPart<Outer>,
Outer: Part<PartType = Field<OuterFieldType>>,
Inner: Part,
OuterFieldType: ?Sized,
OuterFieldType: HasPart<Inner>,
OuterFieldType: PartialRefTarget<RawTarget = OuterFieldType>,
[src]
Reference: ?Sized,
Reference: HasPart<Outer>,
Outer: Part<PartType = Field<OuterFieldType>>,
Inner: Part,
OuterFieldType: ?Sized,
OuterFieldType: HasPart<Inner>,
OuterFieldType: PartialRefTarget<RawTarget = OuterFieldType>,
A reference has a nested part if it has the outer part and the nested part is valid.