use crate::reply::server;
#[derive(Debug)]
pub enum Outcome<T, E> {
Completed(T),
Failed(E),
Interrupted(E),
Server,
Skipped,
Unobserved,
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum Sync {
Complete,
Unobserved,
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum Position {
Command(usize),
Sync,
Recovery,
Connection,
Unknown,
}
#[derive(Debug)]
pub struct Diagnostic<'a> {
pub position: Position,
pub fields: server::Fields<'a>,
}
pub trait Diagnostics {
type Iter<'a>: Iterator<Item = Diagnostic<'a>>
where
Self: 'a;
fn iter(&self) -> Self::Iter<'_>;
fn len(&self) -> usize;
fn is_empty(&self) -> bool {
self.len() == 0
}
}