pub struct PokeTuple<'mem, 'facet> { /* private fields */ }Expand description
Lets you mutate a tuple’s fields (by index).
Tuples are just tuple-struct types without names, so this is a thin wrapper that exposes ordered field access.
Implementations§
Source§impl<'mem, 'facet> PokeTuple<'mem, 'facet>
impl<'mem, 'facet> PokeTuple<'mem, 'facet>
Sourcepub fn field(&self, index: usize) -> Option<Peek<'_, 'facet>>
pub fn field(&self, index: usize) -> Option<Peek<'_, 'facet>>
Returns a read-only Peek for the field at the given index.
Sourcepub fn field_mut(
&mut self,
index: usize,
) -> Result<Poke<'_, 'facet>, ReflectError>
pub fn field_mut( &mut self, index: usize, ) -> Result<Poke<'_, 'facet>, ReflectError>
Returns a mutable Poke for the field at the given index.
Sourcepub fn set_field<T: Facet<'facet>>(
&mut self,
index: usize,
value: T,
) -> Result<(), ReflectError>
pub fn set_field<T: Facet<'facet>>( &mut self, index: usize, value: T, ) -> Result<(), ReflectError>
Sets the value of a field by index.
The value type must match the field’s type.
Returns an error if the parent tuple is not POD. Field mutation could violate
tuple-level invariants, so the tuple must be marked with #[facet(pod)] to allow this.
Sourcepub const fn into_inner(self) -> Poke<'mem, 'facet>
pub const fn into_inner(self) -> Poke<'mem, 'facet>
Converts this back into the underlying Poke.
Sourcepub fn as_peek_tuple(&self) -> PeekTuple<'_, 'facet>
pub fn as_peek_tuple(&self) -> PeekTuple<'_, 'facet>
Returns a read-only PeekTuple view.
Trait Implementations§
Auto Trait Implementations§
impl<'mem, 'facet> Freeze for PokeTuple<'mem, 'facet>
impl<'mem, 'facet> RefUnwindSafe for PokeTuple<'mem, 'facet>
impl<'mem, 'facet> !Send for PokeTuple<'mem, 'facet>
impl<'mem, 'facet> !Sync for PokeTuple<'mem, 'facet>
impl<'mem, 'facet> Unpin for PokeTuple<'mem, 'facet>
impl<'mem, 'facet> UnsafeUnpin for PokeTuple<'mem, 'facet>
impl<'mem, 'facet> !UnwindSafe for PokeTuple<'mem, 'facet>
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
Mutably borrows from an owned value. Read more