intuicio_core::transformer

Trait ValueTransformer

Source
pub trait ValueTransformer {
    type Type;
    type Borrow<'r>
       where Self::Type: 'r;
    type BorrowMut<'r>
       where Self::Type: 'r;
    type Dependency;
    type Owned;
    type Ref;
    type RefMut;

    // Required methods
    fn from_owned(registry: &Registry, value: Self::Type) -> Self::Owned;
    fn from_ref(
        registry: &Registry,
        value: &Self::Type,
        dependency: Option<Self::Dependency>,
    ) -> Self::Ref;
    fn from_ref_mut(
        registry: &Registry,
        value: &mut Self::Type,
        dependency: Option<Self::Dependency>,
    ) -> Self::RefMut;
    fn into_owned(value: Self::Owned) -> Self::Type;
    fn into_ref(value: &Self::Ref) -> Self::Borrow<'_>;
    fn into_ref_mut(value: &mut Self::RefMut) -> Self::BorrowMut<'_>;
}

Required Associated Types§

Source

type Type

Source

type Borrow<'r> where Self::Type: 'r

Source

type BorrowMut<'r> where Self::Type: 'r

Source

type Dependency

Source

type Owned

Source

type Ref

Source

type RefMut

Required Methods§

Source

fn from_owned(registry: &Registry, value: Self::Type) -> Self::Owned

Source

fn from_ref( registry: &Registry, value: &Self::Type, dependency: Option<Self::Dependency>, ) -> Self::Ref

Source

fn from_ref_mut( registry: &Registry, value: &mut Self::Type, dependency: Option<Self::Dependency>, ) -> Self::RefMut

Source

fn into_owned(value: Self::Owned) -> Self::Type

Source

fn into_ref(value: &Self::Ref) -> Self::Borrow<'_>

Source

fn into_ref_mut(value: &mut Self::RefMut) -> Self::BorrowMut<'_>

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.

Implementors§

Source§

impl<T> ValueTransformer for ManagedValueTransformer<T>

Source§

impl<T: 'static> ValueTransformer for DynamicManagedValueTransformer<T>

Source§

impl<T: Clone + 'static> ValueTransformer for DynamicManagedBoxValueTransformer<T>

Source§

impl<T: Clone> ValueTransformer for ManagedBoxValueTransformer<T>

Source§

impl<T: Default + Clone + 'static> ValueTransformer for SharedValueTransformer<T>

Source§

type Type = T

Source§

type Borrow<'r> = Ref<'r, T>

Source§

type BorrowMut<'r> = RefMut<'r, T>

Source§

type Dependency = ()

Source§

type Owned = Shared<T>

Source§

type Ref = Shared<T>

Source§

type RefMut = Shared<T>