Struct ItemBuffer

Source
pub struct ItemBuffer { /* private fields */ }
Expand description

Buffer to clone OSM items into

Implementations§

Source§

impl ItemBuffer

Source

pub const fn new() -> Self

Construct a new, empty buffer.

Source

pub fn with_capacity(size: usize) -> Self

Constructs a new, empty buffer with at least the specified capacity.

Note the capacity is in bytes not number of items, since they are all dynamically sized.

Source

pub fn push(&mut self, item: &impl AsRef<Item>)

Appends an item to the back of the buffer.

Source

pub fn iter(&self) -> ItemBufferIterator<'_>

Returns an iterator over the buffer.

The iterator yields all items from start to end.

Source

pub fn fits(&self, item: &impl AsRef<Item>) -> bool

Check whether an item fits into the buffer’s remaining space without reallocating.

Source

pub fn is_empty(&self) -> bool

Return true if the buffer contains no items.

Source

pub fn clear(&mut self)

Clears the whole buffer, removing all items.

Note that this method has no effect on the allocated capacity of the vector.

Trait Implementations§

Source§

impl Clone for ItemBuffer

Source§

fn clone(&self) -> ItemBuffer

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ItemBuffer

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Print a list of the contained items’ types

Source§

impl Default for ItemBuffer

Source§

fn default() -> ItemBuffer

Returns the “default value” for a type. Read more
Source§

impl<'b> IntoIterator for &'b ItemBuffer

Source§

type Item = &'b Item

The type of the elements being iterated over.
Source§

type IntoIter = ItemBufferIterator<'b>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.