pub struct DeferredValidation { /* private fields */ }
Expand description
Enhanced deferred validation wrapper with cancellation and timeout support
This struct ensures that validation futures are Send + Sync and provides cancellation and timeout mechanisms for robust async validation.
Implementations§
Source§impl DeferredValidation
impl DeferredValidation
Sourcepub fn new<P: AsRef<Path>>(
file_path: P,
expected_count: usize,
config: ValidationConfig,
) -> Self
pub fn new<P: AsRef<Path>>( file_path: P, expected_count: usize, config: ValidationConfig, ) -> Self
Create new deferred validation
Sourcepub fn with_timeout<P: AsRef<Path>>(
file_path: P,
expected_count: usize,
config: ValidationConfig,
timeout_duration: Duration,
) -> Self
pub fn with_timeout<P: AsRef<Path>>( file_path: P, expected_count: usize, config: ValidationConfig, timeout_duration: Duration, ) -> Self
Create deferred validation with custom timeout
Sourcepub fn start_validation(&mut self) -> TrackingResult<()>
pub fn start_validation(&mut self) -> TrackingResult<()>
Start the validation process synchronously
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Check if validation is complete
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Check if validation is running
Sourcepub fn is_pending(&self) -> bool
pub fn is_pending(&self) -> bool
Check if validation is pending
Sourcepub fn cancel(&mut self) -> TrackingResult<()>
pub fn cancel(&mut self) -> TrackingResult<()>
Cancel the validation if it’s running
Sourcepub async fn get_result(&mut self) -> TrackingResult<ValidationResult>
pub async fn get_result(&mut self) -> TrackingResult<ValidationResult>
Get validation result if available
Sourcepub fn get_status(&self) -> ValidationStatus
pub fn get_status(&self) -> ValidationStatus
Get current validation status
Sourcepub fn get_file_path(&self) -> String
pub fn get_file_path(&self) -> String
Get file path being validated
Sourcepub fn set_timeout(&mut self, timeout_duration: Duration)
pub fn set_timeout(&mut self, timeout_duration: Duration)
Set timeout duration
Sourcepub fn set_cancellable(&mut self, cancellable: bool)
pub fn set_cancellable(&mut self, cancellable: bool)
Set cancellable flag
Sourcepub async fn await_result(self) -> TrackingResult<ValidationResult>
pub async fn await_result(self) -> TrackingResult<ValidationResult>
Await the validation result (compatibility method)
Trait Implementations§
impl Send for DeferredValidation
impl Sync for DeferredValidation
Auto Trait Implementations§
impl Freeze for DeferredValidation
impl RefUnwindSafe for DeferredValidation
impl Unpin for DeferredValidation
impl UnwindSafe for DeferredValidation
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
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