pub struct PokeList<'mem, 'facet> { /* private fields */ }Expand description
Lets you mutate a list (implements mutable facet_core::ListVTable proxies)
Implementations§
Source§impl<'mem, 'facet> PokeList<'mem, 'facet>
impl<'mem, 'facet> PokeList<'mem, 'facet>
Sourcepub const unsafe fn new(value: Poke<'mem, 'facet>, def: ListDef) -> Self
pub const unsafe fn new(value: Poke<'mem, 'facet>, def: ListDef) -> Self
Creates a new poke list
§Safety
The caller must ensure that def contains valid vtable function pointers that:
- Correctly implement the list operations for the actual type
- Do not cause undefined behavior when called
- Return pointers within valid memory bounds
- Match the element type specified in
def.t()
Violating these requirements can lead to memory safety issues.
Sourcepub fn get(&self, index: usize) -> Option<Peek<'_, 'facet>>
pub fn get(&self, index: usize) -> Option<Peek<'_, 'facet>>
Get an immutable reference to an item from the list at the specified index
Sourcepub fn get_mut(&mut self, index: usize) -> Option<Poke<'_, 'facet>>
pub fn get_mut(&mut self, index: usize) -> Option<Poke<'_, 'facet>>
Get a mutable reference to an item from the list at the specified index
Sourcepub fn iter_mut(self) -> PokeListIter<'mem, 'facet> ⓘ
pub fn iter_mut(self) -> PokeListIter<'mem, 'facet> ⓘ
Returns a mutable iterator over the list
Sourcepub fn into_inner(self) -> Poke<'mem, 'facet>
pub fn into_inner(self) -> Poke<'mem, 'facet>
Converts this PokeList back into a Poke
Sourcepub fn as_peek_list(&self) -> PeekList<'_, 'facet>
pub fn as_peek_list(&self) -> PeekList<'_, 'facet>
Returns a read-only PeekList view
Trait Implementations§
Source§impl<'mem, 'facet> IntoIterator for PokeList<'mem, 'facet>
impl<'mem, 'facet> IntoIterator for PokeList<'mem, 'facet>
Auto Trait Implementations§
impl<'mem, 'facet> Freeze for PokeList<'mem, 'facet>
impl<'mem, 'facet> RefUnwindSafe for PokeList<'mem, 'facet>
impl<'mem, 'facet> !Send for PokeList<'mem, 'facet>
impl<'mem, 'facet> !Sync for PokeList<'mem, 'facet>
impl<'mem, 'facet> Unpin for PokeList<'mem, 'facet>
impl<'mem, 'facet> !UnwindSafe for PokeList<'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