Closed cokeBeer closed 1 year ago
&mut I
infers it accepts any types, though probably including BytesInput
, but could be any other type. i.e. you have to tell it you want a mutations
which accepts BytesInput
, the concrete type instead of a generics type. Or depending on what you would like to build, try to create and add a trait for your I
to construct from a &str
(I think there should be some?).
@wtdcode Thanks. Actually I am building a mutator taking input bytes as a structure, parsing it and mutating target parts. After changing MT: MutatorsTuple<I, S>
to MT: MutatorsTuple<BytesInput, S>
, my code can work well.
impl<I, MT, S> MyMutator<I, MT, S>
where
MT: MutatorsTuple<BytesInput, S>, // here
S: HasRand,
I: HasBytesVec,
{
/// Create a new [`MyMutator`] instance specifying mutations
pub fn new(mutations: MT) -> Self {
MyMutator {
mutations,
phantom: PhantomData,
}
}
}
Hi, I am trying to implement a custom mutator like StdSchedulerMutator, which holds a MutatorsTuple. I need to send a new BytesInput to get_and_mutate to mutate it as it was shown in
mutate
.However, I encountered an error
How can I fix this ?