polars_arrow::io::iterator

Struct BufStreamingIterator

Source
pub struct BufStreamingIterator<I, F, T>
where I: Iterator<Item = T>, F: FnMut(T, &mut Vec<u8>),
{ /* private fields */ }
Expand description

A StreamingIterator with an internal buffer of Vec<u8> used to efficiently present items of type T as &[u8]. It is generic over the type T and the transformation F: T -> &[u8].

Implementations§

Source§

impl<I, F, T> BufStreamingIterator<I, F, T>
where I: Iterator<Item = T>, F: FnMut(T, &mut Vec<u8>),

Source

pub fn new(iterator: I, f: F, buffer: Vec<u8>) -> Self

Trait Implementations§

Source§

impl<I, F, T> StreamingIterator for BufStreamingIterator<I, F, T>
where I: Iterator<Item = T>, F: FnMut(T, &mut Vec<u8>),

Source§

type Item = [u8]

The type of the elements being iterated over.
Source§

fn advance(&mut self)

Advances the iterator to the next element. Read more
Source§

fn get(&self) -> Option<&Self::Item>

Returns a reference to the current element of the iterator. Read more
Source§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the iterator.
Source§

fn next(&mut self) -> Option<&Self::Item>

Advances the iterator and returns the next value. Read more
Source§

fn is_done(&self) -> bool

Checks if get() will return None.
Source§

fn all<F>(&mut self, f: F) -> bool
where Self: Sized, F: FnMut(&Self::Item) -> bool,

Determines if all elements of the iterator satisfy a predicate.
Source§

fn any<F>(&mut self, f: F) -> bool
where Self: Sized, F: FnMut(&Self::Item) -> bool,

Determines if any elements of the iterator satisfy a predicate.
Source§

fn by_ref(&mut self) -> &mut Self
where Self: Sized,

Borrows an iterator, rather than consuming it. Read more
Source§

fn chain<I>(self, other: I) -> Chain<Self, I>
where Self: Sized, I: StreamingIterator<Item = Self::Item>,

Consumes two iterators and returns a new iterator that iterates over both in sequence.
Source§

fn count(self) -> usize
where Self: Sized,

Consumes the iterator, counting the number of remaining elements and returning it.
Source§

fn filter<F>(self, f: F) -> Filter<Self, F>
where Self: Sized, F: FnMut(&Self::Item) -> bool,

Creates an iterator which uses a closure to determine if an element should be yielded.
Source§

fn filter_map<B, F>(self, f: F) -> FilterMap<Self, B, F>
where Self: Sized, F: FnMut(&Self::Item) -> Option<B>,

Creates an iterator which both filters and maps by applying a closure to elements.
Source§

fn flat_map<J, F>(self, f: F) -> FlatMap<Self, J, F>
where Self: Sized, J: StreamingIterator, F: FnMut(&Self::Item) -> J,

Creates an iterator which flattens iterators obtained by applying a closure to elements. Note that the returned iterators must be streaming iterators.
Source§

fn filter_map_deref<B, F>(self, f: F) -> FilterMapDeref<Self, F>
where Self: Sized, F: FnMut(&Self::Item) -> Option<B>,

Creates a regular, non-streaming iterator which both filters and maps by applying a closure to elements.
Source§

fn find<F>(&mut self, f: F) -> Option<&Self::Item>
where Self: Sized, F: FnMut(&Self::Item) -> bool,

Returns the first element of the iterator that satisfies the predicate.
Source§

fn fuse(self) -> Fuse<Self>
where Self: Sized,

Creates an iterator which is “well behaved” at the beginning and end of iteration. Read more
Source§

fn inspect<F>(self, f: F) -> Inspect<Self, F>
where F: FnMut(&Self::Item), Self: Sized,

Call a closure on each element, passing the element on. The closure is called upon calls to advance or advance_back, and exactly once per element regardless of how many times (if any) get is called.
Source§

fn map<B, F>(self, f: F) -> Map<Self, B, F>
where Self: Sized, F: FnMut(&Self::Item) -> B,

Creates an iterator which transforms elements of this iterator by passing them to a closure.
Source§

fn map_deref<B, F>(self, f: F) -> MapDeref<Self, F>
where Self: Sized, F: FnMut(&Self::Item) -> B,

Creates a regular, non-streaming iterator which transforms elements of this iterator by passing them to a closure.
Source§

fn map_ref<B, F>(self, f: F) -> MapRef<Self, F>
where Self: Sized, F: Fn(&Self::Item) -> &B, B: ?Sized,

Creates an iterator which transforms elements of this iterator by passing them to a closure. Read more
Source§

fn nth(&mut self, n: usize) -> Option<&Self::Item>

Consumes the first n elements of the iterator, returning the next one.
Source§

fn position<F>(&mut self, f: F) -> Option<usize>
where Self: Sized, F: FnMut(&Self::Item) -> bool,

Returns the index of the first element of the iterator matching a predicate.
Source§

fn skip(self, n: usize) -> Skip<Self>
where Self: Sized,

Creates an iterator which skips the first n elements.
Source§

fn skip_while<F>(self, f: F) -> SkipWhile<Self, F>
where Self: Sized, F: FnMut(&Self::Item) -> bool,

Creates an iterator that skips initial elements matching a predicate.
Source§

fn take(self, n: usize) -> Take<Self>
where Self: Sized,

Creates an iterator which only returns the first n elements.
Source§

fn take_while<F>(self, f: F) -> TakeWhile<Self, F>
where Self: Sized, F: FnMut(&Self::Item) -> bool,

Creates an iterator which only returns initial elements matching a predicate.
Source§

fn fold<B, F>(self, init: B, f: F) -> B
where Self: Sized, F: FnMut(B, &Self::Item) -> B,

Reduces the iterator’s elements to a single, final value.
Source§

fn for_each<F>(self, f: F)
where Self: Sized, F: FnMut(&Self::Item),

Calls a closure on each element of an iterator.

Auto Trait Implementations§

§

impl<I, F, T> Freeze for BufStreamingIterator<I, F, T>
where I: Freeze, F: Freeze,

§

impl<I, F, T> RefUnwindSafe for BufStreamingIterator<I, F, T>

§

impl<I, F, T> Send for BufStreamingIterator<I, F, T>
where I: Send, F: Send,

§

impl<I, F, T> Sync for BufStreamingIterator<I, F, T>
where I: Sync, F: Sync,

§

impl<I, F, T> Unpin for BufStreamingIterator<I, F, T>
where I: Unpin, F: Unpin,

§

impl<I, F, T> UnwindSafe for BufStreamingIterator<I, F, T>
where I: UnwindSafe, F: UnwindSafe,

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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize = _

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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.