Trait anchors::expert::AnchorInner [−][src]
The engine-agnostic implementation of each type of Anchor. You likely don’t need to implement your own
AnchorInner
; instead use one of the built-in implementations.
Associated Types
Loading content...Required methods
fn dirty(&mut self, child: &<E::AnchorHandle as AnchorHandle>::Token)
[src]
Called by the engine to indicate some input may have changed.
If this AnchorInner
still cares about child
’s value, it should re-request
it next time poll_updated
is called.
fn poll_updated<G: UpdateContext<Engine = E>>(&mut self, ctx: &mut G) -> Poll
[src]
Called by the engine when it wants to know if this value has changed or
not. If some requested value from ctx
is Pending
, this method should
return Poll::Pending
; otherwise it must finish recalculation and report
either Poll::Updated
or Poll::Unchanged
.
fn output<'slf, 'out, G: OutputContext<'out, Engine = E>>(
&'slf self,
ctx: &mut G
) -> &'out Self::Output where
'slf: 'out,
[src]
&'slf self,
ctx: &mut G
) -> &'out Self::Output where
'slf: 'out,
Called by the engine to get the current output value of this AnchorInner
. This
is only called after this AnchorInner
reported in the return value from
poll_updated
the value was ready. If dirty
is called, this function will not
be called until poll_updated
returns a non-Pending value.
Provided methods
fn debug_location(&self) -> Option<(&'static str, &'static Location<'static>)>
[src]
An optional function to report the track_caller-derived callsite where this Anchor was created. Useful for debugging purposes.
Implementors
impl<E: Engine, T: 'static> AnchorInner<E> for Var<T, E::DirtyHandle>
[src]
type Output = T
fn dirty(&mut self, _edge: &<E::AnchorHandle as AnchorHandle>::Token)
[src]
fn poll_updated<G: UpdateContext<Engine = E>>(&mut self, ctx: &mut G) -> Poll
[src]
fn output<'slf, 'out, G: OutputContext<'out, Engine = E>>(
&'slf self,
_ctx: &mut G
) -> &'out Self::Output where
'slf: 'out,
[src]
&'slf self,
_ctx: &mut G
) -> &'out Self::Output where
'slf: 'out,
impl<T: 'static, E: Engine> AnchorInner<E> for Constant<T>
[src]
type Output = T
fn dirty(&mut self, _child: &<E::AnchorHandle as AnchorHandle>::Token)
[src]
fn poll_updated<G: UpdateContext<Engine = E>>(&mut self, _ctx: &mut G) -> Poll
[src]
fn output<'slf, 'out, G: OutputContext<'out, Engine = E>>(
&'slf self,
_ctx: &mut G
) -> &'out Self::Output where
'slf: 'out,
[src]
&'slf self,
_ctx: &mut G
) -> &'out Self::Output where
'slf: 'out,