pub struct VecSplice<'a, 'b, T> { /* private fields */ }
Implementations§
source§impl<'a, 'b, T> VecSplice<'a, 'b, T>
impl<'a, 'b, T> VecSplice<'a, 'b, T>
pub fn new(v: &'a mut Vec<T>, scratch: &'b mut Vec<T>) -> Self
pub fn skip(&mut self, n: usize)
pub fn delete(&mut self, n: usize)
pub fn push(&mut self, value: T)
pub fn mutate(&mut self) -> &mut T
pub fn last_mutated(&self) -> Option<&T>
pub fn last_mutated_mut(&mut self) -> Option<&mut T>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn as_vec<R, F: FnOnce(&mut Vec<T>) -> R>(&mut self, f: F) -> R
Trait Implementations§
source§impl ElementSplice for VecSplice<'_, '_, WidgetPod<Box<dyn Widget>>>
impl ElementSplice for VecSplice<'_, '_, WidgetPod<Box<dyn Widget>>>
source§fn push(&mut self, element: WidgetPod<Box<dyn Widget>>)
fn push(&mut self, element: WidgetPod<Box<dyn Widget>>)
Insert a new element at the current index in the resulting collection (and increment the index by 1)
source§fn mutate(&mut self) -> WidgetMut<'_, Box<dyn Widget>>
fn mutate(&mut self) -> WidgetMut<'_, Box<dyn Widget>>
Mutate the next existing element, and add it to the resulting collection (and increment the index by 1)
Auto Trait Implementations§
impl<'a, 'b, T> Freeze for VecSplice<'a, 'b, T>
impl<'a, 'b, T> RefUnwindSafe for VecSplice<'a, 'b, T>where
T: RefUnwindSafe,
impl<'a, 'b, T> Send for VecSplice<'a, 'b, T>where
T: Send,
impl<'a, 'b, T> Sync for VecSplice<'a, 'b, T>where
T: Sync,
impl<'a, 'b, T> Unpin for VecSplice<'a, 'b, T>
impl<'a, 'b, T> !UnwindSafe for VecSplice<'a, 'b, T>
Blanket Implementations§
source§impl<T> AsAny for Twhere
T: Any,
impl<T> AsAny for Twhere
T: Any,
source§fn as_dyn_any(&self) -> &(dyn Any + 'static)
fn as_dyn_any(&self) -> &(dyn Any + 'static)
Return self.
source§fn as_mut_dyn_any(&mut self) -> &mut (dyn Any + 'static)
fn as_mut_dyn_any(&mut self) -> &mut (dyn Any + 'static)
Return self.
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
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.