pub mod recoverable {
use crate::*;
pub trait Accessor<'value, Err> {
/// Each time this is called the walker resets.
fn walk_new(&mut self, visitor: &mut dyn Visitor<'value, Err>) -> Result<(), Err>;
}
pub enum Recoverable {}
impl<'value> Protocol<'value> for Recoverable {
type Hint = ();
type Known = ();
type Accessor<'walking, Err: Error<'value>> = &'walking dyn Accessor<'value, Err>
where
'value: 'walking;
}
}
pub mod str {
use crate::*;
pub enum Kind {
Walking,
Value,
Static,
}
pub struct Hint {
pub kind: Option<Kind>,
pub min_len: Option<usize>,
pub max_len: Option<usize>,
}
pub struct Known {
pub kind: Option<Kind>,
pub len: Option<usize>,
}
pub enum Data<'walking, 'value> {
Walking(&'walking str),
Value(&'value str),
Static(&'static str),
}
pub enum Str {}
impl<'value> Protocol<'value> for Str {
type Hint = Hint;
type Known = Known;
type Accessor<'walking, Err: Error<'value>> = Data<'walking, 'value>
where
'value: 'walking;
}
}