pub struct GenericBulkService<E, DTO, S> { /* private fields */ }Expand description
Generic bulk service over any entity+DTO+service triple.
E — entity type
DTO — create DTO type
S — underlying single-entity service (implements BulkCapableService<E, DTO>)
Implementations§
Source§impl<E, DTO, S> GenericBulkService<E, DTO, S>
impl<E, DTO, S> GenericBulkService<E, DTO, S>
pub fn new(service: Arc<S>) -> Self
pub fn with_config(service: Arc<S>, config: BulkOperationConfig) -> Self
Sourcepub async fn bulk_create(
&self,
items: Vec<DTO>,
) -> ServiceResult<(BulkOperationResult<E>, BulkOperationProgress)>
pub async fn bulk_create( &self, items: Vec<DTO>, ) -> ServiceResult<(BulkOperationResult<E>, BulkOperationProgress)>
Create multiple entities. Respects failure_mode from config.
Returns (BulkOperationResult, BulkOperationProgress) so callers can
inspect final progress stats alongside the per-item outcomes.
Sourcepub async fn bulk_delete(
&self,
ids: Vec<String>,
) -> ServiceResult<(BulkOperationResult<()>, BulkOperationProgress)>
pub async fn bulk_delete( &self, ids: Vec<String>, ) -> ServiceResult<(BulkOperationResult<()>, BulkOperationProgress)>
Delete multiple entities by ID.
Auto Trait Implementations§
impl<E, DTO, S> Freeze for GenericBulkService<E, DTO, S>
impl<E, DTO, S> RefUnwindSafe for GenericBulkService<E, DTO, S>
impl<E, DTO, S> Send for GenericBulkService<E, DTO, S>
impl<E, DTO, S> Sync for GenericBulkService<E, DTO, S>
impl<E, DTO, S> Unpin for GenericBulkService<E, DTO, S>
impl<E, DTO, S> UnsafeUnpin for GenericBulkService<E, DTO, S>
impl<E, DTO, S> UnwindSafe for GenericBulkService<E, DTO, S>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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