trait Indicator<In, Out> {
fn consume(&mut self, data: &Vec<In>) -> Vec<Out>;
}
Add
for all such indicators, such that if the Out
has Add
instance it should just add them
In
parameter for arbitrary Indicator
is not constrained. Is there a way to fix that too? Since I can't add PhantomData
field for arbitrary Indicator
impl<In, N, R> Add<R> for dyn Indicator<In, N> where R: Indicator<In, N>, N : Add<N> {
type Output = Zip<N, N, dyn Indicator<In, N>, R, fn(N, N)>;
fn add(self, rhs: R) -> Self::Output {
Zip {
left: self,
right: rhs,
zipper: Add::add,
left_buffer: VecDeque::new(),
right_buffer: VecDeque::new()
}
}
}
impl<In, N, I, R> Add<R> for I where I : Indicator<In, N>, R: Indicator<In, N>, N : Add<N>
impl<In, N, I, R> Add<R> for I where I : Indicator<In, N>, R: Indicator<In, N>, N : Add<N>
as i dont have anywere to check it
unconstrained type parameter
both for In
and N
struct Indicator<In, Transducer, Out> {
input: PhantomData<In>,
output: PhantomData<Out>,
processor: Transducer
}
+
select p.id,name, gender, p.email, phone, age, photo , industry, tags, country , area, twitter, user_list_id from people
as p left join
(
select * from list_people lp
inner join user_list ul on lp.user_list_id = ul.id
inner join users u on ul.user_id = u.id
where u.id = 1
) g on p.id = g.people_id
Dear All,
I am new on Rust, I want using Serde Destabilize struct that contain field uuid (byte) any help to archive that
`pub fn decode_serde<'de, T, R>(r: R) -> io::Result<T>
where
T: Deserialize<'de>,
R: io::Read,
{
Deserialize::deserialize(&mut Deserializer::new(r)).map_err(map_err_to_io)
}`
With Deserialize::deserialize
can modified to support uuid ?
Uuid
from the uuid
crate? Do you need some specific way of storing it in the table?
uuid
's serde
feature?
#[serde(with = "uuid::serde::compact")]
specified for that specific field, I think.