add builder to RustyPipe

This commit is contained in:
ThetaDev 2022-09-17 00:41:23 +02:00
parent d6cfc7e914
commit 17b6844eb0
10 changed files with 526 additions and 316 deletions

View file

@ -8,6 +8,10 @@ pub use vec_log_err::VecLogError;
use std::fmt::Debug;
/// This represents a result from a deserializing/mapping operation.
/// It holds the desired content (`c`) and a list of warning messages,
/// if there occurred minor error during the deserializing or mapping
/// (e.g. certain list items could not be deserialized).
#[derive(Clone)]
pub struct MapResult<T> {
pub c: T,

View file

@ -8,6 +8,11 @@ use serde_with::{de::DeserializeAsWrap, DeserializeAs};
use super::MapResult;
/// Deserializes a list of arbitrary items into a `MapResult`,
/// creating warnings for items that could not be deserialized.
///
/// This is similar to `VecSkipError`, but it does not silently ignore
/// faulty items.
pub struct VecLogError<T>(PhantomData<T>);
impl<'de, T, U> DeserializeAs<'de, MapResult<Vec<T>>> for VecLogError<U>