pub struct Batch<'a> { /* private fields */ }
Expand description
A batch of JSON-RPC requests.
Implementations§
Source§impl<'a> Batch<'a>
impl<'a> Batch<'a>
Sourcepub fn from(entries: Vec<Result<BatchEntry<'a>, BatchEntryErr<'a>>>) -> Self
pub fn from(entries: Vec<Result<BatchEntry<'a>, BatchEntryErr<'a>>>) -> Self
Create a new batch from a vector of batch entries.
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a new empty batch with the at least capacity.
Sourcepub fn iter(
&self,
) -> impl Iterator<Item = &Result<BatchEntry<'a>, BatchEntryErr<'a>>>
pub fn iter( &self, ) -> impl Iterator<Item = &Result<BatchEntry<'a>, BatchEntryErr<'a>>>
Get an iterator over the batch.
Sourcepub fn iter_mut(
&mut self,
) -> impl Iterator<Item = &mut Result<BatchEntry<'a>, BatchEntryErr<'a>>>
pub fn iter_mut( &mut self, ) -> impl Iterator<Item = &mut Result<BatchEntry<'a>, BatchEntryErr<'a>>>
Get a mutable iterator over the batch.
Sourcepub fn into_extensions(self) -> Extensions
pub fn into_extensions(self) -> Extensions
Consume the batch and and return the parts.
Sourcepub fn extensions(&mut self) -> &Extensions
pub fn extensions(&mut self) -> &Extensions
Get a reference to the extensions of the batch.
Sourcepub fn extensions_mut(&mut self) -> &mut Extensions
pub fn extensions_mut(&mut self) -> &mut Extensions
Get a mutable reference to the extensions of the batch.
Trait Implementations§
Source§impl<'a> IntoIterator for Batch<'a>
impl<'a> IntoIterator for Batch<'a>
Source§type Item = Result<BatchEntry<'a>, BatchEntryErr<'a>>
type Item = Result<BatchEntry<'a>, BatchEntryErr<'a>>
The type of the elements being iterated over.
Auto Trait Implementations§
impl<'a> Freeze for Batch<'a>
impl<'a> !RefUnwindSafe for Batch<'a>
impl<'a> Send for Batch<'a>
impl<'a> Sync for Batch<'a>
impl<'a> Unpin for Batch<'a>
impl<'a> !UnwindSafe for Batch<'a>
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