(ctx: &'a mut FunctionContext<'context, 'call>)
| 145 | T: FromValue, |
| 146 | { |
| 147 | fn from_context(ctx: &'a mut FunctionContext<'context, 'call>) -> Result<Self, ExecutionError> |
| 148 | where |
| 149 | Self: Sized, |
| 150 | { |
| 151 | if let Some(ref this) = ctx.this { |
| 152 | Ok(This(T::from_value(&this.as_ref().try_into()?)?)) |
| 153 | } else { |
| 154 | let arg = arg_value_from_context(ctx) |
| 155 | .map_err(|_| ExecutionError::missing_argument_or_target())?; |
| 156 | Ok(This(T::from_value(&arg)?)) |
| 157 | } |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | /// Identifier is an argument extractor that attempts to extract an identifier |