pub struct RepeatedMut<'msg, T> { /* private fields */ }Expand description
Mutates the elements in a repeated field of T.
Implementations§
Source§impl<'msg, T: Singular> RepeatedMut<'msg, T>
impl<'msg, T: Singular> RepeatedMut<'msg, T>
Sourcepub fn get(&self, index: usize) -> Option<View<'_, T>>
pub fn get(&self, index: usize) -> Option<View<'_, T>>
Gets the value at index.
Returns None if index >= len.
Sourcepub fn get_mut(&mut self, index: usize) -> Option<Mut<'_, T>>where
T: Message,
pub fn get_mut(&mut self, index: usize) -> Option<Mut<'_, T>>where
T: Message,
Gets the value at index.
Returns None if index >= len.
Sourcepub unsafe fn get_mut_unchecked(&mut self, index: usize) -> Mut<'_, T>where
T: Message,
pub unsafe fn get_mut_unchecked(&mut self, index: usize) -> Mut<'_, T>where
T: Message,
Sourcepub unsafe fn get_unchecked(&self, index: usize) -> View<'_, T>
pub unsafe fn get_unchecked(&self, index: usize) -> View<'_, T>
Sourcepub fn push(&mut self, val: impl IntoProxied<T>)
pub fn push(&mut self, val: impl IntoProxied<T>)
Appends val to the end of the repeated field.
Sourcepub fn push_default(&mut self) -> Mut<'_, T>where
T: Message,
pub fn push_default(&mut self) -> Mut<'_, T>where
T: Message,
Appends the default message instance of T and returns a mutable reference to it.
Sourcepub fn set(&mut self, index: usize, val: impl IntoProxied<T>)
pub fn set(&mut self, index: usize, val: impl IntoProxied<T>)
Sourcepub unsafe fn set_unchecked(&mut self, index: usize, val: impl IntoProxied<T>)
pub unsafe fn set_unchecked(&mut self, index: usize, val: impl IntoProxied<T>)
Sourcepub fn iter(&self) -> RepeatedIter<'_, T> ⓘ
pub fn iter(&self) -> RepeatedIter<'_, T> ⓘ
Iterates over the values in the repeated field.
Sourcepub fn copy_from(&mut self, src: RepeatedView<'_, T>)
pub fn copy_from(&mut self, src: RepeatedView<'_, T>)
Copies from the src repeated field into this one.
Source§impl<'msg, T: Message> RepeatedMut<'msg, T>
impl<'msg, T: Message> RepeatedMut<'msg, T>
Trait Implementations§
Source§impl<'msg, T: Singular> AsMut for RepeatedMut<'msg, T>
impl<'msg, T: Singular> AsMut for RepeatedMut<'msg, T>
type MutProxied = Repeated<T>
Source§fn as_mut(&mut self) -> RepeatedMut<'_, T>
fn as_mut(&mut self) -> RepeatedMut<'_, T>
Converts a borrow into a
Mut with the lifetime of that borrow.Source§impl<'msg, T: Singular> AsView for RepeatedMut<'msg, T>
impl<'msg, T: Singular> AsView for RepeatedMut<'msg, T>
Source§impl<'msg, T> Debug for RepeatedMut<'msg, T>
impl<'msg, T> Debug for RepeatedMut<'msg, T>
Source§impl<'msg, T: Singular, ViewT> Extend<ViewT> for RepeatedMut<'msg, T>where
ViewT: IntoProxied<T>,
impl<'msg, T: Singular, ViewT> Extend<ViewT> for RepeatedMut<'msg, T>where
ViewT: IntoProxied<T>,
Source§fn extend<I: IntoIterator<Item = ViewT>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = ViewT>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: T)
fn extend_one(&mut self, item: T)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<'borrow, T: Singular> IntoIterator for &'borrow RepeatedMut<'_, T>
impl<'borrow, T: Singular> IntoIterator for &'borrow RepeatedMut<'_, T>
Source§impl<'msg, T: Singular> IntoMut<'msg> for RepeatedMut<'msg, T>
impl<'msg, T: Singular> IntoMut<'msg> for RepeatedMut<'msg, T>
Source§fn into_mut<'shorter>(self) -> RepeatedMut<'shorter, T>where
'msg: 'shorter,
fn into_mut<'shorter>(self) -> RepeatedMut<'shorter, T>where
'msg: 'shorter,
Converts into a
Mut with a potentially shorter lifetime. Read moreimpl<'msg, T: Singular> IntoProxied<Repeated<T>> for RepeatedMut<'msg, T>
Source§impl<'msg, T: Singular> IntoView<'msg> for RepeatedMut<'msg, T>
impl<'msg, T: Singular> IntoView<'msg> for RepeatedMut<'msg, T>
Source§fn into_view<'shorter>(self) -> RepeatedView<'shorter, T>where
'msg: 'shorter,
fn into_view<'shorter>(self) -> RepeatedView<'shorter, T>where
'msg: 'shorter,
Converts into a
View with a potentially shorter lifetime. Read moreimpl<'msg, T: Singular> SealedInternal for RepeatedMut<'msg, T>
impl<'msg, T> Sync for RepeatedMut<'msg, T>
Auto Trait Implementations§
impl<'msg, T> !RefUnwindSafe for RepeatedMut<'msg, T>
impl<'msg, T> !Send for RepeatedMut<'msg, T>
impl<'msg, T> !UnwindSafe for RepeatedMut<'msg, T>
impl<'msg, T> Forget for RepeatedMut<'msg, T>
impl<'msg, T> Freeze for RepeatedMut<'msg, T>
impl<'msg, T> Move for RepeatedMut<'msg, T>
impl<'msg, T> Unpin for RepeatedMut<'msg, T>
impl<'msg, T> UnsafeUnpin for RepeatedMut<'msg, T>
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