twizzler_driver/request/
summary.rs#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum SubmitSummaryWithResponses<R> {
Responses(Vec<R>),
Errors(usize, Vec<R>),
Shutdown,
}
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub(crate) enum AnySubmitSummary<R> {
Done,
Responses(Vec<R>),
Errors(usize, Vec<R>),
Shutdown,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum SubmitSummary {
Done,
Errors(usize),
Shutdown,
}
impl<R> From<AnySubmitSummary<R>> for SubmitSummary {
fn from(a: AnySubmitSummary<R>) -> Self {
match a {
AnySubmitSummary::Done => SubmitSummary::Done,
AnySubmitSummary::Responses(_) => panic!("cannot convert"),
AnySubmitSummary::Errors(e, _) => SubmitSummary::Errors(e),
AnySubmitSummary::Shutdown => SubmitSummary::Shutdown,
}
}
}
impl<R> From<AnySubmitSummary<R>> for SubmitSummaryWithResponses<R> {
fn from(a: AnySubmitSummary<R>) -> Self {
match a {
AnySubmitSummary::Responses(r) => SubmitSummaryWithResponses::Responses(r),
AnySubmitSummary::Done => panic!("cannot convert"),
AnySubmitSummary::Errors(e, r) => SubmitSummaryWithResponses::Errors(e, r),
AnySubmitSummary::Shutdown => SubmitSummaryWithResponses::Shutdown,
}
}
}