RegistryAccess

Struct RegistryAccess 

Source
pub struct RegistryAccess<'r, Ctx, T> { /* private fields */ }

Implementations§

Source§

impl<'r, Ctx: EvalType, T: EvalType> RegistryAccess<'r, Ctx, T>

Source

pub fn register_type<T2: EvalType>(&mut self) -> Result<()>

Source

pub fn register_cast<To>( &mut self, cast_fn: for<'a> fn(&'a Ctx, T::RefType<'a>) -> To::RefType<'a>, ) -> Result<()>
where To: EvalType,

Source

pub fn register_un_op( &mut self, op: UnOp, un_op_fn: for<'a> fn(&'a Ctx, T::RefType<'a>) -> T::RefType<'a>, ) -> Result<()>

Source

pub fn register_bin_op( &mut self, op: BinOp, bin_op_fn: for<'a> fn(&'a Ctx, T::RefType<'a>, T::RefType<'a>) -> T::RefType<'a>, ) -> Result<()>

Source

pub fn register_field_access<Field>( &mut self, field: &'static str, getter: for<'a> fn(&'a T) -> Field::RefType<'a>, ) -> Result<()>
where T: for<'a> EvalType<RefType<'a> = &'a T>, Field: EvalType,

Source§

impl<'r, Ctx, T> RegistryAccess<'r, Ctx, T>
where Ctx: EvalType, T: for<'a> EvalType<RefType<'a> = &'a T>,

Source

pub fn register_method_call_0<Ret>( &mut self, method: &'static str, method_fn: for<'a> fn(&'a T) -> Ret::RefType<'a>, ) -> Result<()>
where Ret: EvalType,

Source

pub fn register_method_call_1<A1, Ret>( &mut self, method: &'static str, method_fn: for<'a> fn(&'a T, A1::RefType<'a>) -> Ret::RefType<'a>, ) -> Result<()>
where A1: EvalType, Ret: EvalType,

Source

pub fn register_method_call_2<A1, A2, Ret>( &mut self, method: &'static str, method_fn: for<'a> fn(&'a T, A1::RefType<'a>, A2::RefType<'a>) -> Ret::RefType<'a>, ) -> Result<()>
where A1: EvalType, A2: EvalType, Ret: EvalType,

Source

pub fn register_method_call_3<A1, A2, A3, Ret>( &mut self, method: &'static str, method_fn: for<'a> fn(&'a T, A1::RefType<'a>, A2::RefType<'a>, A3::RefType<'a>) -> Ret::RefType<'a>, ) -> Result<()>
where A1: EvalType, A2: EvalType, A3: EvalType, Ret: EvalType,

Source

pub fn register_method_call_4<A1, A2, A3, A4, Ret>( &mut self, method: &'static str, method_fn: for<'a> fn(&'a T, A1::RefType<'a>, A2::RefType<'a>, A3::RefType<'a>, A4::RefType<'a>) -> Ret::RefType<'a>, ) -> Result<()>
where A1: EvalType, A2: EvalType, A3: EvalType, A4: EvalType, Ret: EvalType,

Source

pub fn register_method_call_5<A1, A2, A3, A4, A5, Ret>( &mut self, method: &'static str, method_fn: for<'a> fn(&'a T, A1::RefType<'a>, A2::RefType<'a>, A3::RefType<'a>, A4::RefType<'a>, A5::RefType<'a>) -> Ret::RefType<'a>, ) -> Result<()>
where A1: EvalType, A2: EvalType, A3: EvalType, A4: EvalType, A5: EvalType, Ret: EvalType,

Auto Trait Implementations§

§

impl<'r, Ctx, T> Freeze for RegistryAccess<'r, Ctx, T>

§

impl<'r, Ctx, T> !RefUnwindSafe for RegistryAccess<'r, Ctx, T>

§

impl<'r, Ctx, T> !Send for RegistryAccess<'r, Ctx, T>

§

impl<'r, Ctx, T> !Sync for RegistryAccess<'r, Ctx, T>

§

impl<'r, Ctx, T> Unpin for RegistryAccess<'r, Ctx, T>
where Ctx: Unpin, T: Unpin,

§

impl<'r, Ctx, T> !UnwindSafe for RegistryAccess<'r, Ctx, T>

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<'src, T> IntoMaybe<'src, T> for T
where T: 'src,

Source§

type Proj<U: 'src> = U

Source§

fn map_maybe<R>( self, _f: impl FnOnce(&'src T) -> &'src R, g: impl FnOnce(T) -> R, ) -> <T as IntoMaybe<'src, T>>::Proj<R>
where R: 'src,

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.
Source§

impl<T> WithSpan for T

Source§

fn with_span(self, span: impl Into<Span>) -> Spanned<Self>

Source§

fn test_span(self) -> Spanned<Self>