pub struct WriteView<'a, T, PW: OptionalWaiter, CW: OptionalWaiter> {
pub slices: (&'a mut [T], &'a mut [T]),
/* private fields */
}Expand description
View into the writable portion of the buffer.
Fields§
§slices: (&'a mut [T], &'a mut [T])Implementations§
Source§impl<'a, T, PW: OptionalWaiter, CW: OptionalWaiter> WriteView<'a, T, PW, CW>
impl<'a, T, PW: OptionalWaiter, CW: OptionalWaiter> WriteView<'a, T, PW, CW>
Sourcepub fn produce(self, amnt: usize)
pub fn produce(self, amnt: usize)
Produces the specified number of items, making them available to the receiver.
The remaining elements are dropped.
amnt is clamped to the number of items in this view.
Sourcepub fn iter(&mut self) -> Chain<IterMut<'_, T>, IterMut<'_, T>>
pub fn iter(&mut self) -> Chain<IterMut<'_, T>, IterMut<'_, T>>
Iterates through each available slot, in order.
Equivalent to chaining the two slice’s iterators.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Checks if the view is empty.
Equivalent to testing if the first slices is empty. If the first slice is empty, the second one will be as well.
Trait Implementations§
Source§impl<'a, T, PW: OptionalWaiter, CW: OptionalWaiter> Deref for WriteView<'a, T, PW, CW>
impl<'a, T, PW: OptionalWaiter, CW: OptionalWaiter> Deref for WriteView<'a, T, PW, CW>
Source§impl<'a, T, PW: OptionalWaiter, CW: OptionalWaiter> DerefMut for WriteView<'a, T, PW, CW>
impl<'a, T, PW: OptionalWaiter, CW: OptionalWaiter> DerefMut for WriteView<'a, T, PW, CW>
Source§impl<'a, T, PW: OptionalWaiter, CW: OptionalWaiter> Drop for WriteView<'a, T, PW, CW>
impl<'a, T, PW: OptionalWaiter, CW: OptionalWaiter> Drop for WriteView<'a, T, PW, CW>
Source§impl<'a, T, PW: OptionalWaiter, CW: OptionalWaiter> Index<usize> for WriteView<'a, T, PW, CW>
impl<'a, T, PW: OptionalWaiter, CW: OptionalWaiter> Index<usize> for WriteView<'a, T, PW, CW>
Auto Trait Implementations§
impl<'a, T, PW, CW> Freeze for WriteView<'a, T, PW, CW>
impl<'a, T, PW, CW> RefUnwindSafe for WriteView<'a, T, PW, CW>
impl<'a, T, PW, CW> Send for WriteView<'a, T, PW, CW>where
T: Send,
impl<'a, T, PW, CW> Sync for WriteView<'a, T, PW, CW>
impl<'a, T, PW, CW> Unpin for WriteView<'a, T, PW, CW>
impl<'a, T, PW, CW> !UnwindSafe for WriteView<'a, T, PW, CW>
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