Inlining::itell
This commit is contained in:
parent
1ad66307e8
commit
8558b8d1ba
@ -17,6 +17,8 @@ pub trait Inlining: Sized {
|
||||
ok: impl FnOnce(&[u8]) -> A,
|
||||
err: impl FnOnce(&[u8]) -> E,
|
||||
) -> Result<(A, Self), E>;
|
||||
|
||||
fn itell(&self) -> usize;
|
||||
}
|
||||
|
||||
pub trait InliningExt<E>: Inlining {
|
||||
@ -44,6 +46,10 @@ impl<D: ?Sized + Deserializer> Inlining for &mut D {
|
||||
Err(err(slice))
|
||||
}
|
||||
}
|
||||
|
||||
fn itell(&self) -> usize {
|
||||
self.tell()
|
||||
}
|
||||
}
|
||||
|
||||
pub trait InCtx<'a, Ctx: Context<'a>>: Inlining {}
|
||||
@ -64,6 +70,10 @@ impl<'a: 'c, 'c, Ctx: Context<'a>> Inlining for InCtxT<'a, 'c, Ctx> {
|
||||
Err(e) => Err(e),
|
||||
}
|
||||
}
|
||||
|
||||
fn itell(&self) -> usize {
|
||||
self.dectx.tell()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a: 'c, 'c, Ctx: Context<'a>> InCtx<'a, Ctx> for InCtxT<'a, 'c, Ctx> {}
|
||||
|
Loading…
Reference in New Issue
Block a user