inlining dyn lifetimes
This commit is contained in:
parent
b5862b45fd
commit
6a4cb9504c
@ -88,18 +88,18 @@ impl<'a: 'c, 'c, Ctx: Context<'a>> InCtx<'a, Ctx> for &'c mut dyn DeCtx<'a, Ctx>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait InliningDyn {
|
pub trait InliningDyn<'c>: 'c {
|
||||||
fn idread_n(self, n: usize) -> Result<(Vec<u8>, Box<Self>), Vec<u8>>;
|
fn idread_n(self, n: usize) -> Result<(Vec<u8>, Box<dyn InliningDyn<'c>>), Vec<u8>>;
|
||||||
|
|
||||||
fn idread_all(self) -> Vec<u8>;
|
fn idread_all(self) -> Vec<u8>;
|
||||||
|
|
||||||
fn idtell(&self) -> usize;
|
fn idtell(&self) -> usize;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<I: Inlining> InliningDyn for I {
|
impl<'c, I: 'c + Inlining> InliningDyn<'c> for I {
|
||||||
fn idread_n(self, n: usize) -> Result<(Vec<u8>, Box<Self>), Vec<u8>> {
|
fn idread_n(self, n: usize) -> Result<(Vec<u8>, Box<dyn InliningDyn<'c>>), Vec<u8>> {
|
||||||
let (vec, i) = self.iread_n(n, |slice| Vec::from(slice), |slice| Vec::from(slice))?;
|
let (vec, i) = self.iread_n(n, |slice| Vec::from(slice), |slice| Vec::from(slice))?;
|
||||||
Ok((vec, i.into()))
|
Ok((vec, Box::new(i)))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn idread_all(self) -> Vec<u8> {
|
fn idread_all(self) -> Vec<u8> {
|
||||||
@ -111,16 +111,16 @@ impl<I: Inlining> InliningDyn for I {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait InCtxDyn<'a, Ctx: Context<'a>>: InliningDyn {
|
pub trait InCtxDyn<'a: 'c, 'c, Ctx: Context<'a>>: InliningDyn<'c> {
|
||||||
fn icdnext_address(self) -> Result<(Address, Box<Self>), Vec<u8>>;
|
fn icdnext_address(self) -> Result<(Address, Box<dyn InCtxDyn<'a, 'c, Ctx>>), Vec<u8>>;
|
||||||
|
|
||||||
fn idresolver(&self) -> Rc<dyn Resolver<'a, Ctx>>;
|
fn idresolver(&self) -> Rc<dyn Resolver<'a, Ctx>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, Ctx: Context<'a>, I: InCtx<'a, Ctx>> InCtxDyn<'a, Ctx> for I {
|
impl<'a: 'c, 'c, Ctx: Context<'a>, I: 'c + InCtx<'a, Ctx>> InCtxDyn<'a, 'c, Ctx> for I {
|
||||||
fn icdnext_address(self) -> Result<(Address, Box<Self>), Vec<u8>> {
|
fn icdnext_address(self) -> Result<(Address, Box<dyn InCtxDyn<'a, 'c, Ctx>>), Vec<u8>> {
|
||||||
let (address, i) = self.icnext_address(|slice| Vec::from(slice))?;
|
let (address, i) = self.icnext_address(|slice| Vec::from(slice))?;
|
||||||
Ok((address, i.into()))
|
Ok((address, Box::new(i)))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn idresolver(&self) -> Rc<dyn Resolver<'a, Ctx>> {
|
fn idresolver(&self) -> Rc<dyn Resolver<'a, Ctx>> {
|
||||||
|
Loading…
Reference in New Issue
Block a user