Struct guion::widget::link::Link[][src]

pub struct Link<'c, E> where
    E: Env
{ pub ctx: &'c mut E::Context, pub widget: Resolved<'c, E>, }

Holds a immutable reference to the current Widget and the widget tree, also a mutable reference to the Context

Fields

ctx: &'c mut E::Contextwidget: Resolved<'c, E>

Implementations

impl<'c, E> Link<'c, E> where
    E: Env
[src]

pub fn mutate(
    &mut self,
    f: fn(_: WidgetRefMut<'_, E>, _: &mut E::Context, _: E::WidgetPath)
)
[src]

Enqueue mutable access to this widget

pub fn mutate_at<O>(
    &mut self,
    f: fn(_: WidgetRefMut<'_, E>, _: &mut E::Context, _: E::WidgetPath),
    o: O,
    p: i64
) where
    ECQueue<E>: Queue<StdEnqueueable<E>, O>, 
[src]

pub fn mutate_closure(
    &mut self,
    f: Box<dyn FnOnce(WidgetRefMut<'_, E>, &mut E::Context, E::WidgetPath) + 'static>
)
[src]

Enqueue mutable access to this widget

pub fn mutate_closure_at<O>(
    &mut self,
    f: Box<dyn FnOnce(WidgetRefMut<'_, E>, &mut E::Context, E::WidgetPath) + 'static>,
    o: O,
    p: i64
) where
    ECQueue<E>: Queue<StdEnqueueable<E>, O>, 
[src]

pub fn message_mut(&mut self, m: E::Message)[src]

Enqueue message-style invoking of WidgetMut::message

pub fn message_mut_at<O>(&mut self, m: E::Message, o: O, p: i64) where
    ECQueue<E>: Queue<StdEnqueueable<E>, O>, 
[src]

Enqueue message-style invoking of WidgetMut::message

pub fn later(&mut self, f: fn(_: WidgetRef<'_, E>, _: &mut E::Context))[src]

Enqueue immutable access to this widget

pub fn later_at<O>(
    &mut self,
    f: fn(_: WidgetRef<'_, E>, _: &mut E::Context),
    o: O,
    p: i64
) where
    ECQueue<E>: Queue<StdEnqueueable<E>, O>, 
[src]

pub fn later_closure(
    &mut self,
    f: Box<dyn FnOnce(WidgetRef<'_, E>, &mut E::Context) + Sync>
)
[src]

Enqueue immutable access to this widget

pub fn later_closure_at<O>(
    &mut self,
    f: Box<dyn FnOnce(WidgetRef<'_, E>, &mut E::Context) + Sync>,
    o: O,
    p: i64
) where
    ECQueue<E>: Queue<StdEnqueueable<E>, O>, 
[src]

pub fn enqueue_invalidate(&mut self)[src]

pub fn enqueue_validate_render(&mut self)[src]

Mark the current widget as validated

This should and should only be called from widget’s render fn

pub fn enqueue_validate_size(&mut self, s: ESize<E>)[src]

pub fn id(&self) -> E::WidgetID[src]

pub fn path(&self) -> E::WidgetPath[src]

pub fn ident(&self) -> WidgetIdent<E>[src]

pub fn render(&mut self, r: &mut RenderLink<'_, E>)[src]

pub fn event_direct(&mut self, e: &EventCompound<E>) -> EventResp[src]

send event to this widget

pub fn send_event(
    &mut self,
    e: &EventCompound<E>,
    child: E::WidgetPath
) -> Result<EventResp, GuionError<E>>
[src]

Send event to subpath

USER generally not called directly, rather through Widgets::send_event

pub fn size(&mut self, e: &EStyle<E>) -> ESize<E>[src]

Layout constraints of this widget

pub fn _event_root(&mut self, e: &EventCompound<E>) -> EventResp[src]

👎 Deprecated:

Non-root link is panic

pub fn _render(&mut self, r: &mut RenderLink<'_, E>)[src]

Bypasses Context and Handler(s)

pub fn _event_direct(&mut self, e: &EventCompound<E>) -> EventResp[src]

Bypasses Context and Handler(s)

pub fn _send_event(
    &mut self,
    e: &EventCompound<E>,
    child: E::WidgetPath
) -> Result<EventResp, GuionError<E>>
[src]

pub fn _size(&mut self, e: &EStyle<E>) -> ESize<E>[src]

Bypasses Context and Handler(s)

pub fn _tabulate(
    &mut self,
    op: TabulateOrigin<E>,
    dir: TabulateDirection
) -> Result<TabulateResponse<E>, GuionError<E>>
[src]

pub fn trace_bounds(
    &mut self,
    root_bounds: &Bounds,
    e: &EStyle<E>,
    force: bool
) -> Bounds
[src]

👎 Deprecated:

Not needed in OOF anymore

pub fn _trace_bounds(
    &mut self,
    sub: E::WidgetPath,
    root_bounds: &Bounds,
    e: &EStyle<E>,
    force: bool
) -> Result<Bounds, GuionError<E>>
[src]

👎 Deprecated:

Not needed in OOF anymore

pub fn is_hovered(&self) -> bool where
    E::Context: CtxStdState<E>, 
[src]

pub fn is_focused(&self) -> bool where
    E::Context: CtxStdState<E>, 
[src]

pub fn child_paths(&self) -> Vec<E::WidgetPath>[src]

👎 Deprecated

pub fn for_childs<'s>(
    &'s mut self,
    f: impl FnMut(Link<'_, E>)
) -> Result<(), GuionError<E>> where
    'c: 's, 
[src]

Run closure for every child

pub fn for_child<'s>(
    &'s mut self,
    i: usize
) -> Result<Link<'_, E>, GuionError<E>> where
    'c: 's, 
[src]

Get Link for specific child by index

pub fn child_sizes(
    &mut self,
    e: &EStyle<E>
) -> Result<Vec<ESize<E>>, GuionError<E>>
[src]

pub fn child_bounds(
    &mut self,
    b: &Bounds,
    e: &EStyle<E>,
    force: bool
) -> Result<Vec<Bounds>, ()>
[src]

pub fn with_widget<'s>(
    &'s mut self,
    p: E::WidgetPath
) -> Result<Link<'s, E>, GuionError<E>> where
    'c: 's, 
[src]

Link for Widget by Path, resolves Widget by Path

pub fn with_child_specific<'s>(
    &'s mut self,
    rw: Resolvable<'s, E>
) -> Result<Link<'s, E>, GuionError<E>> where
    'c: 's, 
[src]

Current widget must be parent of rw

pub fn with_resolvable<'s>(
    &'s mut self,
    rw: Resolvable<'s, E>,
    path: E::WidgetPath
) -> Result<Link<'s, E>, GuionError<E>> where
    'c: 's, 
[src]

pub fn with_root<'s>(&'s mut self) -> Result<Link<'s, E>, ()> where
    'c: 's, 
[src]

pub fn resolve_sub<'s>(
    &'s mut self,
    p: E::WidgetPath
) -> Result<Link<'s, E>, GuionError<E>> where
    'c: 's, 
[src]

pub fn reference<'s>(&'s mut self) -> Link<'s, E> where
    'c: 's, 
[src]

pub fn childs<'s>(&'s self) -> impl Iterator<Item = Resolvable<'s, E>> + 's where
    'c: 's, 
[src]

pub fn parents(&'c self) -> Parents<'c, E>[src]

Iterate from current up to the root element

pub fn with_ctx<F: Env<WidgetPath = E::WidgetPath, Storage = E::Storage>>(
    self,
    ctx: &'c mut F::Context
) -> Link<'c, F> where
    E::WidgetPath: WidgetPath<F>,
    E::Storage: Widgets<F>, 
[src]

pub fn enqueue<I, O>(&mut self, i: I, o: O, p: i64) where
    ECQueue<E>: Queue<I, O>, 
[src]

Trait Implementations

impl<'a, E> Deref for Link<'a, E> where
    E: Env
[src]

type Target = E::Context

The resulting type after dereferencing.

impl<'a, E> DerefMut for Link<'a, E> where
    E: Env
[src]

Auto Trait Implementations

impl<'c, E> !RefUnwindSafe for Link<'c, E>

impl<'c, E> !Send for Link<'c, E>

impl<'c, E> !Sync for Link<'c, E>

impl<'c, E> Unpin for Link<'c, E> where
    <E as Env>::WidgetPath: Unpin

impl<'c, E> !UnwindSafe for Link<'c, E>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> FromInto<U> for T where
    T: From<U> + Into<U>, 
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<'_, S, T, E> StyleSelectorAppend<&'_ S, E> for T where
    T: StyleSelectorAppend<S, E>,
    S: StyleSelectag<E>, 
[src]

impl<'a, S, T, E> StyleSelectorAppend<&'a [S], E> for T where
    T: StyleSelectorAppend<S, E>,
    S: StyleSelectag<E>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.