pub struct Batch { /* private fields */ }Expand description
Builder for sending up to 500 tracks in a single HTTP request.
Implementations§
Source§impl Batch
impl Batch
Sourcepub fn push(self, track: Track) -> Self
pub fn push(self, track: Track) -> Self
Adds a track to the batch.
Validation is deferred until Batch::send, preserving a fluent API.
Sourcepub fn extend(self, tracks: impl IntoIterator<Item = Track>) -> Self
pub fn extend(self, tracks: impl IntoIterator<Item = Track>) -> Self
Adds multiple tracks to the batch.
Sourcepub fn continue_from(self, response: &TrackResponse) -> Self
pub fn continue_from(self, response: &TrackResponse) -> Self
Reuses the cache value returned by a previous single-track response.
Sourcepub async fn send(self) -> Result<BatchResponse>
pub async fn send(self) -> Result<BatchResponse>
Sends the batch to Umami.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Batch
impl !UnwindSafe for Batch
impl Freeze for Batch
impl Send for Batch
impl Sync for Batch
impl Unpin for Batch
impl UnsafeUnpin for Batch
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more