Skip to main content

Crate gloc

Crate gloc 

Source
Expand description

§gloc

The one-stop crate for GLOC — re-exports everything from gloc-core and gloc-macro so users only need a single dependency.

[dependencies]
gloc = "0.1"
use gloc::{cubit, Cubit, State};

Modules§

event
listener
GlocListener — react to state transitions on any reactor.
observer
GlocObserver — global interceptor for all reactor transitions.
provider
GlocProvider — shared ownership and lifecycle management for reactors.
reactor
state
stream
GlocStream — the reactive core of GLOC.

Structs§

GlocProvider
Provides shared read/write access to a reactor with explicit lifecycle management.
GlocStream
A shared, observable stream of state transitions.
GlocSubscription
A read-only handle to a GlocStream.
ReactorBase
A ready-to-use, heap-allocated Reactor implementation.

Traits§

GlocListener
A trait for types that react to state transitions on a reactor.
GlocObserver
A global observer that receives lifecycle and transition events from every managed reactor in the application.
Neutron
A neutron fired into a reactor to trigger a state transition.
Reactor
The core abstraction for state management in GLoC.
State
A marker trait for any type that can serve as state within a Cubit.

Functions§

clear_observer
Removes the currently registered observer.
observer
Returns the current global observer, if one has been registered.
set_observer
Registers observer as the global transition interceptor.

Type Aliases§

Event
Familiar alias for Neutron — use whichever name fits your mental model.

Attribute Macros§

reactor
Zero-boilerplate Reactor implementation generator.
reactor_state
Automatically injects Clone, PartialEq, and Debug derives onto a state struct or enum. Extra derives can be added via derive(...).