EnhancedCollectionIterator

Struct EnhancedCollectionIterator 

Source
pub struct EnhancedCollectionIterator<'a, T> { /* private fields */ }
Expand description

Enhanced collection iterator with rate limiting and progress tracking

Implementations§

Source§

impl<'a, T> EnhancedCollectionIterator<'a, T>

Constructor methods for EnhancedCollectionIterator

Source

pub fn new(client: &'a Client, url: impl Into<String>) -> Self

Create a new enhanced iterator with default configuration

Source

pub fn with_config( client: &'a Client, url: impl Into<String>, config: IteratorConfig, ) -> Self

Create a new enhanced iterator with custom configuration

Source§

impl<'a, T> EnhancedCollectionIterator<'a, T>

Builder pattern methods for EnhancedCollectionIterator

Source

pub fn with_limit(self, limit: u32) -> Self

Set batch size limit

Source

pub fn with_rate_limiter(self, limiter: Arc<TokenBucketLimiter>) -> Self

Set custom rate limiter

Source§

impl<'a, T> EnhancedCollectionIterator<'a, T>

Accessor methods for EnhancedCollectionIterator

Source

pub fn total_fetched(&self) -> u64

Get total items fetched so far

Source

pub fn batch_count(&self) -> u32

Get number of batches fetched

Trait Implementations§

Source§

impl<'a, T> PaginatedIterator<T> for EnhancedCollectionIterator<'a, T>

Source§

type Error = Error

Source§

fn next_batch<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Vec<T>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch the next batch of items
Source§

fn has_more(&self) -> bool

Check if there are more items to fetch
Source§

fn hint_remaining(&self) -> Option<usize>

Get an approximation of items remaining if available
Source§

fn stats(&self) -> IteratorStats

Get statistics about fetching
Source§

fn collect_all<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = Result<Vec<T>, Self::Error>> + Send + 'async_trait>>
where Self: Sized + Send + 'async_trait,

Collect all remaining items

Auto Trait Implementations§

§

impl<'a, T> Freeze for EnhancedCollectionIterator<'a, T>

§

impl<'a, T> !RefUnwindSafe for EnhancedCollectionIterator<'a, T>

§

impl<'a, T> Send for EnhancedCollectionIterator<'a, T>
where T: Send,

§

impl<'a, T> Sync for EnhancedCollectionIterator<'a, T>
where T: Sync,

§

impl<'a, T> Unpin for EnhancedCollectionIterator<'a, T>
where T: Unpin,

§

impl<'a, T> !UnwindSafe for EnhancedCollectionIterator<'a, T>

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<I, T> Collectable<T> for I
where I: PaginatedIterator<T> + Send, T: Send,

Source§

type Error = <I as PaginatedIterator<T>>::Error

Source§

fn take<'async_trait>( self, n: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<T>, <I as Collectable<T>>::Error>> + Send + 'async_trait>>
where I: 'async_trait,

Take a specific number of items
Source§

fn take_while<'async_trait, F>( self, predicate: F, ) -> Pin<Box<dyn Future<Output = Result<Vec<T>, <I as Collectable<T>>::Error>> + Send + 'async_trait>>
where F: Fn(&T) -> bool + Send + 'async_trait, I: 'async_trait,

Take items while a condition is true
Source§

fn collect_all<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = Result<Vec<T>, <I as Collectable<T>>::Error>> + Send + 'async_trait>>
where I: 'async_trait,

Collect all items
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<I, T> IteratorExt<T> for I
where T: Send, I: PaginatedIterator<T>,

Source§

fn map<U, F>(self, mapper: F) -> MappedIterator<Self, T, U, F>
where Self: Sized, U: Send, F: Fn(T) -> U + Send + Sync,

Map items to a different type
Source§

fn filter<F>(self, predicate: F) -> FilteredIterator<Self, T, F>
where Self: Sized, F: Fn(&T) -> bool + Send + Sync,

Filter items based on a predicate
Source§

fn take_until<F>(self, condition: F) -> TakeUntilIterator<Self, T, F>
where Self: Sized, F: Fn(&T) -> bool + Send + Sync,

Take items until a condition is met
Source§

fn batch(self, size: usize) -> BatchIterator<Self, T>
where Self: Sized,

Batch items into chunks
Source§

fn throttle(self, delay: Duration) -> ThrottledIterator<Self, T>
where Self: Sized,

Throttle iteration with delays
Source§

fn retry(self, max_retries: u32, base_delay: Duration) -> RetryIterator<Self, T>
where Self: Sized,

Add retry logic to iterations
Source§

fn with_progress(self, tracker: ProgressTracker) -> ProgressIterator<Self, T>
where Self: Sized,

Add progress tracking
Source§

fn cached(self) -> CachedIterator<Self, T>
where Self: Sized,

Cache results for repeated iteration
Source§

fn skip(self, count: usize) -> SkippedIterator<Self, T>
where Self: Sized,

Skip a number of items
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,