Trait Binder

Source
pub trait Binder {
    type Var: Binder<Var = Self::Var>;
    type Wrap<X: Binder>: Binder<Var = X::Var>;

    // Required methods
    fn get_var(self) -> Self::Var;
    fn get_var_ref(&self) -> &Self::Var;
    fn get_var_mut(&mut self) -> &mut Self::Var;
    fn inside<X: Binder<Var = X>>(
        self,
        f: &mut impl FnMut(Self::Var) -> X,
    ) -> Self::Wrap<X>;
}

Required Associated Types§

Source

type Var: Binder<Var = Self::Var>

Source

type Wrap<X: Binder>: Binder<Var = X::Var>

Required Methods§

Source

fn get_var(self) -> Self::Var

Source

fn get_var_ref(&self) -> &Self::Var

Source

fn get_var_mut(&mut self) -> &mut Self::Var

Source

fn inside<X: Binder<Var = X>>( self, f: &mut impl FnMut(Self::Var) -> X, ) -> Self::Wrap<X>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Binder for usize

Source§

type Var = usize

Source§

type Wrap<X: Binder> = X

Source§

fn get_var(self) -> Self::Var

Source§

fn get_var_ref(&self) -> &Self::Var

Source§

fn get_var_mut(&mut self) -> &mut Self::Var

Source§

fn inside<X: Binder<Var = X>>( self, f: &mut impl FnMut(Self::Var) -> X, ) -> Self::Wrap<X>

Source§

impl Binder for String

Source§

type Var = String

Source§

type Wrap<X: Binder> = X

Source§

fn get_var(self) -> Self::Var

Source§

fn get_var_ref(&self) -> &Self::Var

Source§

fn get_var_mut(&mut self) -> &mut Self::Var

Source§

fn inside<X: Binder<Var = X>>( self, f: &mut impl FnMut(Self::Var) -> X, ) -> Self::Wrap<X>

Implementors§

Source§

impl Binder for Id

Source§

type Var = Id

Source§

type Wrap<X: Binder> = X