InCtx::demote
				
					
				
			This commit is contained in:
		
							parent
							
								
									0edcafad2a
								
							
						
					
					
						commit
						62b631d33d
					
				| @ -20,6 +20,11 @@ pub trait InCtx<'a, Ctx: Context<'a>>: Inlining { | |||||||
| 
 | 
 | ||||||
|     /// Clone the reference to the current [Resolver].
 |     /// Clone the reference to the current [Resolver].
 | ||||||
|     fn iresolver(&self) -> Rc<dyn Resolver<'a, Ctx>>; |     fn iresolver(&self) -> Rc<dyn Resolver<'a, Ctx>>; | ||||||
|  | 
 | ||||||
|  |     fn demote<'d>(self) -> Demoted<'a, 'd, Ctx> | ||||||
|  |     where | ||||||
|  |         'a: 'd, | ||||||
|  |         Self: 'd; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| impl<'a: 'c, 'c, Ctx: Context<'a>> Inlining for &'c mut dyn DeCtx<'a, Ctx> { | impl<'a: 'c, 'c, Ctx: Context<'a>> Inlining for &'c mut dyn DeCtx<'a, Ctx> { | ||||||
| @ -56,4 +61,12 @@ impl<'a: 'c, 'c, Ctx: Context<'a>> InCtx<'a, Ctx> for &'c mut dyn DeCtx<'a, Ctx> | |||||||
|     fn iresolver(&self) -> Rc<dyn Resolver<'a, Ctx>> { |     fn iresolver(&self) -> Rc<dyn Resolver<'a, Ctx>> { | ||||||
|         self.resolver() |         self.resolver() | ||||||
|     } |     } | ||||||
|  | 
 | ||||||
|  |     fn demote<'d>(self) -> Demoted<'a, 'd, Ctx> | ||||||
|  |     where | ||||||
|  |         'a: 'd, | ||||||
|  |         Self: 'd, | ||||||
|  |     { | ||||||
|  |         Demoted(self) | ||||||
|  |     } | ||||||
| } | } | ||||||
|  | |||||||
| @ -22,6 +22,8 @@ pub trait InCtxDyn<'a: 'c, 'c, Ctx: Context<'a>>: 'c { | |||||||
|     fn idnext_address(self) -> ResultDyn<Address, Box<dyn InCtxDyn<'a, 'c, Ctx>>>; |     fn idnext_address(self) -> ResultDyn<Address, Box<dyn InCtxDyn<'a, 'c, Ctx>>>; | ||||||
| 
 | 
 | ||||||
|     fn idresolver(&self) -> Rc<dyn Resolver<'a, Ctx>>; |     fn idresolver(&self) -> Rc<dyn Resolver<'a, Ctx>>; | ||||||
|  | 
 | ||||||
|  |     fn iddemote(self) -> Demoted<'a, 'c, Ctx>; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| impl<'a: 'c, 'c, Ctx: Context<'a>, I: 'c + InCtx<'a, Ctx>> InCtxDyn<'a, 'c, Ctx> for I { | impl<'a: 'c, 'c, Ctx: Context<'a>, I: 'c + InCtx<'a, Ctx>> InCtxDyn<'a, 'c, Ctx> for I { | ||||||
| @ -46,6 +48,10 @@ impl<'a: 'c, 'c, Ctx: Context<'a>, I: 'c + InCtx<'a, Ctx>> InCtxDyn<'a, 'c, Ctx> | |||||||
|     fn idresolver(&self) -> Rc<dyn Resolver<'a, Ctx>> { |     fn idresolver(&self) -> Rc<dyn Resolver<'a, Ctx>> { | ||||||
|         self.iresolver() |         self.iresolver() | ||||||
|     } |     } | ||||||
|  | 
 | ||||||
|  |     fn iddemote(self) -> Demoted<'a, 'c, Ctx> { | ||||||
|  |         self.demote() | ||||||
|  |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| impl<'a: 'c, 'c, Ctx: Context<'a>> Inlining for Box<dyn InCtxDyn<'a, 'c, Ctx>> { | impl<'a: 'c, 'c, Ctx: Context<'a>> Inlining for Box<dyn InCtxDyn<'a, 'c, Ctx>> { | ||||||
| @ -76,6 +82,14 @@ impl<'a: 'c, 'c, Ctx: Context<'a>> InCtx<'a, Ctx> for Box<dyn InCtxDyn<'a, 'c, C | |||||||
|     fn iresolver(&self) -> Rc<dyn Resolver<'a, Ctx>> { |     fn iresolver(&self) -> Rc<dyn Resolver<'a, Ctx>> { | ||||||
|         self.idresolver() |         self.idresolver() | ||||||
|     } |     } | ||||||
|  | 
 | ||||||
|  |     fn demote<'d>(self) -> Demoted<'a, 'd, Ctx> | ||||||
|  |     where | ||||||
|  |         'a: 'd, | ||||||
|  |         Self: 'd, | ||||||
|  |     { | ||||||
|  |         self.iddemote() | ||||||
|  |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| pub type IParseResult<'a, Ctx, F, I> = | pub type IParseResult<'a, Ctx, F, I> = | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user