[−][src]Struct framering::RingFrameMut
A mutable frame which allows elements to be appended to the end
Implementations
impl<'ring, T, Cap: Capacity> RingFrameMut<'ring, T, Cap>
[src]
pub fn next(self) -> (RingFrame<'ring, T, Cap>, RingFrameMut<'ring, T, Cap>)
[src]
Freezes the current frame and creates a new mutable frame
Example
let mut ring = FramedRing::<i32, Pow2Capacity>::new(); let frame = ring.frame(); let (frame_ro, frame2) = frame.next();
pub fn next_reserve(
self,
frame_capacity: usize
) -> (RingFrame<'ring, T, Cap>, RingFrameMut<'ring, T, Cap>)
[src]
self,
frame_capacity: usize
) -> (RingFrame<'ring, T, Cap>, RingFrameMut<'ring, T, Cap>)
Freezes the current frame and creates a new mutable frame with the given amount of reserved elements
Example
let mut ring = FramedRing::<i32, LinearCapacity>::new(); let frame = ring.frame(); let (frame_ro, frame2) = frame.next_reserve(4); assert_eq!(ring.capacity(), 6);
pub fn push(&mut self, element: T)
[src]
Pushes an element onto the end of the frame
Example
let mut ring = FramedRing::<i32, Pow2Capacity>::new(); let mut frame = ring.frame(); frame.push(1);
pub fn reserve(&self, additional: usize)
[src]
Reserves capacity for at least additional
more elements into the given frame. The given
capacity may choose to reserve more space.
Example
let mut ring = FramedRing::<i32, LinearCapacity>::new(); let mut frame = ring.frame(); frame.reserve(4); assert_eq!(ring.capacity(), 5);
pub fn downgrade(self) -> RingFrame<'ring, T, Cap>
[src]
Downgrades a RingFrameMut to a RingFrame without producing a successor.
Example
let mut ring = FramedRing::<i32, Pow2Capacity>::new(); let mut frame = ring.frame(); frame.downgrade();
Trait Implementations
impl<'ring, T, Cap: Capacity> AsRef<RingFrame<'ring, T, Cap>> for RingFrameMut<'ring, T, Cap>
[src]
impl<'ring, T, Cap: Capacity> Extend<T> for RingFrameMut<'ring, T, Cap>
[src]
pub fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
[src]
pub fn extend_one(&mut self, item: A)
[src]
pub fn extend_reserve(&mut self, additional: usize)
[src]
impl<'ring, T, Cap: Capacity> From<RingFrameMut<'ring, T, Cap>> for RingFrame<'ring, T, Cap>
[src]
pub fn from(rfm: RingFrameMut<'ring, T, Cap>) -> Self
[src]
Auto Trait Implementations
impl<'ring, T, Cap> !RefUnwindSafe for RingFrameMut<'ring, T, Cap>
[src]
impl<'ring, T, Cap> !Send for RingFrameMut<'ring, T, Cap>
[src]
impl<'ring, T, Cap> !Sync for RingFrameMut<'ring, T, Cap>
[src]
impl<'ring, T, Cap> Unpin for RingFrameMut<'ring, T, Cap>
[src]
impl<'ring, T, Cap> !UnwindSafe for RingFrameMut<'ring, T, Cap>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,