pub struct WriteResultDetailed {
pub keys_written: usize,
pub keys_failed: usize,
pub keys_skipped: usize,
pub succeeded_keys: Vec<String>,
pub errors: Vec<KeyError>,
}Expand description
Detailed result of a write operation with per-key error information.
This provides granular error reporting for production workflows where partial success is acceptable and retry logic is needed.
§Example
ⓘ
let result = write_hashes_detailed(url, keys, fields, values, None, WriteMode::Replace)?;
println!("Succeeded: {}", result.keys_written);
println!("Failed: {}", result.keys_failed);
for error in &result.errors {
eprintln!("Key {} failed: {}", error.key, error.error);
}
// Get list of failed keys for retry
let failed_keys: Vec<&str> = result.failed_keys();Fields§
§keys_written: usizeNumber of keys successfully written.
keys_failed: usizeNumber of keys that failed to write.
keys_skipped: usizeNumber of keys skipped because they already exist (when mode is Fail).
succeeded_keys: Vec<String>List of keys that were successfully written.
errors: Vec<KeyError>Detailed error information for each failed key.
Implementations§
Source§impl WriteResultDetailed
impl WriteResultDetailed
Sourcepub fn failed_keys(&self) -> Vec<&str>
pub fn failed_keys(&self) -> Vec<&str>
Get a list of keys that failed to write.
Sourcepub fn error_map(&self) -> HashMap<&str, &str>
pub fn error_map(&self) -> HashMap<&str, &str>
Get a map of failed keys to their error messages.
Sourcepub fn is_complete_success(&self) -> bool
pub fn is_complete_success(&self) -> bool
Check if all keys were written successfully.
Sourcepub fn to_basic(&self) -> WriteResult
pub fn to_basic(&self) -> WriteResult
Convert to a basic WriteResult (discards per-key details).
Trait Implementations§
Source§impl Clone for WriteResultDetailed
impl Clone for WriteResultDetailed
Source§fn clone(&self) -> WriteResultDetailed
fn clone(&self) -> WriteResultDetailed
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WriteResultDetailed
impl Debug for WriteResultDetailed
Auto Trait Implementations§
impl Freeze for WriteResultDetailed
impl RefUnwindSafe for WriteResultDetailed
impl Send for WriteResultDetailed
impl Sync for WriteResultDetailed
impl Unpin for WriteResultDetailed
impl UnwindSafe for WriteResultDetailed
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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