MCPcopy Create free account
hub / github.com/cel-rust/cel-rust / from_context

Method from_context

cel/src/magic.rs:147–158  ·  view source on GitHub ↗
(ctx: &'a mut FunctionContext<'context, 'call>)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 6

ThisClass · 0.85
arg_value_from_contextFunction · 0.85
ArgumentsClass · 0.85
try_intoMethod · 0.80
cloneMethod · 0.80
resolveMethod · 0.45

Tested by

no test coverage detected