Skip to main content

FnOf

Struct FnOf 

Source
pub struct FnOf<A, R>(/* private fields */);
Expand description

Names a callable with a complete canonical parameter and result signature.

The shared carrier always clones, regardless of argument/result capabilities. Equality and default construction are not implied.

§Examples

use cel_runtime::{FnOf, Nil, Leaf, ValueRepr, Callable, CNil};
let _: <FnOf<Nil, Leaf<i32>> as ValueRepr>::Value =
    Callable::from_fn(|_: &CNil<()>| Ok(7));

Non-list arguments cannot authorize a callable representation:

ⓘ
use cel_runtime::{FnOf, Leaf, ValueRepr};
let _ = FnOf::<Leaf<()>, Leaf<i32>>::value_type();

Trait Implementations§

Source§

impl<A, R> ValueRepr for FnOf<A, R>
where A: ArgumentList, R: ValueRepr,

Source§

fn value_type() -> ValueType

Describes every parameter and result node with canonical carrier ownership.

  • Complexity: O(n) time and storage for n signature nodes.
Source§

type Value = Callable<<A as ValueRepr>::Value, <R as ValueRepr>::Value>

The concrete, owned Rust representation.

Auto Trait Implementations§

§

impl<A, R> Freeze for FnOf<A, R>

§

impl<A, R> RefUnwindSafe for FnOf<A, R>

§

impl<A, R> Send for FnOf<A, R>

§

impl<A, R> Sync for FnOf<A, R>

§

impl<A, R> Unpin for FnOf<A, R>

§

impl<A, R> UnsafeUnpin for FnOf<A, R>

§

impl<A, R> UnwindSafe for FnOf<A, R>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.