Trait guion::util::traitcast::Traitcast[][src]

pub unsafe trait Traitcast<T, E>: Widget<E> where
    T: ?Sized,
    E: Env
{ type DestTypeID: ?Sized + 'static; unsafe fn _traitcast_ref<'s>(
        senf: &'s dyn Widget<E>
    ) -> Result<&'s T, GuionError<E>> { ... }
unsafe fn _try_traitcast_ref<'s>(
        senf: &'s dyn Widget<E>
    ) -> Result<&'s T, ()> { ... } }

Trait to secure Traitcasting, generally implemented by macro

  • Always implemented on dyn Widget<E>
  • T is the destination dyn Trait to which should be traitcasted
  • DestTypeID must be the same type as T, but with ’static lifetimes. Used to retrieve TypeID

Associated Types

type DestTypeID: ?Sized + 'static[src]

Loading content...

Provided methods

unsafe fn _traitcast_ref<'s>(
    senf: &'s dyn Widget<E>
) -> Result<&'s T, GuionError<E>>
[src]

unsafe fn _try_traitcast_ref<'s>(senf: &'s dyn Widget<E>) -> Result<&'s T, ()>[src]

Loading content...

Implementors

impl<'w, E> Traitcast<dyn Validation<E> + 'w, E> for dyn Widget<E> + 'w where
    E: Env
[src]

type DestTypeID = dyn Validation<E> + 'static

impl<'w, E> Traitcast<dyn ICheckBox<E> + 'w, E> for dyn Widget<E> + 'w where
    E: Env
[src]

type DestTypeID = dyn ICheckBox<E> + 'static

impl<'w, E> Traitcast<dyn ITextBox<E> + 'w, E> for dyn Widget<E> + 'w where
    E: Env
[src]

type DestTypeID = dyn ITextBox<E> + 'static

impl<'w, E> Traitcast<dyn Caption<E> + 'w, E> for dyn Widget<E> + 'w where
    E: Env
[src]

type DestTypeID = dyn Caption<E> + 'static

impl<'w, T, E> Traitcast<dyn AtomState<E, T> + 'w, E> for dyn Widget<E> + 'w where
    E: Env,
    T: 'static, 
[src]

type DestTypeID = dyn AtomState<E, T>

Loading content...