[−][src]Struct woab::BuilderUtilizer
Context for utilizing a gtk::Builder
and connecting it to he Actix world.
See woab::Factory
for usage example.
Implementations
impl<A, W, S> BuilderUtilizer<A, W, S> where
&'a Builder: TryInto<W>,
[src]
&'a Builder: TryInto<W>,
pub fn widgets(&self) -> Result<W, <&Builder as TryInto<W>>::Error>
[src]
Create a widgets struct (as defined by the W
generic parameter of
woab::Factory
) and map the builder's widgets to its fields.
impl<A, W, S> BuilderUtilizer<A, W, S> where
A: Actor<Context = Context<A>>,
&'a Builder: TryInto<W>,
S: BuilderSignal,
A: StreamHandler<S>,
[src]
A: Actor<Context = Context<A>>,
&'a Builder: TryInto<W>,
S: BuilderSignal,
A: StreamHandler<S>,
pub fn actor(
&self,
make_actor: impl FnOnce(&mut A::Context, W) -> A
) -> Result<Addr<A>, <&Builder as TryInto<W>>::Error>
[src]
&self,
make_actor: impl FnOnce(&mut A::Context, W) -> A
) -> Result<Addr<A>, <&Builder as TryInto<W>>::Error>
Create an Actix actor and connect it to the builder's widgets and signals.
make_actor
is a function that receives the actor context and the widgets, and is
responsible for constructing the actor struct with the widgets inside it. It can also be
used for configuring and or showing the widgets GTK-wise (though this can also be handled
by the actor afterwards)
impl<A, W, S> BuilderUtilizer<A, W, S> where
S: BuilderSignal,
[src]
S: BuilderSignal,
pub fn stream_builder_signals(&self) -> Option<Receiver<S>>
[src]
Create a stream (based on Tokio's MSPC) of signals that arrive from the builder.
- The signals are all represented by the third generic parameter (
S
) ofwoab::Factory
- if the builder sends signals not covered byS
's variants they'll be ignored. - If the builder defines no signals, or if none of the signals it defines are covered by
S
, this method will returnNone
. This is important because otherwise it would have returned a stream stream will be closed automatically for having no transmitters, which - by default - will make Actix close the actor.
pub fn connect_tagged_builder_signals<T, C, AA>(
&self,
ctx: &mut C,
tag: T
) -> &Self where
T: Clone + 'static,
AA: Actor<Context = C>,
C: AsyncContext<AA>,
AA: StreamHandler<(T, S)>,
[src]
&self,
ctx: &mut C,
tag: T
) -> &Self where
T: Clone + 'static,
AA: Actor<Context = C>,
C: AsyncContext<AA>,
AA: StreamHandler<(T, S)>,
Stream the signals generated by the builder to an actor represented by ctx
, together with
a tag.
When using the same actor to handle multiple copies of the same set of widgets (e.g.
multiple GtkListBoxRow
s) the tag can be used to determine which copy generated the
signal.
If multiple tagged signals are streamed to the same actor - which is the typical use case
for tagged signals - StreamHandler::finished
should be overridden to avoid stopping the
actor when one instance of the widgets is removed!!!
Trait Implementations
Auto Trait Implementations
impl<A, W, S> RefUnwindSafe for BuilderUtilizer<A, W, S> where
A: RefUnwindSafe,
S: RefUnwindSafe,
W: RefUnwindSafe,
A: RefUnwindSafe,
S: RefUnwindSafe,
W: RefUnwindSafe,
impl<A, W, S> !Send for BuilderUtilizer<A, W, S>
impl<A, W, S> !Sync for BuilderUtilizer<A, W, S>
impl<A, W, S> Unpin for BuilderUtilizer<A, W, S> where
A: Unpin,
S: Unpin,
W: Unpin,
A: Unpin,
S: Unpin,
W: Unpin,
impl<A, W, S> UnwindSafe for BuilderUtilizer<A, W, S> where
A: UnwindSafe,
S: UnwindSafe,
W: UnwindSafe,
A: UnwindSafe,
S: UnwindSafe,
W: UnwindSafe,
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,