Struct guion::widget::link::Link [−][src]
Holds a immutable reference to the current Widget
and the widget tree, also a mutable reference to the Context
Fields
ctx: &'c mut E::Context
widget: Resolved<'c, E>
Implementations
impl<'c, E> Link<'c, E> where
E: Env,
[src]
E: Env,
pub fn mutate(
&mut self,
f: fn(_: WidgetRefMut<'_, E>, _: &mut E::Context, _: E::WidgetPath)
)
[src]
&mut self,
f: fn(_: WidgetRefMut<'_, E>, _: &mut E::Context, _: E::WidgetPath)
)
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]
&mut self,
f: fn(_: WidgetRefMut<'_, E>, _: &mut E::Context, _: E::WidgetPath),
o: O,
p: i64
) where
ECQueue<E>: Queue<StdEnqueueable<E>, O>,
pub fn mutate_closure(
&mut self,
f: Box<dyn FnOnce(WidgetRefMut<'_, E>, &mut E::Context, E::WidgetPath) + 'static>
)
[src]
&mut self,
f: Box<dyn FnOnce(WidgetRefMut<'_, E>, &mut E::Context, E::WidgetPath) + 'static>
)
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]
&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>,
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]
ECQueue<E>: Queue<StdEnqueueable<E>, O>,
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]
&mut self,
f: fn(_: WidgetRef<'_, E>, _: &mut E::Context),
o: O,
p: i64
) where
ECQueue<E>: Queue<StdEnqueueable<E>, O>,
pub fn later_closure(
&mut self,
f: Box<dyn FnOnce(WidgetRef<'_, E>, &mut E::Context) + Sync>
)
[src]
&mut self,
f: Box<dyn FnOnce(WidgetRef<'_, E>, &mut E::Context) + Sync>
)
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]
&mut self,
f: Box<dyn FnOnce(WidgetRef<'_, E>, &mut E::Context) + Sync>,
o: O,
p: i64
) where
ECQueue<E>: Queue<StdEnqueueable<E>, O>,
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]
&mut self,
e: &EventCompound<E>,
child: E::WidgetPath
) -> Result<EventResp, GuionError<E>>
Send event to subpath
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]
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]
&mut self,
e: &EventCompound<E>,
child: E::WidgetPath
) -> Result<EventResp, GuionError<E>>
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]
&mut self,
op: TabulateOrigin<E>,
dir: TabulateDirection
) -> Result<TabulateResponse<E>, GuionError<E>>
pub fn trace_bounds(
&mut self,
root_bounds: &Bounds,
e: &EStyle<E>,
force: bool
) -> Bounds
[src]
&mut self,
root_bounds: &Bounds,
e: &EStyle<E>,
force: bool
) -> Bounds
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]
&mut self,
sub: E::WidgetPath,
root_bounds: &Bounds,
e: &EStyle<E>,
force: bool
) -> Result<Bounds, GuionError<E>>
Not needed in OOF anymore
pub fn is_hovered(&self) -> bool where
E::Context: CtxStdState<E>,
[src]
E::Context: CtxStdState<E>,
pub fn is_focused(&self) -> bool where
E::Context: CtxStdState<E>,
[src]
E::Context: CtxStdState<E>,
pub fn child_paths(&self) -> Vec<E::WidgetPath>
[src]
pub fn for_childs<'s>(
&'s mut self,
f: impl FnMut(Link<'_, E>)
) -> Result<(), GuionError<E>> where
'c: 's,
[src]
&'s mut self,
f: impl FnMut(Link<'_, E>)
) -> Result<(), GuionError<E>> where
'c: 's,
Run closure for every child
pub fn for_child<'s>(
&'s mut self,
i: usize
) -> Result<Link<'_, E>, GuionError<E>> where
'c: 's,
[src]
&'s mut self,
i: usize
) -> Result<Link<'_, E>, GuionError<E>> where
'c: 's,
Get Link for specific child by index
pub fn _with_link<'s>(
ctx: &mut E::Context,
w: Resolved<'s, E>,
f: impl FnOnce(Link<'_, E>)
) where
'c: 's,
[src]
ctx: &mut E::Context,
w: Resolved<'s, E>,
f: impl FnOnce(Link<'_, E>)
) where
'c: 's,
pub fn child_sizes(
&mut self,
e: &EStyle<E>
) -> Result<Vec<ESize<E>>, GuionError<E>>
[src]
&mut self,
e: &EStyle<E>
) -> Result<Vec<ESize<E>>, GuionError<E>>
pub fn child_bounds(
&mut self,
b: &Bounds,
e: &EStyle<E>,
force: bool
) -> Result<Vec<Bounds>, ()>
[src]
&mut self,
b: &Bounds,
e: &EStyle<E>,
force: bool
) -> Result<Vec<Bounds>, ()>
pub fn with_widget<'s>(
&'s mut self,
p: E::WidgetPath
) -> Result<Link<'s, E>, GuionError<E>> where
'c: 's,
[src]
&'s mut self,
p: E::WidgetPath
) -> Result<Link<'s, E>, GuionError<E>> where
'c: 's,
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]
&'s mut self,
rw: Resolvable<'s, E>
) -> Result<Link<'s, E>, GuionError<E>> where
'c: 's,
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]
&'s mut self,
rw: Resolvable<'s, E>,
path: E::WidgetPath
) -> Result<Link<'s, E>, GuionError<E>> where
'c: 's,
pub fn with_root<'s>(&'s mut self) -> Result<Link<'s, E>, ()> where
'c: 's,
[src]
'c: 's,
pub fn resolve_sub<'s>(
&'s mut self,
p: E::WidgetPath
) -> Result<Link<'s, E>, GuionError<E>> where
'c: 's,
[src]
&'s mut self,
p: E::WidgetPath
) -> Result<Link<'s, E>, GuionError<E>> where
'c: 's,
pub fn reference<'s>(&'s mut self) -> Link<'s, E> where
'c: 's,
[src]
'c: 's,
pub fn childs<'s>(&'s self) -> impl Iterator<Item = Resolvable<'s, E>> + 's where
'c: 's,
[src]
'c: 's,
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]
self,
ctx: &'c mut F::Context
) -> Link<'c, F> where
E::WidgetPath: WidgetPath<F>,
E::Storage: Widgets<F>,
pub fn enqueue<I, O>(&mut self, i: I, o: O, p: i64) where
ECQueue<E>: Queue<I, O>,
[src]
ECQueue<E>: Queue<I, O>,
Trait Implementations
impl<'a, E> Deref for Link<'a, E> where
E: Env,
[src]
E: Env,
type Target = E::Context
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
impl<'a, E> DerefMut for Link<'a, E> where
E: Env,
[src]
E: Env,
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,
<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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> FromInto<U> for T where
T: From<U> + Into<U>,
[src]
T: From<U> + Into<U>,
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<'_, S, T, E> StyleSelectorAppend<&'_ S, E> for T where
T: StyleSelectorAppend<S, E>,
S: StyleSelectag<E>,
[src]
T: StyleSelectorAppend<S, E>,
S: StyleSelectag<E>,
pub fn append(&mut Self, &S)
[src]
fn with(&self, selectag: S) -> Self where
Self: Sized,
[src]
Self: Sized,
fn from(selectag: S) -> Self where
Self: Sized,
[src]
Self: Sized,
impl<'a, S, T, E> StyleSelectorAppend<&'a [S], E> for T where
T: StyleSelectorAppend<S, E>,
S: StyleSelectag<E>,
[src]
T: StyleSelectorAppend<S, E>,
S: StyleSelectag<E>,
pub fn append(&mut Self, &[S])
[src]
fn with(&self, selectag: S) -> Self where
Self: Sized,
[src]
Self: Sized,
fn from(selectag: S) -> Self where
Self: Sized,
[src]
Self: Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,