[][src]Struct framering::RingFrameMut

pub struct RingFrameMut<'ring, T, Cap: Capacity> { /* fields omitted */ }

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]

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]

impl<'ring, T, Cap: Capacity> From<RingFrameMut<'ring, T, Cap>> for RingFrame<'ring, T, Cap>[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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.